Makefile revision 34
c9d53cd78829e538aee56b84db508d8d944e6551Till Mossakowski# CDDL HEADER START
c9d53cd78829e538aee56b84db508d8d944e6551Till Mossakowski# The contents of this file are subject to the terms of the
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# Common Development and Distribution License (the "License").
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# You may not use this file except in compliance with the License.
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e7eefd526faedd63acb8f91de5793368cfe67655Klaus Luettich# See the License for the specific language governing permissions
1d9290e729b7cd9a6f666432934fd890a9766fbdChristoph Lange# and limitations under the License.
c9d53cd78829e538aee56b84db508d8d944e6551Till Mossakowski# When distributing Covered Code, include this CDDL HEADER in each
e7eefd526faedd63acb8f91de5793368cfe67655Klaus Luettich# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c9d53cd78829e538aee56b84db508d8d944e6551Till Mossakowski# If applicable, add the following below this CDDL HEADER, with the
e7eefd526faedd63acb8f91de5793368cfe67655Klaus Luettich# fields enclosed by brackets "[]" replaced with your own identifying
e7eefd526faedd63acb8f91de5793368cfe67655Klaus Luettich# information: Portions Copyright [yyyy] [name of copyright owner]
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# CDDL HEADER END
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved.
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# for now, the assumption is we build any directory with a Makefile. This may
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# not always be the case. If we build a new make-like tool to drive the upper
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# level build, it may make different decisions and will need to include
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# appropriate dependency information.
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# components.mk is auto-generated by the build tools. It populates the
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# COMPONENT_DIRS macro with a list of all directories in the workspace that
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski# contain a component.
8d576513b8c89016a3d678378ed75cac0e2e1aefChristian Maedercomponents.mk: # Makefile # $(WS_TOP)/components
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski @echo "Generating component list..."
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
d3f2015ae170a15e5b57d4880ded53073d725ac0Till Mossakowski | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowskiprep build install publish: TEMPLATE_ZONE=$(ZONE)
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowskiprep build install publish: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowskidownload prep build install publish validate: $(COMPONENT_DIRS)
5277e290ad70afdf97f359019afd8fb5816f4102Till MossakowskiCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowskiclobber: $(COMPONENT_DIRS:%=%.nosetup) clean
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski $(PKGSEND) -s $(PKG_REPO) create-repository \
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski --set-property publisher.prefix=$(PUBLISHER)
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski# to pass a few things on to zone based builds
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski echo "export PATH WS_TOP" >>$@
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
5277e290ad70afdf97f359019afd8fb5816f4102Till Mossakowski @cd $(@:%.nosetup=%) ; echo "$(TARGET) $(@:%.nosetup=%)" ; \
91dd24480df03b2cca7c1645bb2866d7000dfdb1Till Mossakowski $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
91dd24480df03b2cca7c1645bb2866d7000dfdb1Till Mossakowski $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
91dd24480df03b2cca7c1645bb2866d7000dfdb1Till Mossakowski# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
65afd6de83b252cc393ee407bab4dd8b57b97e0bDominik Luecke @echo "Generating component dependencies..."