Home | History | Annotate | Download | only in src
      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 src/CDDL.txt
      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 src/CDDL.txt.
     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.51	08/06/04 SMI"
     27 #
     28 
     29 include defines.mk
     30 
     31 SUBDIRS    = faultserver svc tset
     32 PKGFILES   = doc ds
     33 
     34 PROTODIR   = .
     35 PROTOFLAGS = CTI_PROTO=$(CTI_PROTO) 
     36 CLEANMSG  += | sed -e "s,$(CTI_PROTO),\$$CTI_PROTO,g" -e "s,$(BLDDIR),\$$BLDDIR,g"
     37 
     38 include subdir.mk
     39 
     40 $(SUNMAKE)CODEMGR_WS:sh = echo `(cd ..; pwd)`
     41 $(GNUMAKE)CODEMGR_WS    = $(shell echo `(cd ..; pwd)`)
     42 
     43 $(SUNMAKE)SRCROOT:sh    = pwd
     44 $(GNUMAKE)SRCROOT       = $(shell pwd)
     45 
     46 $(SUNMAKE)OSVER:sh      = uname -pr | cut -d. -f2 | awk '{print "Sol_"$1"/"$2}'
     47 $(GNUMAKE)OSVER         = $(shell uname -pr | cut -d. -f2 | awk '{print "Sol_"$1"/"$2}')
     48 
     49 PKGDEST	   = $(CODEMGR_WS)/packages/$(OSVER)
     50 BLDDIR     = $(CODEMGR_WS)/proto/$(OSVER)
     51 PROTOTYPE  = $(BLDDIR)/prototype
     52 
     53 clean-proto :
     54 	/bin/rm -rf $(BLDDIR)
     55 
     56 clean-pkgs :
     57 	/bin/rm -rf $(PKGDEST)
     58 
     59 package : prototype $(PKGDEST)/SUNWscts
     60 
     61 %/SUNWscts : $(PROTOTYPE)
     62 	mkdir -p $(@D); pkgmk -o -f $< \
     63 	   -b $(SRCROOT) \
     64 	   -a `uname -p` \
     65 	   -p `hostname`@`date "+%y%m%d%H""%""M%S"` \
     66 	   -v `date '+1.5.0,REV=%m.%d.%y%H:%M:%S'` \
     67 	   -d $(@D) 2>&1 | egrep "##|Warning|ERROR"
     68 
     69 PROTO_TET = bin Licence Artistic
     70 
     71 prototype : clean-proto $(PROTOTYPE) pkgproto
     72 	( \
     73 	pkgproto profile.sh=.profile $(BLDDIR)=. | grep -v "prototype" | awk '{print $$1" "$$2" "$$3" "$$4}' ;\
     74 	  pkgproto $(PROTO_TET:%=$(CTI_PROTO)/%=%) | grep -v "bin " \
     75 	    | awk '{print $$1" "$$2" "$$3" "$$4" root bin"}'\
     76 	) | grep -v "SCCS" >> $(PROTOTYPE)
     77 
     78 %/prototype : $(BLDDIR)/bin/gosu_users $(BLDDIR)/.rhosts
     79 	echo "create $@"; ( \
     80 	  echo "!default 0775 scate bin"  ;\
     81 	  cd pkgdefs; /bin/ls | egrep -v SCCS | awk '{print "i "$$1"=$(SRCROOT)/pkgdefs/"$$1}') | grep -v "SCCS" >> $@
     82 
     83 %/gosu_users :
     84 	test -d $(@D) || mkdir -p $(@D); echo "scate" > $@; chmod 555 $@
     85 
     86 %/.rhosts :  
     87 	echo "+ scate" > $@
     88