Makefile revision 92
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User#
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater# CDDL HEADER START
7a2a1b8b14fc804ac80612d7b98064095e445be5Automatic Updater#
7a42357217528037bdfedcb17eeebfe96ae4266aAutomatic Updater# The contents of this file are subject to the terms of the
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater# Common Development and Distribution License (the "License").
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater# You may not use this file except in compliance with the License.
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater#
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fe84edc17e0d582cf7b4270f8df9d4742a107b1cAutomatic Updater# or http://www.opensolaris.org/os/licensing.
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews# See the License for the specific language governing permissions
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington#
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User# When distributing Covered Code, include this CDDL HEADER in each
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User# If applicable, add the following below this CDDL HEADER, with the
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater# fields enclosed by brackets "[]" replaced with your own identifying
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater# information: Portions Copyright [yyyy] [name of copyright owner]
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater# CDDL HEADER END
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater#
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews#
a01aa536188bb3535dfc1107a623e6355a8e6b7cMark Andrews
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox Userinclude ../make-rules/shared-macros.mk
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# for now, the assumption is we build any directory with a Makefile. This may
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews# not always be the case. If we build a new make-like tool to drive the upper
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# level build, it may make different decisions and will need to include
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# appropriate dependency information.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# components.mk is auto-generated by the build tools. It populates the
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# COMPONENT_DIRS macro with a list of all directories in the workspace that
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# contain a component.
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox Usercomponents.mk: # Makefile # $(WS_TOP)/components
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User @echo "Generating component list..."
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt-include components.mk
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterdownload: TARGET = download
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntprep: TARGET = prep
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updaterbuild: TARGET = build
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updaterinstall: TARGET = install
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Huntpublish: TARGET = publish
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox Userinstall-packages: TARGET = install-packages
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updatervalidate: TARGET = validate
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterclean: TARGET = clean
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterclobber: TARGET = clobber
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updatertest: TARGET = test
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updaterprep build install publish test: TEMPLATE_ZONE=$(ZONE)
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterprep build install publish test: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater# turn off pkglint for the individual component builds.
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updaterpublish: MAKEFLAGS += PKGLINT=/bin/true
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews.DEFAULT: publish
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox Userdownload prep build install publish install-packages validate \
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox Usertest: $(COMPONENT_DIRS)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic UpdaterCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsclean: $(COMPONENT_DIRS:%=%.nosetup)
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updater $(RM) components.mk depends.mk .profile
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
930f6069e5aa157cf6987cdafd412f5757a5a558Automatic Updaterclobber: $(COMPONENT_DIRS:%=%.nosetup) clean
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updatersetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
114f7780384371121918624ae2c80ecfce545683Tinderbox User$(WS_LOGS):
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater $(MKDIR) $@
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater$(WS_REPO):
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(PKGSEND) -s $(PKG_REPO) create-repository \
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater --set-property publisher.prefix=$(PUBLISHER)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews$(WS_LINT_CACHE): $(WS_LOGS)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterifdef CANONICAL_REPO
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater @(echo "set name=fmri value=pkg:/dummy" | $(PKGLINT) \
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterelse
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User $(MKDIR) $(WS_LINT_CACHE)
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrewsendif
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox Usertools:
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User# to pass a few things on to zone based builds
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User.profile:
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont echo "PATH=$(PATH)" >>$@
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews echo "WS_TOP=$(WS_TOP)" >>$@
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User echo "export PATH WS_TOP" >>$@
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews$(COMPONENT_DIRS): setup FORCE
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews @cd $@ && echo "$(TARGET) $@" && \
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater $(@:%=--component %) --make $(TARGET) $(LOG)
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrewspublish:
7500521cecdff3c00e594ec41d3a17292332ffbcTinderbox User# pkglint all of the published manifests in one batch.
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updaterifdef CANONICAL_REPO
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews @echo 'pkglinting all package manifests...'
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
a01aa536188bb3535dfc1107a623e6355a8e6b7cMark Andrews -c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox User $(shell find . -name 'manifest-*.published')
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsendif
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews$(COMPONENT_DIRS.nosetup): FORCE
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updaterdepends.mk: components.mk
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater @echo "Generating component dependencies..."
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=depend \
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater | sed -e 's;$(shell pwd)/;;g' >$@
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater-include depends.mk
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic UpdaterFORCE:
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson