xref: /illumos-gate/usr/src/cmd/dtrace/test/tst/common/Makefile (revision b6805bf78d2bbbeeaea8909a05623587b42d58b3)
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#
30
31include $(SRC)/Makefile.master
32include ../Makefile.com
33
34SNOOPDIR = $(SRC)/cmd/cmd-inet/usr.sbin/snoop
35SNOOPOBJS = nfs4_xdr.o
36SNOOPSRCS = ${SNOOPOBJS:%.o=%.c}
37CLOBBERFILES += nfs/$(SNOOPOBJS)
38
39RPCSVCDIR = $(SRC)/head/rpcsvc
40RPCSVCOBJS = nfs_prot.o
41RPCSVCSRCS = ${RPCSVCOBJS:%o=%c}
42CLOBBERFILES += nfs/$(RPCSVCOBJS) $(RPCSVCDIR)/$(RPCSVCSRCS)
43CLOBBERFILES += usdt/forker.h usdt/lazyprobe.h
44
45fasttrap/tst.fasttrap.exe := LDLIBS += -ldtrace
46fasttrap/tst.stack.exe := LDLIBS += -ldtrace
47
48sysevent/tst.post.exe := LDLIBS += -lsysevent
49sysevent/tst.post_chan.exe := LDLIBS += -lsysevent
50
51ustack/tst.bigstack.exe := COPTFLAG += -xO1
52
53GCC = $(ONBLD_TOOLS)/bin/$(MACH)/cw -_gcc
54
55nfs/%.o: $(SNOOPDIR)/%.c
56	$(COMPILE.c) -o $@ $< -I$(SNOOPDIR)
57	$(POST_PROCESS_O)
58nfs/tst.call.exe: nfs/tst.call.o nfs/$(SNOOPOBJS)
59	$(LINK.c) -o $@ nfs/tst.call.o nfs/$(SNOOPOBJS) $(LDLIBS) -lnsl
60	$(POST_PROCESS) ; $(STRIP_STABS)
61$(RPCSVCDIR)/%.c: $(RPCSVCDIR)/%.x
62	$(RPCGEN) -Cc $< > $@
63nfs/$(RPCSVCOBJS): $(RPCSVCDIR)/$(RPCSVCSRCS)
64	$(COMPILE.c) -o $@ $(RPCSVCDIR)/$(RPCSVCSRCS)
65	$(POST_PROCESS_O)
66nfs/tst.call3.exe: nfs/tst.call3.o nfs/$(RPCSVCOBJS)
67	$(LINK.c) -o $@ nfs/tst.call3.o nfs/$(RPCSVCOBJS) \
68	$(LDLIBS) -lnsl -lrpcsvc
69	$(POST_PROCESS) ; $(STRIP_STABS)
70
71pid/tst.gcc.exe: pid/tst.gcc.c
72	$(GCC) -o pid/tst.gcc.exe pid/tst.gcc.c $(LDFLAGS)
73	$(POST_PROCESS) ; $(STRIP_STABS)
74
75usdt/tst.args.exe: usdt/tst.args.o usdt/args.o
76	$(LINK.c) -o usdt/tst.args.exe usdt/tst.args.o usdt/args.o $(LDLIBS)
77	$(POST_PROCESS) ; $(STRIP_STABS)
78
79usdt/args.o: usdt/args.d usdt/tst.args.o
80	$(COMPILE.d) -o usdt/args.o -s usdt/args.d usdt/tst.args.o
81
82usdt/tst.argmap.exe: usdt/tst.argmap.o usdt/argmap.o
83	$(LINK.c) -o usdt/tst.argmap.exe \
84	    usdt/tst.argmap.o usdt/argmap.o $(LDLIBS)
85	$(POST_PROCESS) ; $(STRIP_STABS)
86
87usdt/argmap.o: usdt/argmap.d usdt/tst.argmap.o
88	$(COMPILE.d) -o usdt/argmap.o -s usdt/argmap.d usdt/tst.argmap.o
89
90usdt/tst.forker.exe: usdt/tst.forker.o usdt/forker.o
91	$(LINK.c) -o usdt/tst.forker.exe \
92	    usdt/tst.forker.o usdt/forker.o $(LDLIBS)
93	$(POST_PROCESS) ; $(STRIP_STABS)
94
95usdt/forker.o: usdt/forker.d usdt/tst.forker.o
96	$(COMPILE.d) -o usdt/forker.o -s usdt/forker.d usdt/tst.forker.o
97
98usdt/tst.forker.o: usdt/forker.h
99
100usdt/forker.h: usdt/forker.d
101	$(DTRACE) -h -s usdt/forker.d -o usdt/forker.h
102
103usdt/tst.lazyprobe.exe: usdt/tst.lazyprobe.o usdt/lazyprobe.o
104	$(LINK.c) -o usdt/tst.lazyprobe.exe \
105	    usdt/tst.lazyprobe.o usdt/lazyprobe.o $(LDLIBS)
106	$(POST_PROCESS) ; $(STRIP_STABS)
107
108usdt/lazyprobe.o: usdt/lazyprobe.d usdt/tst.lazyprobe.o
109	$(COMPILE.d) -xlazyload -o usdt/lazyprobe.o \
110	    -s usdt/lazyprobe.d usdt/tst.lazyprobe.o
111
112usdt/tst.lazyprobe.o: usdt/lazyprobe.h
113
114usdt/lazyprobe.h: usdt/lazyprobe.d
115	$(DTRACE) -h -s usdt/lazyprobe.d -o usdt/lazyprobe.h
116
117SUBDIRS = java_api
118include ../../Makefile.subdirs
119