xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/Makefile (revision 6eeafb34dceabceff80ed689002b6dc3e060f498)
19512fe85Sahl#
29512fe85Sahl# CDDL HEADER START
39512fe85Sahl#
49512fe85Sahl# The contents of this file are subject to the terms of the
59512fe85Sahl# Common Development and Distribution License (the "License").
69512fe85Sahl# You may not use this file except in compliance with the License.
79512fe85Sahl#
89512fe85Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99512fe85Sahl# or http://www.opensolaris.org/os/licensing.
109512fe85Sahl# See the License for the specific language governing permissions
119512fe85Sahl# and limitations under the License.
129512fe85Sahl#
139512fe85Sahl# When distributing Covered Code, include this CDDL HEADER in each
149512fe85Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159512fe85Sahl# If applicable, add the following below this CDDL HEADER, with the
169512fe85Sahl# fields enclosed by brackets "[]" replaced with your own identifying
179512fe85Sahl# information: Portions Copyright [yyyy] [name of copyright owner]
189512fe85Sahl#
199512fe85Sahl# CDDL HEADER END
209512fe85Sahl#
219512fe85Sahl
229512fe85Sahl#
23e1adf50cSahl# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
249512fe85Sahl# Use is subject to license terms.
259512fe85Sahl#
26edb34883SAdam H. Leventhal
27edb34883SAdam H. Leventhal#
28edb34883SAdam H. Leventhal# Copyright (c) 2012 by Delphix. All rights reserved.
29d50bcaaeSAndrew Stormont# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
30ab618543SJohn Levon# Copyright 2018 Joyent, Inc.
31*6eeafb34SRobert Mustacchi# Copyright 2022 Oxide Computer Company
32a386cc11SRobert Mustacchi#
33a386cc11SRobert Mustacchi
34a386cc11SRobert Mustacchi#
35a386cc11SRobert Mustacchi# WARNING: Do not include Makefile.ctf here. That will cause tests to
36a386cc11SRobert Mustacchi# break.
3773427c57Sahl#
389512fe85Sahl
3923b5c241Stomeeinclude $(SRC)/Makefile.master
409512fe85Sahlinclude ../Makefile.com
419512fe85Sahl
42f3b585ceSsamfSNOOPDIR = $(SRC)/cmd/cmd-inet/usr.sbin/snoop
43f3b585ceSsamfSNOOPOBJS = nfs4_xdr.o
44f3b585ceSsamfSNOOPSRCS = ${SNOOPOBJS:%.o=%.c}
45f3b585ceSsamfCLOBBERFILES += nfs/$(SNOOPOBJS)
46f3b585ceSsamf
47e1adf50cSahlRPCSVCDIR = $(SRC)/head/rpcsvc
48e1adf50cSahlRPCSVCOBJS = nfs_prot.o
49e1adf50cSahlRPCSVCSRCS = ${RPCSVCOBJS:%o=%c}
50e1adf50cSahlCLOBBERFILES += nfs/$(RPCSVCOBJS) $(RPCSVCDIR)/$(RPCSVCSRCS)
51b6805bf7SGordon RossCLOBBERFILES += usdt/forker.h usdt/lazyprobe.h
52e1adf50cSahl
5373427c57Sahlfasttrap/tst.fasttrap.exe := LDLIBS += -ldtrace
5473427c57Sahlfasttrap/tst.stack.exe := LDLIBS += -ldtrace
559512fe85Sahl
5673427c57Sahlsysevent/tst.post.exe := LDLIBS += -lsysevent
5773427c57Sahlsysevent/tst.post_chan.exe := LDLIBS += -lsysevent
58e04145d0Seschrock
59b8fac8e1Sjhaslamustack/tst.bigstack.exe := COPTFLAG += -xO1
60b8fac8e1Sjhaslam
61ab618543SJohn LevonCSTD = $(CSTD_GNU99)
62ab618543SJohn Levon
63f3b585ceSsamfnfs/%.o: $(SNOOPDIR)/%.c
64f3b585ceSsamf	$(COMPILE.c) -o $@ $< -I$(SNOOPDIR)
65f3b585ceSsamf	$(POST_PROCESS_O)
66f3b585ceSsamfnfs/tst.call.exe: nfs/tst.call.o nfs/$(SNOOPOBJS)
67f3b585ceSsamf	$(LINK.c) -o $@ nfs/tst.call.o nfs/$(SNOOPOBJS) $(LDLIBS) -lnsl
68f3b585ceSsamf	$(POST_PROCESS) ; $(STRIP_STABS)
69e1adf50cSahl$(RPCSVCDIR)/%.c: $(RPCSVCDIR)/%.x
70e1adf50cSahl	$(RPCGEN) -Cc $< > $@
71e1adf50cSahlnfs/$(RPCSVCOBJS): $(RPCSVCDIR)/$(RPCSVCSRCS)
72e1adf50cSahl	$(COMPILE.c) -o $@ $(RPCSVCDIR)/$(RPCSVCSRCS)
73e1adf50cSahl	$(POST_PROCESS_O)
74e1adf50cSahlnfs/tst.call3.exe: nfs/tst.call3.o nfs/$(RPCSVCOBJS)
75e1adf50cSahl	$(LINK.c) -o $@ nfs/tst.call3.o nfs/$(RPCSVCOBJS) \
76e1adf50cSahl	$(LDLIBS) -lnsl -lrpcsvc
77e1adf50cSahl	$(POST_PROCESS) ; $(STRIP_STABS)
78f3b585ceSsamf
79f497f9feSJoshua M. Clulowjson/tst.usdt.o: json/usdt.h
80f497f9feSJoshua M. Clulow
81f497f9feSJoshua M. Clulowjson/usdt.h: json/usdt.d
82f497f9feSJoshua M. Clulow	$(DTRACE) -h -s json/usdt.d -o json/usdt.h
83f497f9feSJoshua M. Clulow
84b52c8fbeSRichard PALOCLOBBERFILES +=	json/usdt.h
85b52c8fbeSRichard PALO
86f497f9feSJoshua M. Clulowjson/usdt.o: json/usdt.d json/tst.usdt.o
87f497f9feSJoshua M. Clulow	$(COMPILE.d) -o json/usdt.o -s json/usdt.d json/tst.usdt.o
88f497f9feSJoshua M. Clulow
89f497f9feSJoshua M. Clulowjson/tst.usdt.exe: json/tst.usdt.o json/usdt.o
90f497f9feSJoshua M. Clulow	$(LINK.c) -o json/tst.usdt.exe json/tst.usdt.o json/usdt.o $(LDLIBS)
91f497f9feSJoshua M. Clulow	$(POST_PROCESS) ; $(STRIP_STABS)
92f497f9feSJoshua M. Clulow
93a386cc11SRobert Mustacchi#
94*6eeafb34SRobert Mustacchi# Tests that use the next four programs rely on the binaries having
95a386cc11SRobert Mustacchi# valid CTF data.
96a386cc11SRobert Mustacchi#
97*6eeafb34SRobert Mustacchibitfields/tst.bitfields.exe: bitfields/tst.bitfields.c
98*6eeafb34SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o bitfields/tst.bitfields.o bitfields/tst.bitfields.c
99*6eeafb34SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION bitfields/tst.bitfields.o
100*6eeafb34SRobert Mustacchi	$(LINK.c) -o bitfields/tst.bitfields.exe bitfields/tst.bitfields.o $(LDLIBS)
101*6eeafb34SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ bitfields/tst.bitfields.o
102*6eeafb34SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
103*6eeafb34SRobert Mustacchi
104a386cc11SRobert Mustacchiuctf/tst.aouttype.exe: uctf/tst.aouttype.c
105a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.aouttype.o uctf/tst.aouttype.c
106a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.aouttype.o
107a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.aouttype.exe uctf/tst.aouttype.o $(LDLIBS)
108a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.aouttype.o
109a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
110a386cc11SRobert Mustacchi
111a386cc11SRobert Mustacchiuctf/tst.chasestrings.exe: uctf/tst.chasestrings.c
112a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.chasestrings.o uctf/tst.chasestrings.c
113a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.chasestrings.o
114a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.chasestrings.exe uctf/tst.chasestrings.o $(LDLIBS)
115a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.chasestrings.o
116a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
117a386cc11SRobert Mustacchi
118a386cc11SRobert Mustacchiuctf/tst.printtype.exe: uctf/tst.printtype.c
119a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.printtype.o uctf/tst.printtype.c
120a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.printtype.o
121a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.printtype.exe uctf/tst.printtype.o $(LDLIBS)
122a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.printtype.o
123a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
124a386cc11SRobert Mustacchi
125a386cc11SRobert Mustacchi#
126a386cc11SRobert Mustacchi# This program should never have any ctf data in it.
127a386cc11SRobert Mustacchi#
128a386cc11SRobert Mustacchiuctf/tst.libtype.exe:
129a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.libtype.exe uctf/tst.libtype.c $(LDLIBS)
130a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
131a386cc11SRobert Mustacchi
1329512fe85Sahlusdt/tst.args.exe: usdt/tst.args.o usdt/args.o
13373427c57Sahl	$(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS)
13473427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
1359512fe85Sahl
1369512fe85Sahlusdt/args.o: usdt/args.d usdt/tst.args.o
13773427c57Sahl	$(COMPILE.d) -o usdt/args.o -s usdt/args.d usdt/tst.args.o
1389512fe85Sahl
1399512fe85Sahlusdt/tst.argmap.exe: usdt/tst.argmap.o usdt/argmap.o
140edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.argmap.exe \
141edb34883SAdam H. Leventhal	    usdt/tst.argmap.o usdt/argmap.o $(LDLIBS)
14273427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
1439512fe85Sahl
1449512fe85Sahlusdt/argmap.o: usdt/argmap.d usdt/tst.argmap.o
14573427c57Sahl	$(COMPILE.d) -o usdt/argmap.o -s usdt/argmap.d usdt/tst.argmap.o
14623b5c241Stomee
147dcafa303Sahlusdt/tst.forker.exe: usdt/tst.forker.o usdt/forker.o
148edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.forker.exe \
149edb34883SAdam H. Leventhal	    usdt/tst.forker.o usdt/forker.o $(LDLIBS)
150dcafa303Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
151dcafa303Sahl
152dcafa303Sahlusdt/forker.o: usdt/forker.d usdt/tst.forker.o
153dcafa303Sahl	$(COMPILE.d) -o usdt/forker.o -s usdt/forker.d usdt/tst.forker.o
154dcafa303Sahl
155dcafa303Sahlusdt/tst.forker.o: usdt/forker.h
156dcafa303Sahl
157dcafa303Sahlusdt/forker.h: usdt/forker.d
158dcafa303Sahl	$(DTRACE) -h -s usdt/forker.d -o usdt/forker.h
159dcafa303Sahl
160edb34883SAdam H. Leventhalusdt/tst.lazyprobe.exe: usdt/tst.lazyprobe.o usdt/lazyprobe.o
161edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.lazyprobe.exe \
162edb34883SAdam H. Leventhal	    usdt/tst.lazyprobe.o usdt/lazyprobe.o $(LDLIBS)
163edb34883SAdam H. Leventhal	$(POST_PROCESS) ; $(STRIP_STABS)
164edb34883SAdam H. Leventhal
165edb34883SAdam H. Leventhalusdt/lazyprobe.o: usdt/lazyprobe.d usdt/tst.lazyprobe.o
166edb34883SAdam H. Leventhal	$(COMPILE.d) -xlazyload -o usdt/lazyprobe.o \
167edb34883SAdam H. Leventhal	    -s usdt/lazyprobe.d usdt/tst.lazyprobe.o
168edb34883SAdam H. Leventhal
169edb34883SAdam H. Leventhalusdt/tst.lazyprobe.o: usdt/lazyprobe.h
170edb34883SAdam H. Leventhal
171edb34883SAdam H. Leventhalusdt/lazyprobe.h: usdt/lazyprobe.d
172edb34883SAdam H. Leventhal	$(DTRACE) -h -s usdt/lazyprobe.d -o usdt/lazyprobe.h
173edb34883SAdam H. Leventhal
17423b5c241StomeeSUBDIRS = java_api
17523b5c241Stomeeinclude ../../Makefile.subdirs
176