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.
26 # Copyright (c) 2018, Joyent, Inc.
28 include $(SRC)/cmd/Makefile.cmd
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.
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
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)
82 $(INS) -d -m $(DIRMODE) $(@D)
86 $(LINK.c) -o $@ $< $(LDLIBS)
87 $(POST_PROCESS) ; $(STRIP_STABS)
90 $(LINK.c) -o $@ $< $(LDLIBS)
91 $(POST_PROCESS) ; $(STRIP_STABS)
102 @cd ../cmd/scripts; pwd; $(MAKE) install
105 @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi