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