xref: /titanic_41/usr/src/cmd/dtrace/test/tst/Makefile.com (revision 6185db853e024a486ff8837e6784dd290d866112)
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 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27
28include $(SRC)/Makefile.master
29
30.KEEP_STATE:
31
32ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
33ROOTTST = $(ROOTOPTPKG)/tst
34SUBDIR :sh= basename `pwd`
35TSTDIR = $(ROOTTST)/$(SUBDIR)
36DSTYLE = $(ROOTOPTPKG)/bin/dstyle
37
38CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
39SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
40DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
41
42TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
43	-name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
44	-o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d
45
46EXES :sh= find . -name SCCS -prune -o -name *.exe -print | cut -b3-
47EXES += $(CSRCS:%.c=%.exe)
48EXES += $(SSRCS:%.s=%.exe)
49
50ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
51ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
52
53$(ROOT_TSTS) := FILEMODE = 0444
54$(ROOT_EXES) := FILEMODE = 0555
55
56all: $(EXES)
57
58clean lint:
59
60clobber: FRC
61	rm -f $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
62	rm -f $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
63	rm -f $(DSRC:%.d=%.o)
64
65install: $(ROOT_TSTS) $(ROOT_EXES)
66
67$(ROOT_TSTS): $(TSTDIR)
68
69$(ROOT_EXES): $(TSTDIR)
70
71$(TSTDIR):
72	$(INS.dir)
73
74$(TSTDIR)/%: %
75	$(INS) -s -d -m $(DIRMODE) $(@D)
76	$(INS.file)
77
78%.exe: %.c
79	$(LINK.c) -o $@ $< $(LIBS)
80
81%.exe: %.o
82	$(CC) -o $@ $< $(LIBS)
83
84%.o: %.c
85	$(COMPILE.c) -o $@ $< $(LIBS)
86
87%.o: %.s
88	$(AS) $(ASFLAGS) -o $@ $< $(LIBS)
89
90scripts: FRC
91	@cd ../cmd/scripts; pwd; $(MAKE) install
92
93dstyle: FRC
94	@$(DSTYLE) $(DSRCS)
95
96FRC:
97