Home | History | Annotate | Download | only in pkgdefs
      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 2009 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 
     27 pkginfo: pkginfo.tmpl $(PKGDEFS)/awk_pkginfo
     28 	$(RM) $@; nawk -f $(PKGDEFS)/awk_pkginfo $@.tmpl > $@
     29 
     30 pkg: $(PKGARCHIVE) FRC
     31 	pkgmk -f prototype_$(MACH) -d $(PKGARCHIVE) \
     32 	    -r "$(ROOT) $(PARENT_ROOT)" -o $(PACKAGE)
     33 
     34 optpkg: $(PKGARCHIVE) FRC
     35 	pkgmk -f prototype_$(MACH) -d $(PKGARCHIVE) \
     36 	    -r "$(ROOT) $(PARENT_ROOT)" -b opt -o $(PACKAGE)
     37 
     38 $(PKGARCHIVE):
     39 	[ -d $(PKGARCHIVE) ] || mkdir -p $(PKGARCHIVE)
     40 
     41 $(CHKINSTALL): $(PKGDEFS)/common_files/$(CHKINSTALLSRC)
     42 	$(RM) $(CHKINSTALL)
     43 	cp $(PKGDEFS)/common_files/$(CHKINSTALLSRC) $(CHKINSTALL)
     44 
     45 #
     46 # If the file is under SCM, then it should not be destroyed
     47 # by an install rule here.  This is a mistake in the package
     48 # makefile.
     49 #
     50 # These tests should return "true" if the file is NOT
     51 # under SCM, so that they can be followed by a logical OR
     52 # that will only be evaluated for the intended failure
     53 # case.
     54 #
     55 # The three "$(TRUE)" macros cover the situations where SCM_TYPE
     56 # is not set (""), or it's set by nightly.sh for a tarball source
     57 # tree ("none"), or it's set by bldenv for a tarball source tree
     58 # ("unknown").
     59 #
     60 NOT_UNDER_=$(TRUE)
     61 NOT_UNDER_none=$(TRUE)
     62 NOT_UNDER_unknown=$(TRUE)
     63 NOT_UNDER_mercurial= \
     64 	( hg locate --include . $@ > /dev/null ; [ $$? != 0 ] )
     65 NOT_UNDER_teamware=[ ! -f SCCS/s.$@ ]
     66 NOT_UNDER_SCM=$(NOT_UNDER_$(SCM_TYPE))
     67 
     68 copyright: $(BUILDPKGCR) $(LICENSEFILES)
     69 	@$(NOT_UNDER_SCM) || ( $(ECHO) "generated copyright file" \
     70 		"should not be under SCM">&2 && false )
     71 	@$(DO_BUILDPKGCR)
     72 
     73 $(DATAFILES): $(PKGDEFS)/common_files/$$@
     74 	@$(NOT_UNDER_SCM) || \
     75 		( $(ECHO) "DATAFILES list is incorrect for $@">&2 && false )
     76 	$(RM) $@; cp $(PKGDEFS)/common_files/$@ $@
     77 
     78 $(MACHDATAFILES): $(PKGDEFS)/common_files/$$@_$(MACH)
     79 	$(RM) $@; cp $(PKGDEFS)/common_files/$@_$(MACH) $@
     80 
     81 clean: 
     82 	-$(RM) $(CLEANFILES)
     83 
     84 clobber: clean
     85 	-$(RM) $(CLOBBERFILES)
     86 
     87 FRC:
     88