Makefile revision 7034
893N/A#
2362N/A# CDDL HEADER START
893N/A#
893N/A# The contents of this file are subject to the terms of the
893N/A# Common Development and Distribution License (the "License").
893N/A# You may not use this file except in compliance with the License.
2362N/A#
893N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2362N/A# or http://www.opensolaris.org/os/licensing.
893N/A# See the License for the specific language governing permissions
893N/A# and limitations under the License.
893N/A#
893N/A# When distributing Covered Code, include this CDDL HEADER in each
893N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
893N/A# If applicable, add the following below this CDDL HEADER, with the
893N/A# fields enclosed by brackets "[]" replaced with your own identifying
893N/A# information: Portions Copyright [yyyy] [name of copyright owner]
893N/A#
893N/A# CDDL HEADER END
893N/A#
2362N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
2362N/A#
2362N/A
893N/Ainclude ../../../make-rules/shared-macros.mk
893N/A
893N/A# $(WS_MAKE_RULES)/ips.mk really isn't set up to allow you to bypass all
893N/A# the automatic (and lengthy) manifest manipulation that it does, which we
893N/A# really don't need to do for these static, uninteresting packages. So we just
893N/A# write a simple set of publication rules to get the packages into the repo.
893N/A
893N/APKGSEND = /usr/bin/pkgsend
893N/APKGLINT = /usr/bin/pkglint
893N/APKGMOGRIFY = /usr/bin/pkgmogrify
893N/A
893N/ACOMPONENT_NAME= "Package History"
893N/ACOMPONENT_BUGDB= gate-stuff/userland
893N/A
893N/AGENERATE_HISTORY= $(WS_TOOLS)/generate-history
893N/AHISTORY= history
893N/A
893N/AMANIFEST_BASE = $(BUILD_DIR)/manifest-$(MACH)
893N/A
893N/ACANONICAL_MANIFESTS = $(wildcard *.p5m)
893N/AHISTORICAL_MANIFESTS = $(shell $(NAWK) -v FUNCTION=name -v MACH=$(MACH) -f $(GENERATE_HISTORY) < $(HISTORY))
893N/AARCH_MANIFESTS = $(wildcard *.p5m.$(MACH))
893N/AGENERATED_ARCH_MANIFESTS = $(ARCH_MANIFESTS:%.p5m.$(MACH)=%.p5m)
4332N/ACANONICAL_MANIFESTS += $(GENERATED_ARCH_MANIFESTS)
893N/A
893N/AMOGRIFIED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.mogrified)
893N/AHISTOGRIFIED = $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.histogrified)
893N/APUBLISHED = $(CANONICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
893N/APUBLISHED += $(HISTORICAL_MANIFESTS:%.p5m=$(MANIFEST_BASE)-%.published)
893N/A
893N/A# Rule to generate historical manifests from the $(HISTORY) file.
893N/Adefine history-manifest-rule
893N/A$(MANIFEST_BASE)-$(1): $(HISTORY) $(BUILD_DIR)
893N/A $(NAWK) -v FUNCTION=manifest -v MACH=$(MACH) -v TARGET=$1 -f $(GENERATE_HISTORY) < \
893N/A $(HISTORY) > $$@
893N/Aendef
893N/A$(foreach mfst,$(HISTORICAL_MANIFESTS),$(eval $(call history-manifest-rule,$(mfst))))
893N/A
893N/APKG_MACROS = CONSOLIDATION=$(CONSOLIDATION)
893N/APKG_MACROS += BUILD_VERSION=$(BUILD_VERSION)
893N/APKG_MACROS += OS_VERSION=$(OS_VERSION)
893N/A
893N/APKG_OPTIONS += $(PKG_MACROS:%=-D %)
893N/A
893N/Adownload prep build install:
893N/A @echo "nothing to be done for $@"
893N/A
893N/A$(BUILD_DIR):
893N/A $(MKDIR) $@
893N/A
893N/A$(MANIFEST_BASE)-%.mogrified: %.p5m $(BUILD_DIR)
893N/A $(PKGMOGRIFY) $(PKG_OPTIONS) $< \
893N/A $(WS_TOP)/transforms/incorporate > $@
893N/A
893N/A$(MANIFEST_BASE)-%.histogrified: $(MANIFEST_BASE)-%.p5m $(BUILD_DIR)
893N/A $(PKGMOGRIFY) $(PKG_OPTIONS) $< \
893N/A $(WS_TOP)/transforms/incorporate > $@
893N/A
893N/A$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.mogrified $(BUILD_DIR)
893N/A $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
893N/A $(CP) $< $@
893N/A
893N/A$(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.histogrified $(BUILD_DIR)
893N/A $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
893N/A $(CP) $< $@
893N/A
893N/A$(BUILD_DIR)/.linted-$(MACH): $(MOGRIFIED) $(HISTOGRIFIED) $(BUILD_DIR)
893N/A $(ENV) PYTHONPATH=$(WS_TOOLS)/python \
893N/A SOLARIS_VERSION=$(SOLARIS_VERSION) \
893N/A $(PKGLINT) $(CANONICAL_REPO:%=-c $(WS_LINT_CACHE)) \
893N/A -f $(WS_TOOLS)/pkglintrc $(MOGRIFIED)
893N/A $(TOUCH) $@
893N/A
893N/A$(BUILD_DIR)/.published-$(MACH): $(BUILD_DIR)/.linted-$(MACH) $(PUBLISHED)
893N/Aifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
893N/A $(PKGREPO) refresh -s $(PKG_REPO)
893N/Aendif
893N/A $(TOUCH) $@
893N/A
893N/Apublish: $(BUILD_DIR)/.published-$(MACH)
893N/A
893N/A%.p5m: %.p5m.$(MACH)
893N/A $(CP) $< $@
893N/A
893N/Aclobber clean:
893N/A $(RM) -r $(BUILD_DIR) $(GENERATED_ARCH_MANIFESTS)
893N/A