Makefile revision 919
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# Common Development and Distribution License (the "License").
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# You may not use this file except in compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# If applicable, add the following below this CDDL HEADER, with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# fields enclosed by brackets "[]" replaced with your own identifying
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# information: Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# for now, the assumption is we build any directory with a Makefile. This may
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington# not always be the case. If we build a new make-like tool to drive the upper
3296aadab8464fc555488c34c7ee63644b754387Peter Major# level build, it may make different decisions and will need to include
5f4d6070f856d0de82c1d16459b89233e2e81ff2Kohei Tamura# appropriate dependency information.
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington# components.mk is auto-generated by the build tools. It populates the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# COMPONENT_DIRS macro with a list of all directories in the workspace that
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# contain a component.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fostercomponents.mk: # Makefile # $(WS_TOP)/components
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @echo "Generating component list..."
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# depends.mk is auto-generated by concatenating 'depend.mk' files in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# component directory.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @echo "Generating component dependencies..."
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterprep build install publish test: TEMPLATE_ZONE=$(ZONE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterprep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# turn off pkglint for the individual component builds.
8af80418ba1ec431c8027fa9668e5678658d3611Allan FosterCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fostersetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
8af80418ba1ec431c8027fa9668e5678658d3611Allan FosterDUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
8af80418ba1ec431c8027fa9668e5678658d3611Allan FosterDUMMYPKG += "set org.opensolaris.consolidation=userland\n"
8af80418ba1ec431c8027fa9668e5678658d3611Allan FosterDUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
3296aadab8464fc555488c34c7ee63644b754387Peter Major @cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# to pass a few things on to zone based builds
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster echo "export PATH WS_TOP" >>$@
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster -s "$(CONSOLIDATION) consolidation incorporation" \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster -d "This incorporation constrains packages from the $(CONSOLIDATION) consolidation" \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster# pkglint all of the published manifests in one batch.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @echo 'pkglinting all package manifests...'
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)