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