xref: /titanic_44/usr/src/cmd/dtrace/test/tst/Makefile.com (revision 7014882c6a3672fd0e5d60200af8643ae53c5928)
19512fe85Sahl#
29512fe85Sahl# CDDL HEADER START
39512fe85Sahl#
49512fe85Sahl# The contents of this file are subject to the terms of the
59512fe85Sahl# Common Development and Distribution License (the "License").
69512fe85Sahl# You may not use this file except in compliance with the License.
79512fe85Sahl#
89512fe85Sahl# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
99512fe85Sahl# or http://www.opensolaris.org/os/licensing.
109512fe85Sahl# See the License for the specific language governing permissions
119512fe85Sahl# and limitations under the License.
129512fe85Sahl#
139512fe85Sahl# When distributing Covered Code, include this CDDL HEADER in each
149512fe85Sahl# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
159512fe85Sahl# If applicable, add the following below this CDDL HEADER, with the
169512fe85Sahl# fields enclosed by brackets "[]" replaced with your own identifying
179512fe85Sahl# information: Portions Copyright [yyyy] [name of copyright owner]
189512fe85Sahl#
199512fe85Sahl# CDDL HEADER END
209512fe85Sahl#
219512fe85Sahl
229512fe85Sahl#
23c7158ae9Stariq# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
249512fe85Sahl# Use is subject to license terms.
259512fe85Sahl#
269512fe85Sahl
2773427c57Sahlinclude $(SRC)/cmd/Makefile.cmd
289512fe85Sahl
299512fe85Sahl.KEEP_STATE:
309512fe85Sahl
319512fe85SahlROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
329512fe85SahlROOTTST = $(ROOTOPTPKG)/tst
339512fe85SahlSUBDIR :sh= basename `pwd`
349512fe85SahlTSTDIR = $(ROOTTST)/$(SUBDIR)
359512fe85SahlDSTYLE = $(ROOTOPTPKG)/bin/dstyle
369512fe85Sahl
379512fe85SahlCSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
389512fe85SahlSSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
399512fe85SahlDSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
409512fe85Sahl
419512fe85SahlTSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
429512fe85Sahl	-name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
4310e6dadfSbrendan	-o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \
4410e6dadfSbrendan	-o -name get.*.pl
459512fe85Sahl
4610e6dadfSbrendanEXES :sh= find . -name SCCS -prune -o \( -name *.exe -o -name \*.pl \) -print \
4710e6dadfSbrendan    | cut -b3-
489512fe85SahlEXES += $(CSRCS:%.c=%.exe)
499512fe85SahlEXES += $(SSRCS:%.s=%.exe)
509512fe85Sahl
519512fe85SahlROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
529512fe85SahlROOT_EXES = $(EXES:%=$(TSTDIR)/%)
539512fe85Sahl
549512fe85Sahl$(ROOT_TSTS) := FILEMODE = 0444
559512fe85Sahl$(ROOT_EXES) := FILEMODE = 0555
569512fe85Sahl
57b2510a40SRichard Lowe# The DTrace tests rely on "normal" behaviour from the compiler which
58b2510a40SRichard Lowe# agressive optimization of small, simple, one compilation-unit programs may
59b2510a40SRichard Lowe# utterly subvert.  We force the compiler to not optimize rather than engage
60b2510a40SRichard Lowe# in an arms race with increasingly belligerent optimizers.
61b2510a40SRichard LoweCOPTFLAG=	-xO0
62b2510a40SRichard Lowe
63*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-switch
64*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
65*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-implicit-function-declaration
66*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-function
67*7014882cSRichard LoweCERRWARN +=	-_gcc=-Wno-unused-variable
68*7014882cSRichard Lowe
699512fe85Sahlall: $(EXES)
709512fe85Sahl
719512fe85Sahlclean lint:
729512fe85Sahl
739512fe85Sahlclobber: FRC
7473427c57Sahl	-$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
7573427c57Sahl	-$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
7673427c57Sahl	-$(RM) $(DSRCS:%.d=%.o)
77f3b585ceSsamf	-$(RM) $(CLOBBERFILES)
789512fe85Sahl
799512fe85Sahlinstall: $(ROOT_TSTS) $(ROOT_EXES)
809512fe85Sahl
819512fe85Sahl$(ROOT_TSTS): $(TSTDIR)
829512fe85Sahl
839512fe85Sahl$(ROOT_EXES): $(TSTDIR)
849512fe85Sahl
859512fe85Sahl$(TSTDIR):
869512fe85Sahl	$(INS.dir)
879512fe85Sahl
889512fe85Sahl$(TSTDIR)/%: %
899512fe85Sahl	$(INS) -s -d -m $(DIRMODE) $(@D)
909512fe85Sahl	$(INS.file)
919512fe85Sahl
929512fe85Sahl%.exe: %.c
9373427c57Sahl	$(LINK.c) -o $@ $< $(LDLIBS)
9473427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
959512fe85Sahl
969512fe85Sahl%.exe: %.o
9773427c57Sahl	$(LINK.c) -o $@ $< $(LDLIBS)
9873427c57Sahl	$(POST_PROCESS) ; $(STRIP_STABS)
999512fe85Sahl
1009512fe85Sahl%.o: %.c
10173427c57Sahl	$(COMPILE.c) -o $@ $<
10273427c57Sahl	$(POST_PROCESS_O)
1039512fe85Sahl
1049512fe85Sahl%.o: %.s
10573427c57Sahl	$(COMPILE.s) -o $@ $<
10673427c57Sahl	$(POST_PROCESS_O)
1079512fe85Sahl
1089512fe85Sahlscripts: FRC
1099512fe85Sahl	@cd ../cmd/scripts; pwd; $(MAKE) install
1109512fe85Sahl
1119512fe85Sahldstyle: FRC
112c7158ae9Stariq	@if [ -n "$(DSRCS)" ]; then $(DSTYLE) $(DSRCS); fi
1139512fe85Sahl
1149512fe85SahlFRC:
115