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