xref: /titanic_44/usr/src/cmd/dtrace/test/tst/common/Makefile (revision b52c8fbe58cfd9f349fdfa6cc5cb6f5731946a2b)
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.
29a386cc11SRobert Mustacchi# Copyright (c) 2013, Joyent, Inc. All rights reserved.
30a386cc11SRobert Mustacchi#
31a386cc11SRobert Mustacchi
32a386cc11SRobert Mustacchi#
33a386cc11SRobert Mustacchi# WARNING: Do not include Makefile.ctf here. That will cause tests to
34a386cc11SRobert Mustacchi# break.
3573427c57Sahl#
369512fe85Sahl
3723b5c241Stomeeinclude $(SRC)/Makefile.master
389512fe85Sahlinclude ../Makefile.com
399512fe85Sahl
40f3b585ceSsamfSNOOPDIR = $(SRC)/cmd/cmd-inet/usr.sbin/snoop
41f3b585ceSsamfSNOOPOBJS = nfs4_xdr.o
42f3b585ceSsamfSNOOPSRCS = ${SNOOPOBJS:%.o=%.c}
43f3b585ceSsamfCLOBBERFILES += nfs/$(SNOOPOBJS)
44f3b585ceSsamf
45e1adf50cSahlRPCSVCDIR = $(SRC)/head/rpcsvc
46e1adf50cSahlRPCSVCOBJS = nfs_prot.o
47e1adf50cSahlRPCSVCSRCS = ${RPCSVCOBJS:%o=%c}
48e1adf50cSahlCLOBBERFILES += nfs/$(RPCSVCOBJS) $(RPCSVCDIR)/$(RPCSVCSRCS)
49b6805bf7SGordon RossCLOBBERFILES += usdt/forker.h usdt/lazyprobe.h
50e1adf50cSahl
5173427c57Sahlfasttrap/tst.fasttrap.exe := LDLIBS += -ldtrace
5273427c57Sahlfasttrap/tst.stack.exe := LDLIBS += -ldtrace
539512fe85Sahl
5473427c57Sahlsysevent/tst.post.exe := LDLIBS += -lsysevent
5573427c57Sahlsysevent/tst.post_chan.exe := LDLIBS += -lsysevent
56e04145d0Seschrock
57b8fac8e1Sjhaslamustack/tst.bigstack.exe := COPTFLAG += -xO1
58b8fac8e1Sjhaslam
5973427c57SahlGCC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
609512fe85Sahl
61f3b585ceSsamfnfs/%.o: $(SNOOPDIR)/%.c
62f3b585ceSsamf	$(COMPILE.c) -o $@ $< -I$(SNOOPDIR)
63f3b585ceSsamf	$(POST_PROCESS_O)
64f3b585ceSsamfnfs/tst.call.exe: nfs/tst.call.o nfs/$(SNOOPOBJS)
65f3b585ceSsamf	$(LINK.c) -o $@ nfs/tst.call.o nfs/$(SNOOPOBJS) $(LDLIBS) -lnsl
66f3b585ceSsamf	$(POST_PROCESS) ; $(STRIP_STABS)
67e1adf50cSahl$(RPCSVCDIR)/%.c: $(RPCSVCDIR)/%.x
68e1adf50cSahl	$(RPCGEN) -Cc $< > $@
69e1adf50cSahlnfs/$(RPCSVCOBJS): $(RPCSVCDIR)/$(RPCSVCSRCS)
70e1adf50cSahl	$(COMPILE.c) -o $@ $(RPCSVCDIR)/$(RPCSVCSRCS)
71e1adf50cSahl	$(POST_PROCESS_O)
72e1adf50cSahlnfs/tst.call3.exe: nfs/tst.call3.o nfs/$(RPCSVCOBJS)
73e1adf50cSahl	$(LINK.c) -o $@ nfs/tst.call3.o nfs/$(RPCSVCOBJS) \
74e1adf50cSahl	$(LDLIBS) -lnsl -lrpcsvc
75e1adf50cSahl	$(POST_PROCESS) ; $(STRIP_STABS)
76f3b585ceSsamf
779512fe85Sahlpid/tst.gcc.exe: pid/tst.gcc.c
7873427c57Sahl	$(GCC) -o pid/tst.gcc.exe pid/tst.gcc.c $(LDFLAGS)
7973427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
809512fe85Sahl
81f497f9feSJoshua M. Clulowjson/tst.usdt.o: json/usdt.h
82f497f9feSJoshua M. Clulow
83f497f9feSJoshua M. Clulowjson/usdt.h: json/usdt.d
84f497f9feSJoshua M. Clulow	$(DTRACE) -h -s json/usdt.d -o json/usdt.h
85f497f9feSJoshua M. Clulow
86*b52c8fbeSRichard PALOCLOBBERFILES +=	json/usdt.h
87*b52c8fbeSRichard PALO
88f497f9feSJoshua M. Clulowjson/usdt.o: json/usdt.d json/tst.usdt.o
89f497f9feSJoshua M. Clulow	$(COMPILE.d) -o json/usdt.o -s json/usdt.d json/tst.usdt.o
90f497f9feSJoshua M. Clulow
91f497f9feSJoshua M. Clulowjson/tst.usdt.exe: json/tst.usdt.o json/usdt.o
92f497f9feSJoshua M. Clulow	$(LINK.c) -o json/tst.usdt.exe json/tst.usdt.o json/usdt.o $(LDLIBS)
93f497f9feSJoshua M. Clulow	$(POST_PROCESS) ; $(STRIP_STABS)
94f497f9feSJoshua M. Clulow
95a386cc11SRobert Mustacchi#
96a386cc11SRobert Mustacchi# Tests that use the next three programs rely on the binaries having
97a386cc11SRobert Mustacchi# valid CTF data.
98a386cc11SRobert Mustacchi#
99a386cc11SRobert Mustacchiuctf/tst.aouttype.exe: uctf/tst.aouttype.c
100a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.aouttype.o uctf/tst.aouttype.c
101a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.aouttype.o
102a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.aouttype.exe uctf/tst.aouttype.o $(LDLIBS)
103a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.aouttype.o
104a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
105a386cc11SRobert Mustacchi
106a386cc11SRobert Mustacchiuctf/tst.chasestrings.exe: uctf/tst.chasestrings.c
107a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.chasestrings.o uctf/tst.chasestrings.c
108a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.chasestrings.o
109a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.chasestrings.exe uctf/tst.chasestrings.o $(LDLIBS)
110a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.chasestrings.o
111a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
112a386cc11SRobert Mustacchi
113a386cc11SRobert Mustacchiuctf/tst.printtype.exe: uctf/tst.printtype.c
114a386cc11SRobert Mustacchi	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.printtype.o uctf/tst.printtype.c
115a386cc11SRobert Mustacchi	$(CTFCONVERT) -i -L VERSION uctf/tst.printtype.o
116a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.printtype.exe uctf/tst.printtype.o $(LDLIBS)
117a386cc11SRobert Mustacchi	$(CTFMERGE) -L VERSION -o $@ uctf/tst.printtype.o
118a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
119a386cc11SRobert Mustacchi
120a386cc11SRobert Mustacchi#
121a386cc11SRobert Mustacchi# This program should never have any ctf data in it.
122a386cc11SRobert Mustacchi#
123a386cc11SRobert Mustacchiuctf/tst.libtype.exe:
124a386cc11SRobert Mustacchi	$(LINK.c) -o uctf/tst.libtype.exe uctf/tst.libtype.c $(LDLIBS)
125a386cc11SRobert Mustacchi	$(POST_PROCESS) ; $(STRIP_STABS)
126a386cc11SRobert Mustacchi
1279512fe85Sahlusdt/tst.args.exe: usdt/tst.args.o usdt/args.o
12873427c57Sahl	$(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS)
12973427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
1309512fe85Sahl
1319512fe85Sahlusdt/args.o: usdt/args.d usdt/tst.args.o
13273427c57Sahl	$(COMPILE.d) -o usdt/args.o -s usdt/args.d usdt/tst.args.o
1339512fe85Sahl
1349512fe85Sahlusdt/tst.argmap.exe: usdt/tst.argmap.o usdt/argmap.o
135edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.argmap.exe \
136edb34883SAdam H. Leventhal	    usdt/tst.argmap.o usdt/argmap.o $(LDLIBS)
13773427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
1389512fe85Sahl
1399512fe85Sahlusdt/argmap.o: usdt/argmap.d usdt/tst.argmap.o
14073427c57Sahl	$(COMPILE.d) -o usdt/argmap.o -s usdt/argmap.d usdt/tst.argmap.o
14123b5c241Stomee
142dcafa303Sahlusdt/tst.forker.exe: usdt/tst.forker.o usdt/forker.o
143edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.forker.exe \
144edb34883SAdam H. Leventhal	    usdt/tst.forker.o usdt/forker.o $(LDLIBS)
145dcafa303Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
146dcafa303Sahl
147dcafa303Sahlusdt/forker.o: usdt/forker.d usdt/tst.forker.o
148dcafa303Sahl	$(COMPILE.d) -o usdt/forker.o -s usdt/forker.d usdt/tst.forker.o
149dcafa303Sahl
150dcafa303Sahlusdt/tst.forker.o: usdt/forker.h
151dcafa303Sahl
152dcafa303Sahlusdt/forker.h: usdt/forker.d
153dcafa303Sahl	$(DTRACE) -h -s usdt/forker.d -o usdt/forker.h
154dcafa303Sahl
155edb34883SAdam H. Leventhalusdt/tst.lazyprobe.exe: usdt/tst.lazyprobe.o usdt/lazyprobe.o
156edb34883SAdam H. Leventhal	$(LINK.c) -o usdt/tst.lazyprobe.exe \
157edb34883SAdam H. Leventhal	    usdt/tst.lazyprobe.o usdt/lazyprobe.o $(LDLIBS)
158edb34883SAdam H. Leventhal	$(POST_PROCESS) ; $(STRIP_STABS)
159edb34883SAdam H. Leventhal
160edb34883SAdam H. Leventhalusdt/lazyprobe.o: usdt/lazyprobe.d usdt/tst.lazyprobe.o
161edb34883SAdam H. Leventhal	$(COMPILE.d) -xlazyload -o usdt/lazyprobe.o \
162edb34883SAdam H. Leventhal	    -s usdt/lazyprobe.d usdt/tst.lazyprobe.o
163edb34883SAdam H. Leventhal
164edb34883SAdam H. Leventhalusdt/tst.lazyprobe.o: usdt/lazyprobe.h
165edb34883SAdam H. Leventhal
166edb34883SAdam H. Leventhalusdt/lazyprobe.h: usdt/lazyprobe.d
167edb34883SAdam H. Leventhal	$(DTRACE) -h -s usdt/lazyprobe.d -o usdt/lazyprobe.h
168edb34883SAdam H. Leventhal
16923b5c241StomeeSUBDIRS = java_api
17023b5c241Stomeeinclude ../../Makefile.subdirs
171