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