Merge illumos-gate
[unleashed.git] / usr / src / cmd / dtrace / test / tst / Makefile.com
blobee2f3aa2220375199dda11968168cbf33b8df789
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.
26 # Copyright (c) 2018, Joyent, Inc.
28 include $(SRC)/cmd/Makefile.cmd
30 .KEEP_STATE:
32 ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
33 ROOTTST = $(ROOTOPTPKG)/tst
34 SUBDIR :sh= basename `pwd`
35 TSTDIR = $(ROOTTST)/$(SUBDIR)
36 DSTYLE = $(ROOTOPTPKG)/bin/dstyle
38 EXES += $(CSRCS:%.c=%.exe)
39 EXES += $(SSRCS:%.s=%.exe)
41 ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
42 ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
44 $(ROOT_TSTS) := FILEMODE = 0444
45 $(ROOT_EXES) := FILEMODE = 0555
47 # The DTrace tests rely on "normal" behaviour from the compiler which
48 # agressive optimization of small, simple, one compilation-unit programs may
49 # utterly subvert.  We force the compiler to not optimize rather than engage
50 # in an arms race with increasingly belligerent optimizers.
51 COPTFLAG=       -O0
53 CERRWARN +=     -Wno-switch
54 CERRWARN +=     -Wno-unused-variable
55 CERRWARN +=     -Wno-implicit-function-declaration
56 CERRWARN +=     -Wno-unused-function
57 CERRWARN +=     -Wno-unused-variable
59 # not linted
60 SMATCH=off
62 all: $(EXES)
64 clean:
66 clobber: FRC
67         -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
68         -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
69         -$(RM) $(DSRCS:%.d=%.o)
70         -$(RM) $(CLOBBERFILES)
72 install: $(ROOT_TSTS) $(ROOT_EXES)
74 $(ROOT_TSTS): $(TSTDIR)
76 $(ROOT_EXES): $(TSTDIR)
78 $(TSTDIR):
79         $(INS.dir)
81 $(TSTDIR)/%: %
82         $(INS) -d -m $(DIRMODE) $(@D)
83         $(INS.file)
85 %.exe: %.c
86         $(LINK.c) -o $@ $< $(LDLIBS)
87         $(POST_PROCESS) ; $(STRIP_STABS)
89 %.exe: %.o
90         $(LINK.c) -o $@ $< $(LDLIBS)
91         $(POST_PROCESS) ; $(STRIP_STABS)
93 %.o: %.c
94         $(COMPILE.c) -o $@ $<
95         $(POST_PROCESS_O)
97 %.o: %.s
98         $(COMPILE.s) -o $@ $<
99         $(POST_PROCESS_O)
101 scripts: FRC
102         @cd ../cmd/scripts; pwd; $(MAKE) install
104 dstyle: FRC
105         @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi
107 FRC: