Makefile revision 34
280a8a0544b4aeb52414d20e8c6e6c5b1108562eTinderbox User#
59602f2a7c4e4809941583bed3e94cd26e628f1aTinderbox User# CDDL HEADER START
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater#
5affecff6e148a8e124d03f5dbac0da11e30dcc5Tinderbox User# The contents of this file are subject to the terms of the
19558a04decde0e7261d489d92d04ad88104217bTinderbox User# Common Development and Distribution License (the "License").
827f8cccb5280f4da66c46186e792d1cb9d73503Mark Andrews# You may not use this file except in compliance with the License.
827f8cccb5280f4da66c46186e792d1cb9d73503Mark Andrews#
969eaf7df8ac651946f76b6631ff5db568c11ef6Tinderbox User# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03ebc228ee3725738b067b6bd7082a9a731822a1Tinderbox User# or http://www.opensolaris.org/os/licensing.
f4ee48be3994797a8332b86c101db4d7b54799ceTinderbox User# See the License for the specific language governing permissions
a2c370ca12bb0360ff7e969474ead3f788c65fffTinderbox User# and limitations under the License.
8de3f14f1c300c3e1ed99084cc03485b42c92bf1Tinderbox User#
e5a6871cd0635ecdb2bf792316a2d8c53206f4b2Tinderbox User# When distributing Covered Code, include this CDDL HEADER in each
950d203b64f512b85fcc093ee1e9e3e531a1aea3Tinderbox User# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# If applicable, add the following below this CDDL HEADER, with the
03ebc228ee3725738b067b6bd7082a9a731822a1Tinderbox User# fields enclosed by brackets "[]" replaced with your own identifying
3759f10fc543747668b1ca4b4671f35b0dea8445Francis Dupont# information: Portions Copyright [yyyy] [name of copyright owner]
e676a596869d8a80a644c99a848afb53d1c5975eMark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# CDDL HEADER END
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews#
d5637bdbb931ff79fced3d4858d83212ea58ed15Tinderbox User# Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
3759f10fc543747668b1ca4b4671f35b0dea8445Francis Dupontinclude ../make-rules/shared-macros.mk
d5637bdbb931ff79fced3d4858d83212ea58ed15Tinderbox User
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# for now, the assumption is we build any directory with a Makefile. This may
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# not always be the case. If we build a new make-like tool to drive the upper
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# level build, it may make different decisions and will need to include
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# appropriate dependency information.
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Hunt# components.mk is auto-generated by the build tools. It populates the
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# COMPONENT_DIRS macro with a list of all directories in the workspace that
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User# contain a component.
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrewscomponents.mk: # Makefile # $(WS_TOP)/components
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews @echo "Generating component list..."
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Hunt @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsinclude components.mk
9ecb5d33470ebfb3719a1b8d56bcefdf4b27f7b2Tinderbox User
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Huntdownload: TARGET = download
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewsprep: TARGET = prep
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox Userbuild: TARGET = build
03ebc228ee3725738b067b6bd7082a9a731822a1Tinderbox Userinstall: TARGET = install
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntpublish: TARGET = publish
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox Uservalidate: TARGET = validate
827f8cccb5280f4da66c46186e792d1cb9d73503Mark Andrewsclean: TARGET = clean
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntclobber: TARGET = clobber
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterprep build install publish: TEMPLATE_ZONE=$(ZONE)
3759f10fc543747668b1ca4b4671f35b0dea8445Francis Dupontprep build install publish: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt.DEFAULT: publish
dc238a06bffa79de141ee7655765e2df91498a8aTinderbox User
827f8cccb5280f4da66c46186e792d1cb9d73503Mark Andrewsdownload prep build install publish validate: $(COMPONENT_DIRS)
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox UserCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
3759f10fc543747668b1ca4b4671f35b0dea8445Francis Dupontclean: $(COMPONENT_DIRS:%=%.nosetup)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater $(RM) components.mk depends.mk .profile
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updaterclobber: $(COMPONENT_DIRS:%=%.nosetup) clean
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews $(RM) -r $(WS_REPO) $(WS_LOGS)
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Hunt
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrewssetup: $(WS_LOGS) repo tools .profile
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater$(WS_LOGS):
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(MKDIR) $@
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Huntrepo:
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews $(PKGSEND) -s $(PKG_REPO) create-repository \
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater --set-property publisher.prefix=$(PUBLISHER)
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrewstools:
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Hunt# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
0eb371ca0dab50ae3462e98794a6126198c52f4bMark Andrews# to pass a few things on to zone based builds
015055b6e23f5c08f6a5b34726f90b62597e9e45Tinderbox User.profile:
03ebc228ee3725738b067b6bd7082a9a731822a1Tinderbox User echo "PATH=$(PATH)" >>$@
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews echo "WS_TOP=$(WS_TOP)" >>$@
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews echo "export PATH WS_TOP" >>$@
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark Andrews
fec6e13f2d1e69fe1c2b8fac36f732f124cf5398Mark Andrews$(COMPONENT_DIRS): setup FORCE
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt @cd $@ ; echo "$(TARGET) $@" ; \
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt $(@:%=--component %) --make $(TARGET) $(LOG)
e813f036c8251b6d9d2a72fa84f80c2c9d2795afMark Andrews
30370d905e9be3be7d9b947fd432bacecbb13bb9Evan Hunt$(COMPONENT_DIRS.nosetup): FORCE
2ae159b376dac23870d8005563c585acf85a4b5aEvan Hunt @cd $(@:%.nosetup=%) ; echo "$(TARGET) $(@:%.nosetup=%)" ; \
7cc0a5d21ef046bfd630c4769943d896a7d7472cTinderbox User $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
03ebc228ee3725738b067b6bd7082a9a731822a1Tinderbox User $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
549c517e2ecad52bb1d32f08920e29d4e8cda71eTinderbox User# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
549c517e2ecad52bb1d32f08920e29d4e8cda71eTinderbox Userdepends.mk: components.mk
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @echo "Generating component dependencies..."
549c517e2ecad52bb1d32f08920e29d4e8cda71eTinderbox User @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=depend \
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews | sed -e 's;$(shell pwd)/;;g' >$@
e40c4e4c17d4df338e2a7db0f84d8dbb3858964cTinderbox User
827f8cccb5280f4da66c46186e792d1cb9d73503Mark Andrewsinclude depends.mk
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
b91d11bfcc30b96f2c80f3a76d12e3dcc8597a68Mark AndrewsFORCE:
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews