xref: /illumos-gate/usr/src/cmd/truss/Makefile (revision 7671517e13b8123748eda4ef1ee165c6d9dba7fe)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
27# Copyright (c) 2016 by Delphix. All rights reserved.
28# Copyright 2019 Joyent, Inc.
29# Copyright 2023 Oxide Computer Co.
30#
31
32PROG=	truss
33
34OBJS=			\
35	main.o		\
36	listopts.o	\
37	ipc.o		\
38	actions.o	\
39	expound.o	\
40	codes.o		\
41	codes_bhyve.o	\
42	print.o		\
43	ramdata.o	\
44	systable.o	\
45	procset.o	\
46	stat.o		\
47	fcall.o		\
48	htbl.o
49
50.PARALLEL: $(OBJS)
51
52include ../Makefile.cmd
53include ../Makefile.cmd.64
54include ../Makefile.ctf
55
56CTF_MODE	= link
57
58CFLAGS		+= $(CCVERBOSE)
59
60CERRWARN	+= $(CNOWARN_UNINIT)
61CERRWARN	+= -_gcc=-Wno-switch
62
63# not linted
64SMATCH=off
65
66CSTD=	$(CSTD_GNU99)
67
68LDLIBS	+= -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
69CPPFLAGS += -D_REENTRANT
70CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
71CPPFLAGS += -I$(SRC)/uts/common
72
73codes_bhyve.o := CPPFLAGS += -I$(SRC)/compat/bhyve
74codes_bhyve.o := CPPFLAGS += -I$(SRC)/compat/bhyve/amd64
75codes_bhyve.o := CPPFLAGS += -I$(SRC)/uts/intel
76
77ROOTLINK = $(PROG:%=$(ROOTBIN64)/%)
78
79.KEEP_STATE:
80
81%.o:	%.c
82	$(COMPILE.c) $<
83	$(POST_PROCESS_O)
84
85all: $(PROG)
86
87install: all $(ROOTPROG) $(ROOTLINK)
88
89$(ROOTLINK):
90	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
91
92$(PROG): $(OBJS)
93	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
94	$(POST_PROCESS)
95
96clean:
97	$(RM) $(OBJS)
98
99include ../Makefile.targ
100