1# 2# CDDL HEADER START 3# 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. 7# 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. 12# 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] 18# 19# CDDL HEADER END 20# 21 22# 23# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29include $(SRC)/cmd/Makefile.cmd 30 31.KEEP_STATE: 32 33ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt 34ROOTTST = $(ROOTOPTPKG)/tst 35SUBDIR :sh= basename `pwd` 36TSTDIR = $(ROOTTST)/$(SUBDIR) 37DSTYLE = $(ROOTOPTPKG)/bin/dstyle 38 39CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3- 40SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3- 41DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3- 42 43TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \ 44 -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \ 45 -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d 46 47EXES :sh= find . -name SCCS -prune -o -name *.exe -print | cut -b3- 48EXES += $(CSRCS:%.c=%.exe) 49EXES += $(SSRCS:%.s=%.exe) 50 51ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%) 52ROOT_EXES = $(EXES:%=$(TSTDIR)/%) 53 54$(ROOT_TSTS) := FILEMODE = 0444 55$(ROOT_EXES) := FILEMODE = 0555 56 57all: $(EXES) 58 59clean lint: 60 61clobber: FRC 62 -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o) 63 -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o) 64 -$(RM) $(DSRCS:%.d=%.o) 65 -$(RM) $(CLOBBERFILES) 66 67install: $(ROOT_TSTS) $(ROOT_EXES) 68 69$(ROOT_TSTS): $(TSTDIR) 70 71$(ROOT_EXES): $(TSTDIR) 72 73$(TSTDIR): 74 $(INS.dir) 75 76$(TSTDIR)/%: % 77 $(INS) -s -d -m $(DIRMODE) $(@D) 78 $(INS.file) 79 80%.exe: %.c 81 $(LINK.c) -o $@ $< $(LDLIBS) 82 $(POST_PROCESS) ; $(STRIP_STABS) 83 84%.exe: %.o 85 $(LINK.c) -o $@ $< $(LDLIBS) 86 $(POST_PROCESS) ; $(STRIP_STABS) 87 88%.o: %.c 89 $(COMPILE.c) -o $@ $< 90 $(POST_PROCESS_O) 91 92%.o: %.s 93 $(COMPILE.s) -o $@ $< 94 $(POST_PROCESS_O) 95 96scripts: FRC 97 @cd ../cmd/scripts; pwd; $(MAKE) install 98 99dstyle: FRC 100 @$(DSTYLE) $(DSRCS) 101 102FRC: 103