make-rules/ips.mk
changeset 59 7500d63edb42
parent 53 e398cb2c4b45
child 64 a4b12971cf99
equal deleted inserted replaced
58:d8024c042a00 59:7500d63edb42
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    16 # fields enclosed by brackets "[]" replaced with your own identifying
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 # Copyright (c) 2010, Oracle and/or it's affiliates.  All rights reserved.
    21 # Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
    22 #
    22 #
    23 
    23 
    24 #
    24 #
    25 # Rules and Macros for generating an IPS package manifest and publishing an
    25 # Rules and Macros for generating an IPS package manifest and publishing an
    26 # IPS package to a pkg depot.
    26 # IPS package to a pkg depot.
    27 #
    27 #
    28 # To use these rules, include ../make-rules/ips.mk in your Makefile
    28 # To use these rules, include ../make-rules/ips.mk in your Makefile
    29 # and define an "install" target appropriate to building your component.
    29 # and define an "install" target appropriate to building your component.
    30 # Ex:
    30 # Ex:
    31 #
    31 #
    32 #	install:	$(COMPONENT_SRC)/build-$(MACH32)/.installed \
    32 #	install:	$(BUILD_DIR)/build/$(MACH32)/.installed \
    33 #	 		$(COMPONENT_SRC)/build-$(MACH64)/.installed
    33 #	 		$(BUILD_DIR)/build/$(MACH64)/.installed
    34 #
    34 #
    35 # This set of rules makes the "publish" target the default target for make(1)
    35 # This set of rules makes the "publish" target the default target for make(1)
    36 #
    36 #
    37 
    37 
    38 PKGDEPEND =	/usr/bin/pkgdepend
    38 PKGDEPEND =	/usr/bin/pkgdepend
    79 # multi-word macros get broken up, so we handle them "specially"
    79 # multi-word macros get broken up, so we handle them "specially"
    80 PKG_OPTIONS +=		-D COMPONENT_SUMMARY=$(COMPONENT_SUMMARY)
    80 PKG_OPTIONS +=		-D COMPONENT_SUMMARY=$(COMPONENT_SUMMARY)
    81 PKG_OPTIONS +=		-D COMPONENT_DESCRIPTION=$(COMPONENT_DESCRIPTION)
    81 PKG_OPTIONS +=		-D COMPONENT_DESCRIPTION=$(COMPONENT_DESCRIPTION)
    82 PKG_OPTIONS +=		-D COMPONENT_CLASSIFICATION=$(COMPONENT_CLASSIFICATION)
    82 PKG_OPTIONS +=		-D COMPONENT_CLASSIFICATION=$(COMPONENT_CLASSIFICATION)
    83 
    83 
    84 MANIFEST_BASE =		$(COMPONENT_SRC)/manifest-$(MACH)
    84 MANIFEST_BASE =		$(BUILD_DIR)/manifest-$(MACH)
    85 
    85 
    86 CANONICAL_MANIFESTS =	$(wildcard *.p5m)
    86 CANONICAL_MANIFESTS =	$(wildcard *.p5m)
    87 GENERATED =		$(MANIFEST_BASE)-generated
    87 GENERATED =		$(MANIFEST_BASE)-generated
    88 COMBINED =		$(MANIFEST_BASE)-combined
    88 COMBINED =		$(MANIFEST_BASE)-combined
    89 MANIFESTS =		$(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%)
    89 MANIFESTS =		$(CANONICAL_MANIFESTS:%=$(MANIFEST_BASE)-%)
   103 
   103 
   104 .DEFAULT:		publish
   104 .DEFAULT:		publish
   105 
   105 
   106 .SECONDARY:
   106 .SECONDARY:
   107 
   107 
   108 publish:		install $(COMPONENT_SRC)/.published
   108 publish:		install $(BUILD_DIR)/.published
   109 
   109 
   110 sample-manifest:	$(GENERATED).p5m
   110 sample-manifest:	$(GENERATED).p5m
   111 
   111 
   112 $(GENERATED).p5m:	install
   112 $(GENERATED).p5m:	install
   113 	$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) | \
   113 	$(PKGSEND) generate $(PKG_HARDLINKS:%=--target %) $(PROTO_DIR) | \
   149 $(MANIFEST_BASE)-%.published:	$(MANIFEST_BASE)-%.linted
   149 $(MANIFEST_BASE)-%.published:	$(MANIFEST_BASE)-%.linted
   150 	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
   150 	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
   151 		-d $(PROTO_DIR) -d $(@D) -d . $<
   151 		-d $(PROTO_DIR) -d $(@D) -d . $<
   152 	$(PKGFMT) <$< >[email protected]
   152 	$(PKGFMT) <$< >[email protected]
   153 
   153 
   154 $(COMPONENT_SRC)/.published:	$(PUBLISHED)
   154 $(BUILD_DIR)/.published:	$(PUBLISHED)
   155 	$(TOUCH) [email protected]
   155 	$(TOUCH) [email protected]
   156 
   156 
   157 print-package-names:	canonical-manifests
   157 print-package-names:	canonical-manifests
   158 	@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-pkgs | \
   158 	@cat $(CANONICAL_MANIFESTS) $(WS_TOP)/transforms/print-pkgs | \
   159 		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \
   159 		$(PKGMOGRIFY) $(PKG_OPTIONS) /dev/fd/0 | \