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 "@(#)Makefile 1.7 07/07/02 SMI" 27 # 28 29 MACH = ${HOST_ARCH:-%=%} 30 WD :sh = pwd 31 32 CHECKENV_SUITE = ${WD} 33 CHECKENV_PROTO = ${WD:%/src/tools/checkenv=%/proto/tools/checkenv} 34 35 SUBDIRS = bin lib 36 37 all := TARGET = install 38 install := TARGET = install 39 clean := TARGET = clean 40 clobber := TARGET = clobber 41 unpackage := STF_BUILD_PKG_OPTIONS = -r 42 43 # 44 # The following macros are used during "make package | unpackage" 45 # 46 STF_PKGMODE = 0022 47 STF_PKGARCHIVE = ${WD:%/src/tools/checkenv=%/packages} 48 # Find path to stf_build_pkg tool 49 STF_BUILD_PKG:sh= /usr/bin/ksh -p -c \ 50 'pkgtool="$(whence -p stf_build_pkg)"; \ 51 echo ${pkgtool};' 52 # Find path to STF root directory 53 STF_TOOLS:sh = /usr/bin/ksh -p -c \ 54 'pkgtool="$(whence -p stf_build_pkg)"; \ 55 stfpath="${pkgtool%%/bin/*}"; echo ${stfpath};' 56 57 install all clean clobber: $(SUBDIRS) 58 59 $(SUBDIRS):: 60 cd $@; ${MAKE} ${TARGET} \ 61 CHECKENV_SUITE=${CHECKENV_SUITE} \ 62 CHECKENV_PROTO=${CHECKENV_PROTO}/$(@F) 63 64 package: install 65 66 package unpackage: 67 @if [ -z "$(STF_BUILD_PKG)" ]; then \ 68 echo "ERROR: Path to stf_build_pkg tool needs to be added" \ 69 "to PATH."; \ 70 exit 1; \ 71 fi 72 /bin/env \ 73 STF_PKGARCHIVE=${STF_PKGARCHIVE} \ 74 STF_SUITE=${CHECKENV_SUITE} \ 75 STF_SUITE_PROTO=${CHECKENV_PROTO} \ 76 STF_MACH_BUILD_MODES=none \ 77 STF_SUITE_BUILD_MODES=none \ 78 STF_MACH=${MACH} \ 79 STF_PKGMODE=${STF_PKGMODE} \ 80 STF_CONFIG_INPUTS=${STF_TOOLS}/etc/BuildConfig.master \ 81 STF_TOOLS=${STF_TOOLS} \ 82 ${STF_BUILD_PKG} ${STF_BUILD_PKG_OPTIONS} 83 84 uninstall: 85 $(RM) -rf ${CHECKENV_PROTO} 86 87