Makefile revision 58
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# CDDL HEADER START
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# The contents of this file are subject to the terms of the
e999539fb3e45b2617571e0e3ecd651992291701Mark Andrews# Common Development and Distribution License (the "License").
2a40fdc2d34adb8a5c72a748449699666032d461Mark Andrews# You may not use this file except in compliance with the License.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
ac4e70ff8955669341f435bc0a734a17c01af124Mark Andrews# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
d56e188030368b835122d759ebbf8d9613c166f4Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c718d15a9a95054ee3c71540c02335426071fc6dMark Andrews# If applicable, add the following below this CDDL HEADER, with the
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews# CDDL HEADER END
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# for now, the assumption is we build any directory with a Makefile. This may
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# not always be the case. If we build a new make-like tool to drive the upper
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# level build, it may make different decisions and will need to include
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# appropriate dependency information.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# components.mk is auto-generated by the build tools. It populates the
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# COMPONENT_DIRS macro with a list of all directories in the workspace that
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# contain a component.
a3b428812703d22a605a9f882e71ed65f0ffdc65Mark Andrewscomponents.mk: # Makefile # $(WS_TOP)/components
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @echo "Generating component list..."
bac1bc98410bd876b8d38a6de6126709a7f8cc5aAutomatic Updater @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsprep build install publish: TEMPLATE_ZONE=$(ZONE)
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewsprep build install publish: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrewsdownload prep build install publish install-packages validate: $(COMPONENT_DIRS)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas GustafssonCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
4b2cb1422c7c600fbc13b1cb06a8b4693bc11af8Mark Andrews $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews# to pass a few things on to zone based builds
dde4bc92964ec60a35212dfed59562580e3265e3Mark Andrews echo "export PATH WS_TOP" >>$@
04eba969cb9a54bbda2896db2067c07b2ac5ba16Automatic Updater $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
3098364bcdd7a719fbafa5fc8d2cc9e90e5a5989Automatic Updater $(@:%=--component %) --make $(TARGET) $(LOG)
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
04eba969cb9a54bbda2896db2067c07b2ac5ba16Automatic Updater $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
605bd686e437162b5ab65ac4e7c1be0bba1886ddMark Andrews $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
6b5c57e52ac8c3e0af1547be3140ebbfb41a85b3Mark Andrews# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
a9789e288ee11ae4315e27235c33bae5405bd7c4Mark Andrews @echo "Generating component dependencies..."