xref: /illumos-gate/usr/src/cmd/truss/Makefile (revision 7671517e13b8123748eda4ef1ee165c6d9dba7fe)
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
56f9914e7SRichard Lowe# Common Development and Distribution License (the "License").
66f9914e7SRichard 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#
216f9914e7SRichard Lowe
227c478bd9Sstevel@tonic-gate#
236f9914e7SRichard Lowe# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
246f9914e7SRichard Lowe# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
266f9914e7SRichard Lowe# Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
276f9914e7SRichard Lowe# Copyright (c) 2016 by Delphix. All rights reserved.
286f9914e7SRichard Lowe# Copyright 2019 Joyent, Inc.
296f9914e7SRichard Lowe# Copyright 2023 Oxide Computer Co.
307c478bd9Sstevel@tonic-gate#
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gatePROG=	truss
337c478bd9Sstevel@tonic-gate
346f9914e7SRichard LoweOBJS=			\
356f9914e7SRichard Lowe	main.o		\
366f9914e7SRichard Lowe	listopts.o	\
376f9914e7SRichard Lowe	ipc.o		\
386f9914e7SRichard Lowe	actions.o	\
396f9914e7SRichard Lowe	expound.o	\
406f9914e7SRichard Lowe	codes.o		\
41*7671517eSToomas Soome	codes_bhyve.o	\
426f9914e7SRichard Lowe	print.o		\
436f9914e7SRichard Lowe	ramdata.o	\
446f9914e7SRichard Lowe	systable.o	\
456f9914e7SRichard Lowe	procset.o	\
466f9914e7SRichard Lowe	stat.o		\
476f9914e7SRichard Lowe	fcall.o		\
486f9914e7SRichard Lowe	htbl.o
496f9914e7SRichard Lowe
506f9914e7SRichard Lowe.PARALLEL: $(OBJS)
516f9914e7SRichard Lowe
527c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
536f9914e7SRichard Loweinclude ../Makefile.cmd.64
546f9914e7SRichard Loweinclude ../Makefile.ctf
557c478bd9Sstevel@tonic-gate
566f9914e7SRichard LoweCTF_MODE	= link
577c478bd9Sstevel@tonic-gate
586f9914e7SRichard LoweCFLAGS		+= $(CCVERBOSE)
596f9914e7SRichard Lowe
606f9914e7SRichard LoweCERRWARN	+= $(CNOWARN_UNINIT)
616f9914e7SRichard LoweCERRWARN	+= -_gcc=-Wno-switch
626f9914e7SRichard Lowe
636f9914e7SRichard Lowe# not linted
646f9914e7SRichard LoweSMATCH=off
656f9914e7SRichard Lowe
666f9914e7SRichard LoweCSTD=	$(CSTD_GNU99)
676f9914e7SRichard Lowe
686f9914e7SRichard LoweLDLIBS	+= -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
696f9914e7SRichard LoweCPPFLAGS += -D_REENTRANT
706f9914e7SRichard LoweCPPFLAGS += -I$(SRC)/uts/common/fs/zfs
716f9914e7SRichard LoweCPPFLAGS += -I$(SRC)/uts/common
726f9914e7SRichard Lowe
73*7671517eSToomas Soomecodes_bhyve.o := CPPFLAGS += -I$(SRC)/compat/bhyve
74*7671517eSToomas Soomecodes_bhyve.o := CPPFLAGS += -I$(SRC)/compat/bhyve/amd64
75*7671517eSToomas Soomecodes_bhyve.o := CPPFLAGS += -I$(SRC)/uts/intel
76*7671517eSToomas Soome
776f9914e7SRichard LoweROOTLINK = $(PROG:%=$(ROOTBIN64)/%)
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate.KEEP_STATE:
807c478bd9Sstevel@tonic-gate
816f9914e7SRichard Lowe%.o:	%.c
826f9914e7SRichard Lowe	$(COMPILE.c) $<
836f9914e7SRichard Lowe	$(POST_PROCESS_O)
847c478bd9Sstevel@tonic-gate
856f9914e7SRichard Loweall: $(PROG)
867c478bd9Sstevel@tonic-gate
876f9914e7SRichard Loweinstall: all $(ROOTPROG) $(ROOTLINK)
887c478bd9Sstevel@tonic-gate
896f9914e7SRichard Lowe$(ROOTLINK):
906f9914e7SRichard Lowe	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
917c478bd9Sstevel@tonic-gate
926f9914e7SRichard Lowe$(PROG): $(OBJS)
936f9914e7SRichard Lowe	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
946f9914e7SRichard Lowe	$(POST_PROCESS)
956f9914e7SRichard Lowe
966f9914e7SRichard Loweclean:
976f9914e7SRichard Lowe	$(RM) $(OBJS)
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
100