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