dtrace: explicitly enumerate all test files
[unleashed.git] / usr / src / cmd / dtrace / test / tst / Makefile.com
blob62c89b816da6bdb9f9ca0f234ea1871d9e46863e
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24 # Use is subject to license terms.
27 include $(SRC)/cmd/Makefile.cmd
29 .KEEP_STATE:
31 ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
32 ROOTTST = $(ROOTOPTPKG)/tst
33 SUBDIR :sh= basename `pwd`
34 TSTDIR = $(ROOTTST)/$(SUBDIR)
35 DSTYLE = $(ROOTOPTPKG)/bin/dstyle
37 EXES += $(CSRCS:%.c=%.exe)
38 EXES += $(SSRCS:%.s=%.exe)
40 ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
41 ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
43 $(ROOT_TSTS) := FILEMODE = 0444
44 $(ROOT_EXES) := FILEMODE = 0555
46 # The DTrace tests rely on "normal" behaviour from the compiler which
47 # agressive optimization of small, simple, one compilation-unit programs may
48 # utterly subvert.  We force the compiler to not optimize rather than engage
49 # in an arms race with increasingly belligerent optimizers.
50 COPTFLAG=       -O0
52 CERRWARN +=     -Wno-switch
53 CERRWARN +=     -Wno-unused-variable
54 CERRWARN +=     -Wno-implicit-function-declaration
55 CERRWARN +=     -Wno-unused-function
56 CERRWARN +=     -Wno-unused-variable
58 all: $(EXES)
60 clean:
62 clobber: FRC
63         -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
64         -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
65         -$(RM) $(DSRCS:%.d=%.o)
66         -$(RM) $(CLOBBERFILES)
68 install: $(ROOT_TSTS) $(ROOT_EXES)
70 $(ROOT_TSTS): $(TSTDIR)
72 $(ROOT_EXES): $(TSTDIR)
74 $(TSTDIR):
75         $(INS.dir)
77 $(TSTDIR)/%: %
78         $(INS) -d -m $(DIRMODE) $(@D)
79         $(INS.file)
81 %.exe: %.c
82         $(LINK.c) -o $@ $< $(LDLIBS)
83         $(POST_PROCESS) ; $(STRIP_STABS)
85 %.exe: %.o
86         $(LINK.c) -o $@ $< $(LDLIBS)
87         $(POST_PROCESS) ; $(STRIP_STABS)
89 %.o: %.c
90         $(COMPILE.c) -o $@ $<
91         $(POST_PROCESS_O)
93 %.o: %.s
94         $(COMPILE.s) -o $@ $<
95         $(POST_PROCESS_O)
97 scripts: FRC
98         @cd ../cmd/scripts; pwd; $(MAKE) install
100 dstyle: FRC
101         @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi
103 FRC: