xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/Makefile (revision 012e6ce759c490003aed29439cc47d3d73a99ad3)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27#
28# Copyright (c) 2012 by Delphix. All rights reserved.
29# Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
30# Copyright 2018 Joyent, Inc.
31# Copyright 2022 Oxide Computer Company
32#
33
34#
35# WARNING: Do not include Makefile.ctf here. That will cause tests to
36# break.
37#
38
39include $(SRC)/Makefile.master
40include ../Makefile.com
41
42SNOOPDIR = $(SRC)/cmd/cmd-inet/usr.sbin/snoop
43SNOOPOBJS = nfs4_xdr.o
44SNOOPSRCS = ${SNOOPOBJS:%.o=%.c}
45CLOBBERFILES += nfs/$(SNOOPOBJS)
46
47RPCSVCDIR = $(SRC)/head/rpcsvc
48RPCSVCOBJS = nfs_prot.o
49RPCSVCSRCS = ${RPCSVCOBJS:%o=%c}
50CLOBBERFILES += nfs/$(RPCSVCOBJS) $(RPCSVCDIR)/$(RPCSVCSRCS)
51CLOBBERFILES += usdt/forker.h usdt/lazyprobe.h
52
53fasttrap/tst.fasttrap.exe := LDLIBS += -ldtrace
54fasttrap/tst.stack.exe := LDLIBS += -ldtrace
55
56sysevent/tst.post.exe := LDLIBS += -lsysevent
57sysevent/tst.post_chan.exe := LDLIBS += -lsysevent
58
59ustack/tst.bigstack.exe := COPTFLAG += -xO1
60
61CSTD = $(CSTD_GNU99)
62
63nfs/%.o: $(SNOOPDIR)/%.c
64	$(COMPILE.c) -o $@ $< -I$(SNOOPDIR)
65	$(POST_PROCESS_O)
66nfs/tst.call.exe: nfs/tst.call.o nfs/$(SNOOPOBJS)
67	$(LINK.c) -o $@ nfs/tst.call.o nfs/$(SNOOPOBJS) $(LDLIBS) -lnsl
68	$(POST_PROCESS) ; $(STRIP_STABS)
69$(RPCSVCDIR)/%.c: $(RPCSVCDIR)/%.x
70	$(RPCGEN) -Cc $< > $@
71nfs/$(RPCSVCOBJS): $(RPCSVCDIR)/$(RPCSVCSRCS)
72	$(COMPILE.c) -o $@ $(RPCSVCDIR)/$(RPCSVCSRCS)
73	$(POST_PROCESS_O)
74nfs/tst.call3.exe: nfs/tst.call3.o nfs/$(RPCSVCOBJS)
75	$(LINK.c) -o $@ nfs/tst.call3.o nfs/$(RPCSVCOBJS) \
76	$(LDLIBS) -lnsl -lrpcsvc
77	$(POST_PROCESS) ; $(STRIP_STABS)
78
79json/tst.usdt.o: json/usdt.h
80
81json/usdt.h: json/usdt.d
82	$(DTRACE) -h -s json/usdt.d -o json/usdt.h
83
84CLOBBERFILES +=	json/usdt.h
85
86json/usdt.o: json/usdt.d json/tst.usdt.o
87	$(COMPILE.d) -o json/usdt.o -s json/usdt.d json/tst.usdt.o
88
89json/tst.usdt.exe: json/tst.usdt.o json/usdt.o
90	$(LINK.c) -o json/tst.usdt.exe json/tst.usdt.o json/usdt.o $(LDLIBS)
91	$(POST_PROCESS) ; $(STRIP_STABS)
92
93#
94# Tests that use the next four programs rely on the binaries having
95# valid CTF data.
96#
97bitfields/tst.bitfields.exe: bitfields/tst.bitfields.c
98	$(COMPILE.c) $(CTF_FLAGS) -o bitfields/tst.bitfields.o bitfields/tst.bitfields.c
99	$(CTFCONVERT) -i -L VERSION bitfields/tst.bitfields.o
100	$(LINK.c) -o bitfields/tst.bitfields.exe bitfields/tst.bitfields.o $(LDLIBS)
101	$(CTFMERGE) -L VERSION -o $@ bitfields/tst.bitfields.o
102	$(POST_PROCESS) ; $(STRIP_STABS)
103
104uctf/tst.aouttype.exe: uctf/tst.aouttype.c
105	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.aouttype.o uctf/tst.aouttype.c
106	$(CTFCONVERT) -i -L VERSION uctf/tst.aouttype.o
107	$(LINK.c) -o uctf/tst.aouttype.exe uctf/tst.aouttype.o $(LDLIBS)
108	$(CTFMERGE) -L VERSION -o $@ uctf/tst.aouttype.o
109	$(POST_PROCESS) ; $(STRIP_STABS)
110
111uctf/tst.chasestrings.exe: uctf/tst.chasestrings.c
112	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.chasestrings.o uctf/tst.chasestrings.c
113	$(CTFCONVERT) -i -L VERSION uctf/tst.chasestrings.o
114	$(LINK.c) -o uctf/tst.chasestrings.exe uctf/tst.chasestrings.o $(LDLIBS)
115	$(CTFMERGE) -L VERSION -o $@ uctf/tst.chasestrings.o
116	$(POST_PROCESS) ; $(STRIP_STABS)
117
118uctf/tst.printtype.exe: uctf/tst.printtype.c
119	$(COMPILE.c) $(CTF_FLAGS) -o uctf/tst.printtype.o uctf/tst.printtype.c
120	$(CTFCONVERT) -i -L VERSION uctf/tst.printtype.o
121	$(LINK.c) -o uctf/tst.printtype.exe uctf/tst.printtype.o $(LDLIBS)
122	$(CTFMERGE) -L VERSION -o $@ uctf/tst.printtype.o
123	$(POST_PROCESS) ; $(STRIP_STABS)
124
125#
126# This program should never have any ctf data in it.
127#
128uctf/tst.libtype.exe:
129	$(LINK.c) -o uctf/tst.libtype.exe uctf/tst.libtype.c $(LDLIBS)
130	$(POST_PROCESS) ; $(STRIP_STABS)
131
132usdt/tst.args.exe: usdt/tst.args.o usdt/args.o
133	$(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS)
134	$(POST_PROCESS) ; $(STRIP_STABS)
135
136usdt/args.o: usdt/args.d usdt/tst.args.o
137	$(COMPILE.d) -o usdt/args.o -s usdt/args.d usdt/tst.args.o
138
139usdt/tst.argmap.exe: usdt/tst.argmap.o usdt/argmap.o
140	$(LINK.c) -o usdt/tst.argmap.exe \
141	    usdt/tst.argmap.o usdt/argmap.o $(LDLIBS)
142	$(POST_PROCESS) ; $(STRIP_STABS)
143
144usdt/argmap.o: usdt/argmap.d usdt/tst.argmap.o
145	$(COMPILE.d) -o usdt/argmap.o -s usdt/argmap.d usdt/tst.argmap.o
146
147usdt/tst.forker.exe: usdt/tst.forker.o usdt/forker.o
148	$(LINK.c) -o usdt/tst.forker.exe \
149	    usdt/tst.forker.o usdt/forker.o $(LDLIBS)
150	$(POST_PROCESS) ; $(STRIP_STABS)
151
152usdt/forker.o: usdt/forker.d usdt/tst.forker.o
153	$(COMPILE.d) -o usdt/forker.o -s usdt/forker.d usdt/tst.forker.o
154
155usdt/tst.forker.o: usdt/forker.h
156
157usdt/forker.h: usdt/forker.d
158	$(DTRACE) -h -s usdt/forker.d -o usdt/forker.h
159
160usdt/tst.lazyprobe.exe: usdt/tst.lazyprobe.o usdt/lazyprobe.o
161	$(LINK.c) -o usdt/tst.lazyprobe.exe \
162	    usdt/tst.lazyprobe.o usdt/lazyprobe.o $(LDLIBS)
163	$(POST_PROCESS) ; $(STRIP_STABS)
164
165usdt/lazyprobe.o: usdt/lazyprobe.d usdt/tst.lazyprobe.o
166	$(COMPILE.d) -xlazyload -o usdt/lazyprobe.o \
167	    -s usdt/lazyprobe.d usdt/tst.lazyprobe.o
168
169usdt/tst.lazyprobe.o: usdt/lazyprobe.h
170
171usdt/lazyprobe.h: usdt/lazyprobe.d
172	$(DTRACE) -h -s usdt/lazyprobe.d -o usdt/lazyprobe.h
173
174SUBDIRS = java_api
175include ../../Makefile.subdirs
176