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]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 include $(SRC)/cmd/Makefile.cmd
31 ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
32 ROOTTST = $(ROOTOPTPKG)/tst
33 SUBDIR :sh= basename `pwd`
34 TSTDIR = $(ROOTTST)/$(SUBDIR)
35 DSTYLE = $(ROOTOPTPKG)/bin/dstyle
37 CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
38 SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
39 DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
41 TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
42 -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
43 -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \
46 EXES :sh= find . -name SCCS -prune -o \( -name *.exe -o -name \*.pl \) -print \
48 EXES += $(CSRCS:%.c=%.exe)
49 EXES += $(SSRCS:%.s=%.exe)
51 ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
52 ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
54 $(ROOT_TSTS) := FILEMODE = 0444
55 $(ROOT_EXES) := FILEMODE = 0555
57 # The DTrace tests rely on "normal" behaviour from the compiler which
58 # agressive optimization of small, simple, one compilation-unit programs may
59 # utterly subvert. We force the compiler to not optimize rather than engage
60 # in an arms race with increasingly belligerent optimizers.
63 CERRWARN += -Wno-switch
64 CERRWARN += -Wno-unused-variable
65 CERRWARN += -Wno-implicit-function-declaration
66 CERRWARN += -Wno-unused-function
67 CERRWARN += -Wno-unused-variable
74 -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
75 -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
76 -$(RM) $(DSRCS:%.d=%.o)
77 -$(RM) $(CLOBBERFILES)
79 install: $(ROOT_TSTS) $(ROOT_EXES)
81 $(ROOT_TSTS): $(TSTDIR)
83 $(ROOT_EXES): $(TSTDIR)
89 $(INS) -d -m $(DIRMODE) $(@D)
93 $(LINK.c) -o $@ $< $(LDLIBS)
94 $(POST_PROCESS) ; $(STRIP_STABS)
97 $(LINK.c) -o $@ $< $(LDLIBS)
98 $(POST_PROCESS) ; $(STRIP_STABS)
101 $(COMPILE.c) -o $@ $<
105 $(COMPILE.s) -o $@ $<
109 @cd ../cmd/scripts; pwd; $(MAKE) install
112 @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi