xref: /illumos-gate/usr/src/cmd/truss/Makefile (revision e00bdde3c6d406f40f53f3025defadc22f7ec31a)
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	print.o		\
42	ramdata.o	\
43	systable.o	\
44	procset.o	\
45	stat.o		\
46	fcall.o		\
47	htbl.o
48
49.PARALLEL: $(OBJS)
50
51include ../Makefile.cmd
52include ../Makefile.cmd.64
53include ../Makefile.ctf
54
55CTF_MODE	= link
56
57CFLAGS		+= $(CCVERBOSE)
58
59CERRWARN	+= $(CNOWARN_UNINIT)
60CERRWARN	+= -_gcc=-Wno-switch
61
62# not linted
63SMATCH=off
64
65CSTD=	$(CSTD_GNU99)
66
67LDLIBS	+= -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
68CPPFLAGS += -D_REENTRANT
69CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
70CPPFLAGS += -I$(SRC)/uts/common
71
72ROOTLINK = $(PROG:%=$(ROOTBIN64)/%)
73
74.KEEP_STATE:
75
76%.o:	%.c
77	$(COMPILE.c) $<
78	$(POST_PROCESS_O)
79
80all: $(PROG)
81
82install: all $(ROOTPROG) $(ROOTLINK)
83
84$(ROOTLINK):
85	$(RM) $@; $(SYMLINK) ../../bin/$(@F) $@
86
87$(PROG): $(OBJS)
88	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
89	$(POST_PROCESS)
90
91clean:
92	$(RM) $(OBJS)
93
94include ../Makefile.targ
95