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 2008 Sun Microsystems, Inc. All rights reserved. 24 # Use is subject to license terms. 25 # 26 # ident "@(#)Makefile 1.8 08/11/21 SMI" 27 # 28 29 MACH = ${HOST_ARCH:-%=%} 30 WD :sh = pwd 31 32 WS_ROOT_SH = export WD; WD=${WD}; \ 33 /usr/bin/ksh -p -c \ 34 'typeset wd=$${WD}; \ 35 while [[ ! -d $${wd}/src/tools ]] && \ 36 [[ $${wd:-"/"} != "/" ]]; \ 37 do wd=$${wd%/*}; done; \ 38 print $${wd%/usr};' 39 WS_ROOT = ${WS_ROOT_SH:sh} 40 41 CHECKENV_SUITE = ${WD} 42 CHECKENV_PROTO = ${WS_ROOT}/proto/tools/checkenv 43 44 SUBDIRS = bin lib 45 46 all := TARGET = install 47 install := TARGET = install 48 clean := TARGET = clean 49 clobber := TARGET = clobber 50 unpackage := STF_BUILD_PKG_OPTIONS = -r 51 52 # 53 # The following macros are used during "make package | unpackage" 54 # 55 STF_PKGMODE = 0022 56 STF_PKGARCHIVE = ${WS_ROOT}/packages 57 # Find path to stf_build_pkg tool 58 STF_BUILD_PKG:sh= /usr/bin/ksh -p -c \ 59 'pkgtool="$(whence -p stf_build_pkg)"; \ 60 echo ${pkgtool};' 61 # Find path to STF root directory 62 STF_TOOLS:sh = /usr/bin/ksh -p -c \ 63 'pkgtool="$(whence -p stf_build_pkg)"; \ 64 stfpath="${pkgtool%%/bin/*}"; echo ${stfpath};' 65 66 install all clean clobber: $(SUBDIRS) 67 68 $(SUBDIRS):: 69 cd $@; ${MAKE} ${TARGET} \ 70 CHECKENV_SUITE=${CHECKENV_SUITE} \ 71 CHECKENV_PROTO=${CHECKENV_PROTO}/$(@F) 72 73 package: install 74 75 package unpackage: 76 @if [ -z "$(STF_BUILD_PKG)" ]; then \ 77 echo "ERROR: Path to stf_build_pkg tool needs to be added" \ 78 "to PATH."; \ 79 exit 1; \ 80 fi 81 /bin/env \ 82 STF_PKGARCHIVE=${STF_PKGARCHIVE} \ 83 STF_SUITE=${CHECKENV_SUITE} \ 84 STF_SUITE_PROTO=${CHECKENV_PROTO} \ 85 STF_MACH_BUILD_MODES=none \ 86 STF_SUITE_BUILD_MODES=none \ 87 STF_MACH=${MACH} \ 88 STF_PKGMODE=${STF_PKGMODE} \ 89 STF_CONFIG_INPUTS=${STF_TOOLS}/etc/BuildConfig.master \ 90 STF_TOOLS=${STF_TOOLS} \ 91 ${STF_BUILD_PKG} ${STF_BUILD_PKG_OPTIONS} 92 93 uninstall: 94 $(RM) -rf ${CHECKENV_PROTO} 95 96