Makefile revision 2238
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# for now, the assumption is we build any directory with a Makefile. This may
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# not always be the case. If we build a new make-like tool to drive the upper
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# level build, it may make different decisions and will need to include
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# appropriate dependency information.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# components.mk is auto-generated by the build tools. It populates the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# COMPONENT_DIRS macro with a list of all directories in the workspace that
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# contain a component.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewscomponents.mk: # Makefile # $(WS_TOP)/components
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater @echo "Generating component list..."
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# depends.mk is auto-generated by concatenating 'depend.mk' files in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# component directory.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo "Generating component dependencies..."
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntprep build install publish test: TEMPLATE_ZONE=$(ZONE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsprep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# turn off pkglint for the individual component builds.
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# In order to work around an IPS simultaneous publication issue and to improve
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# top level build performance, we postpone catalog and index updates until the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# end of the build. Individual component builds postpone the updates until
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# they have published all of their packages.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntpublish: MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewssetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsDUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox UserDUMMYPKG += "set org.opensolaris.consolidation=userland\n"
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserDUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox User @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User# to pass a few things on to zone based builds
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt echo "export PATH WS_TOP" >>$@
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt -s "$(CONSOLIDATION) consolidation incorporation" \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews -d "This incorporation constrains packages from the $(CONSOLIDATION) consolidation" \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User $(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# pkglint all of the published manifests in one batch.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @echo 'pkglinting all package manifests...'
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)