9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER START
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# The contents of this file are subject to the terms of the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Common Development and Distribution License (the "License").
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You may not use this file except in compliance with the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# or http://www.opensolaris.org/os/licensing.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# See the License for the specific language governing permissions
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# and limitations under the License.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# When distributing Covered Code, include this CDDL HEADER in each
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# If applicable, add the following below this CDDL HEADER, with the
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# fields enclosed by brackets "[]" replaced with your own identifying
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# information: Portions Copyright [yyyy] [name of copyright owner]
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# CDDL HEADER END
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
c7158ae983f5a04c4a998f468ecefba6d23ba721tariq# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl# Use is subject to license terms.
9512fe850e98fdd448c638ca63fdd92a8a510255ahl#
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
73427c57f824c3ec3b396181b163f37d50c5b3b1ahlinclude $(SRC)/cmd/Makefile.cmd
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl.KEEP_STATE:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
9512fe850e98fdd448c638ca63fdd92a8a510255ahlROOTTST = $(ROOTOPTPKG)/tst
9512fe850e98fdd448c638ca63fdd92a8a510255ahlSUBDIR :sh= basename `pwd`
9512fe850e98fdd448c638ca63fdd92a8a510255ahlTSTDIR = $(ROOTTST)/$(SUBDIR)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlDSTYLE = $(ROOTOPTPKG)/bin/dstyle
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlCSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
9512fe850e98fdd448c638ca63fdd92a8a510255ahlSSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
9512fe850e98fdd448c638ca63fdd92a8a510255ahlDSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlTSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
9512fe850e98fdd448c638ca63fdd92a8a510255ahl -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
10e6dadfe63181edabc58c8f42e3c56a1cd9ec95brendan -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \
10e6dadfe63181edabc58c8f42e3c56a1cd9ec95brendan -o -name get.*.pl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
10e6dadfe63181edabc58c8f42e3c56a1cd9ec95brendanEXES :sh= find . -name SCCS -prune -o \( -name *.exe -o -name \*.pl \) -print \
10e6dadfe63181edabc58c8f42e3c56a1cd9ec95brendan | cut -b3-
9512fe850e98fdd448c638ca63fdd92a8a510255ahlEXES += $(CSRCS:%.c=%.exe)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlEXES += $(SSRCS:%.s=%.exe)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
9512fe850e98fdd448c638ca63fdd92a8a510255ahlROOT_EXES = $(EXES:%=$(TSTDIR)/%)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(ROOT_TSTS) := FILEMODE = 0444
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(ROOT_EXES) := FILEMODE = 0555
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard Lowe# The DTrace tests rely on "normal" behaviour from the compiler which
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard Lowe# agressive optimization of small, simple, one compilation-unit programs may
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard Lowe# utterly subvert. We force the compiler to not optimize rather than engage
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard Lowe# in an arms race with increasingly belligerent optimizers.
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard LoweCOPTFLAG= -xO0
b2510a409d954c73416522e09c354f1d6dbdb0b0Richard Lowe
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweCERRWARN += -_gcc=-Wno-switch
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweCERRWARN += -_gcc=-Wno-unused-variable
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweCERRWARN += -_gcc=-Wno-implicit-function-declaration
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweCERRWARN += -_gcc=-Wno-unused-function
7014882c6a3672fd0e5d60200af8643ae53c5928Richard LoweCERRWARN += -_gcc=-Wno-unused-variable
7014882c6a3672fd0e5d60200af8643ae53c5928Richard Lowe
9512fe850e98fdd448c638ca63fdd92a8a510255ahlall: $(EXES)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlclean lint:
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlclobber: FRC
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl -$(RM) $(DSRCS:%.d=%.o)
f3b585ce799a83688c5532c430f6133f098431c2samf -$(RM) $(CLOBBERFILES)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlinstall: $(ROOT_TSTS) $(ROOT_EXES)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(ROOT_TSTS): $(TSTDIR)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(ROOT_EXES): $(TSTDIR)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(TSTDIR):
9512fe850e98fdd448c638ca63fdd92a8a510255ahl $(INS.dir)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl$(TSTDIR)/%: %
9512fe850e98fdd448c638ca63fdd92a8a510255ahl $(INS) -s -d -m $(DIRMODE) $(@D)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl $(INS.file)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl%.exe: %.c
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(LINK.c) -o $@ $< $(LDLIBS)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(POST_PROCESS) ; $(STRIP_STABS)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl%.exe: %.o
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(LINK.c) -o $@ $< $(LDLIBS)
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(POST_PROCESS) ; $(STRIP_STABS)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl%.o: %.c
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(COMPILE.c) -o $@ $<
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(POST_PROCESS_O)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahl%.o: %.s
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(COMPILE.s) -o $@ $<
73427c57f824c3ec3b396181b163f37d50c5b3b1ahl $(POST_PROCESS_O)
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlscripts: FRC
9512fe850e98fdd448c638ca63fdd92a8a510255ahl @cd ../cmd/scripts; pwd; $(MAKE) install
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahldstyle: FRC
c7158ae983f5a04c4a998f468ecefba6d23ba721tariq @if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi
9512fe850e98fdd448c638ca63fdd92a8a510255ahl
9512fe850e98fdd448c638ca63fdd92a8a510255ahlFRC: