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