xref: /illumos-gate/usr/src/cmd/truss/Makefile (revision 6f9914e76c95c47153b47dd2e8a47938b2f73acd)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*6f9914e7SRichard Lowe# Common Development and Distribution License (the "License").
6*6f9914e7SRichard Lowe# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
21*6f9914e7SRichard Lowe
227c478bd9Sstevel@tonic-gate#
23*6f9914e7SRichard Lowe# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24*6f9914e7SRichard Lowe# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
26*6f9914e7SRichard Lowe# Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
27*6f9914e7SRichard Lowe# Copyright (c) 2016 by Delphix. All rights reserved.
28*6f9914e7SRichard Lowe# Copyright 2019 Joyent, Inc.
29*6f9914e7SRichard Lowe# Copyright 2023 Oxide Computer Co.
307c478bd9Sstevel@tonic-gate#
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gatePROG=	truss
337c478bd9Sstevel@tonic-gate
34*6f9914e7SRichard LoweOBJS=			\
35*6f9914e7SRichard Lowe	main.o		\
36*6f9914e7SRichard Lowe	listopts.o	\
37*6f9914e7SRichard Lowe	ipc.o		\
38*6f9914e7SRichard Lowe	actions.o	\
39*6f9914e7SRichard Lowe	expound.o	\
40*6f9914e7SRichard Lowe	codes.o		\
41*6f9914e7SRichard Lowe	print.o		\
42*6f9914e7SRichard Lowe	ramdata.o	\
43*6f9914e7SRichard Lowe	systable.o	\
44*6f9914e7SRichard Lowe	procset.o	\
45*6f9914e7SRichard Lowe	stat.o		\
46*6f9914e7SRichard Lowe	fcall.o		\
47*6f9914e7SRichard Lowe	htbl.o
48*6f9914e7SRichard Lowe
49*6f9914e7SRichard Lowe.PARALLEL: $(OBJS)
50*6f9914e7SRichard Lowe
517c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
52*6f9914e7SRichard Loweinclude ../Makefile.cmd.64
53*6f9914e7SRichard Loweinclude ../Makefile.ctf
547c478bd9Sstevel@tonic-gate
55*6f9914e7SRichard LoweCTF_MODE	= link
567c478bd9Sstevel@tonic-gate
57*6f9914e7SRichard LoweCFLAGS		+= $(CCVERBOSE)
58*6f9914e7SRichard Lowe
59*6f9914e7SRichard LoweCERRWARN	+= $(CNOWARN_UNINIT)
60*6f9914e7SRichard LoweCERRWARN	+= -_gcc=-Wno-switch
61*6f9914e7SRichard Lowe
62*6f9914e7SRichard Lowe# not linted
63*6f9914e7SRichard LoweSMATCH=off
64*6f9914e7SRichard Lowe
65*6f9914e7SRichard LoweCSTD=	$(CSTD_GNU99)
66*6f9914e7SRichard Lowe
67*6f9914e7SRichard LoweLDLIBS	+= -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
68*6f9914e7SRichard LoweCPPFLAGS += -D_REENTRANT
69*6f9914e7SRichard LoweCPPFLAGS += -I$(SRC)/uts/common/fs/zfs
70*6f9914e7SRichard LoweCPPFLAGS += -I$(SRC)/uts/common
71*6f9914e7SRichard Lowe
72*6f9914e7SRichard LoweROOTLINK = $(PROG:%=$(ROOTBIN64)/%)
737c478bd9Sstevel@tonic-gate
747c478bd9Sstevel@tonic-gate.KEEP_STATE:
757c478bd9Sstevel@tonic-gate
76*6f9914e7SRichard Lowe%.o:	%.c
77*6f9914e7SRichard Lowe	$(COMPILE.c) $<
78*6f9914e7SRichard Lowe	$(POST_PROCESS_O)
797c478bd9Sstevel@tonic-gate
80*6f9914e7SRichard Loweall: $(PROG)
817c478bd9Sstevel@tonic-gate
82*6f9914e7SRichard Loweinstall: all $(ROOTPROG) $(ROOTLINK)
837c478bd9Sstevel@tonic-gate
84*6f9914e7SRichard Lowe$(ROOTLINK):
85*6f9914e7SRichard Lowe	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
867c478bd9Sstevel@tonic-gate
87*6f9914e7SRichard Lowe$(PROG): $(OBJS)
88*6f9914e7SRichard Lowe	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
89*6f9914e7SRichard Lowe	$(POST_PROCESS)
90*6f9914e7SRichard Lowe
91*6f9914e7SRichard Loweclean:
92*6f9914e7SRichard Lowe	$(RM) $(OBJS)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
95