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/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 usr/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 #ident	"@(#)Makefile.targ	1.26	07/11/18 SMI"
     24 #
     25 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     26 # Use is subject to license terms.
     27 #
     28 # pkgdefs/Makefile.targ
     29 #
     30 
     31 .KEEP_STATE: 
     32 
     33 PSTAMP:sh= date +%m/%d/%Y.%T
     34 $(NOT_RELEASE_BUILD)PSTAMP += (`$(ECHO) $$LOGNAME`)
     35 $(NOT_RELEASE_BUILD)PSTAMP += `$(ECHO) [\`basename $$CODEMGR_WS\`]`
     36 
     37 pkginfo: pkginfo.tmpl $(SRC)/pkgdefs/awk_pkginfo
     38 	$(RM) $@; nawk -f $(SRC)/pkgdefs/awk_pkginfo $@.tmpl > $@
     39 
     40 pkg: $(PKGARCH) FRC
     41 	pkgmk -f $(PKGPROTOTYPE) -d $(PKGARCH) -r $(VROOT)$(BASEDIR) \
     42 		-p "$(PSTAMP)" -o $(PACKAGE)
     43 
     44 $(PKGARCH):
     45 	[ -d $(PKGARCH) ] || mkdir -p $(PKGARCH)
     46 
     47 $(DATAFILES): FRC
     48 	@$(RM) $@; \
     49 	if [ -f $@.tmpl ]; then \
     50 		$(CP) $@.tmpl $@; \
     51 	else \
     52 		$(CP) $(SRC)/pkgdefs/common_files/$@ $@; \
     53 	fi
     54 
     55 extpkg: $(PKGARCH)
     56 	cd $(PKGARCH) && $(RM) -r $(PACKAGE)
     57 	cd $(PKGSDIR) && pwd && find $(PACKAGE) -depth -print | cpio -pdum $(PKGARCH)
     58 
     59 $(MSG_CATALOGS): FRC
     60 	x="`$(ECHO) $(MSGROOT)/$@/*.po`"; \
     61 	y="$(MSGROOT)/$@/"'*.po'; \
     62 	$(RM) $(VROOT)/$(CATPATH); \
     63 	if test "$$x" = "$$y"; then \
     64 		exit 1; \
     65 	fi; \
     66 	for f in $(MSGROOT)/$@/*.po; \
     67 	do \
     68 		bd=`basename $$f`; \
     69 		$(ECHO) '#'$(PO_LABEL)$$bd >> $(VROOT)/$(CATPATH); \
     70 		$(SED) -e '/^# msg/d' -e '/^domain/d' $$f >> \
     71 		    $(VROOT)/$(CATPATH); \
     72 	done
     73 
     74 clobber clean:
     75 	-$(RM) $(CLOBBERFILES) $(CLEANFILES)
     76 
     77 patch_build: all
     78 	@if [ "$(PKGPROTOTYPE)" != "prototype_$(NATIVE_MACH)" ]; \
     79 	then \
     80 		$(ECHO) "Creating prototype_$(NATIVE_MACH) from $(PKGPROTOTYPE)"; \
     81 		$(RM) prototype_$(NATIVE_MACH); \
     82 		$(CAT) $(PKGPROTOTYPE) > prototype_$(NATIVE_MACH); \
     83 	fi
     84 
     85 FRC:
     86