Makefile revision 618
48c0c81cd6fabac9d3386406d97633780365b839coar#
a32ddb6cabb635ca29ccff87f8bf5c6af3b78ecfstoddard# CDDL HEADER START
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj#
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# The contents of this file are subject to the terms of the
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj# Common Development and Distribution License (the "License").
9a93784d34c322d1996e8a7b794a75230eac81a4wrowe# You may not use this file except in compliance with the License.
9a93784d34c322d1996e8a7b794a75230eac81a4wrowe#
4bc630d510cef730e37b9207e145267f473b4471striker# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a096f8d13bee05fd6ea8b9b50b6c2e818eace7d1striker# or http://www.opensolaris.org/os/licensing.
dba571e5c5a2586c7e2b382789f3250136ff7577jwoolley# See the License for the specific language governing permissions
dba571e5c5a2586c7e2b382789f3250136ff7577jwoolley# and limitations under the License.
bf3d1782a29630335a1df535eb395355ab1cd154jwoolley#
07847078a10fe4e9229cc08adda5f421cafc0665jwoolley# When distributing Covered Code, include this CDDL HEADER in each
0bd0176ce9f4321eeb506aa372d0bcc84befbf4cstriker# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
d8028365066fca602bf35d014530a1802114378crbb# If applicable, add the following below this CDDL HEADER, with the
c25203fdca093d4504c51b4cd974ff60d5aa4fb1wrowe# fields enclosed by brackets "[]" replaced with your own identifying
c25203fdca093d4504c51b4cd974ff60d5aa4fb1wrowe# information: Portions Copyright [yyyy] [name of copyright owner]
c25203fdca093d4504c51b4cd974ff60d5aa4fb1wrowe#
d89c116f82699294ca744125723651c554bc5925wrowe# CDDL HEADER END
4214e98fc9045e5010e66f9a967bd6d68f40d342aaron#
8721697e2aece27b0e738519329f7976c72b27bfjerenkrantz# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
c25203fdca093d4504c51b4cd974ff60d5aa4fb1wrowe#
91cacb801f6c0215b38322f6d2fc58cbfedfecfbjerenkrantz
91cacb801f6c0215b38322f6d2fc58cbfedfecfbjerenkrantzinclude ../make-rules/shared-macros.mk
df14f0d3a5191cdd7c4bb5b03acd135d43a6f51brbb
df14f0d3a5191cdd7c4bb5b03acd135d43a6f51brbb# for now, the assumption is we build any directory with a Makefile. This may
ab71b233b3a36489e44a7b061c48293be0b17788jwoolley# not always be the case. If we build a new make-like tool to drive the upper
571760de5e60c0b459cb11be45507b923cd023eejwoolley# level build, it may make different decisions and will need to include
571760de5e60c0b459cb11be45507b923cd023eejwoolley# appropriate dependency information.
9180a5933673ffb1af633c255ceee029340f3b1erbb
bcb6e1be6041dfeb549c8ea8d37f97ad4e90a0c3rbb# components.mk is auto-generated by the build tools. It populates the
9bd71e35f5d26d26d23fe3a677401828e842ed72wrowe# COMPONENT_DIRS macro with a list of all directories in the workspace that
2900ab946a2d76b73a14cebfe2985d253f01c967stoddard# contain a component.
a548c09e6a8ca1b059d0e93b5256c6ccb2b3c3cdrbbcomponents.mk: # Makefile # $(WS_TOP)/components
a548c09e6a8ca1b059d0e93b5256c6ccb2b3c3cdrbb @echo "Generating component list..."
a548c09e6a8ca1b059d0e93b5256c6ccb2b3c3cdrbb @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
b876b7bcf0ce3d232da723246d709e8dbbfe8762rbb | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
cf6bf6c34c936e6a6fe731dbce4a5c3c8bf8e9a3gstein
35330e0d79ceb8027223bbb8330a381b1f989d6etrawick-include components.mk
6f6f4a4bca281779d196acbdd5c017bb90858305trawick
8dd4618c4709236b4ea297d7250d282e463ce2d8rbb# depends.mk is auto-generated by concatenating 'depend.mk' files in each
09bd86d0db1114ee23eda0a6eb76ca055877a1cftrawick# component directory.
2deb319e6b3de239f45c16a3e9e836d44f1f7108rbbdepends.mk: components.mk
bd929c73ef04789b7183b840d8db6e01d03a4d86rbb @echo "Generating component dependencies..."
70f6f32765cfaadd6da8de6f0fea97ddd72d8fadmanoj @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
2a6c49cfaef5979a5a06098f3ce987cd76769409manoj | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
af4c982a7cf4515f124935f99a329744035fc699slive 2>/dev/null
af4c982a7cf4515f124935f99a329744035fc699slive
af4c982a7cf4515f124935f99a329744035fc699slive-include depends.mk
af4c982a7cf4515f124935f99a329744035fc699slive
af4c982a7cf4515f124935f99a329744035fc699slive
af4c982a7cf4515f124935f99a329744035fc699slivedownload: TARGET = download
af4c982a7cf4515f124935f99a329744035fc699sliveprep: TARGET = prep
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowebuild: TARGET = build
f610c7c704235bc327dbe9b62982f5b3f8e30a77wroweinstall: TARGET = install
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowepublish: TARGET = publish
f610c7c704235bc327dbe9b62982f5b3f8e30a77wroweclean: TARGET = clean
10270f6f94b2069d0d357805c140a9897449b9ccianhclobber: TARGET = clobber
4b62424416882687387923b3130b96241503cbe0jerenkrantztest: TARGET = test
5ca8e11fadb6f7a8d9d0367c1800205c99d4bcd6jerenkrantzprep build install publish test: TEMPLATE_ZONE=$(ZONE)
5ca8e11fadb6f7a8d9d0367c1800205c99d4bcd6jerenkrantzprep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
45b0e1c775c1cfed6473c9e5304179ccb9609f53stoddard
dbec4658981e4f9127e8676457c28d42932be7cdtrawick# turn off pkglint for the individual component builds.
1b7e9aeb9867a1c94e24e8ae491d2dfcd0d225e3jerenkrantzpublish: MAKEFLAGS += PKGLINT=/bin/true
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz.DEFAULT: publish
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawick
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawickbuild install publish test: $(COMPONENT_DIRS)
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawick
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawickCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
ae72c92fd41562d7c0e8627c093fcbbae4ac9ef2coar
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawickdownload prep: $(COMPONENT_DIRS.nosetup)
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawick
418f39e60a288f855ec033b566744489c3bbbf39trawickclean: $(COMPONENT_DIRS.nosetup)
cc22a72861c58dda7f3768613aec864e4c4e0353striker $(RM) components.mk depends.mk .profile
f95a0b59eb24c631f15bd83e20c6cf823c432d83trawick
ddafc111b94558ef4e2d7357ceda623315566ce3sliveclobber: $(COMPONENT_DIRS.nosetup) clean
ddafc111b94558ef4e2d7357ceda623315566ce3slive $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
ae72c92fd41562d7c0e8627c093fcbbae4ac9ef2coar
ddafc111b94558ef4e2d7357ceda623315566ce3slivesetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
93f189f1198f539d3cfa75a15b23dcde60ee35ffrbb
93f189f1198f539d3cfa75a15b23dcde60ee35ffrbb$(WS_LOGS):
b3b4e853e4958357ee2d50e2fe41effecfde9eedwrowe $(MKDIR) $@
a4d9e6fdcd5d2ddd93a896b42a1d607ed258c316ianh
a4d9e6fdcd5d2ddd93a896b42a1d607ed258c316ianh$(WS_REPO):
ae72c92fd41562d7c0e8627c093fcbbae4ac9ef2coar $(PKGREPO) create $(PKG_REPO)
93f189f1198f539d3cfa75a15b23dcde60ee35ffrbb $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz$(WS_LINT_CACHE): $(WS_LOGS)
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantzifdef CANONICAL_REPO
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz @(echo "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)" | $(PKGLINT) \
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantzelse
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz $(MKDIR) $(WS_LINT_CACHE)
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantzendif
2fb49a1d25f38421a68d31b4cbb5d9293fdeafbewrowe
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantztools:
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
cc22a72861c58dda7f3768613aec864e4c4e0353striker# to pass a few things on to zone based builds
1af5c0e25a649bb298e25ddfa5418fa18bdcb107aaron.profile:
82455c2e3b6991846fbcbf0c9e41f57dbc681217brianp echo "PATH=$(PATH)" >>$@
82455c2e3b6991846fbcbf0c9e41f57dbc681217brianp echo "WS_TOP=$(WS_TOP)" >>$@
f4cb04eb78da02a38fcdd87489dc7b660107d55fjerenkrantz echo "export PATH WS_TOP" >>$@
1b3f48fd6b1ccb8745f908e40156c5a85ca3c347jerenkrantz
b05930e6008f69bd323abe0c10f81f40ffd27983brianp$(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe @cd $@ && echo "$(TARGET) $@" && \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(@:%=--component %) --make $(TARGET) $(LOG)
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowepublish:
b3b4e853e4958357ee2d50e2fe41effecfde9eedwrowe $(PKGREPO) rebuild -s $(PKG_REPO)
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe -s "$(CONSOLIDATION) consolidation incorporation" \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe -d "This incorporation constrains packages from the $(CONSOLIDATION) consolidation" \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
6362fd5c48f6b2193f5d356a9747172101b24e91jerenkrantz $(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe# pkglint all of the published manifests in one batch.
f610c7c704235bc327dbe9b62982f5b3f8e30a77wroweifdef CANONICAL_REPO
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe @echo 'pkglinting all package manifests...'
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe -c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(shell find . -name 'manifest-*.published')
f610c7c704235bc327dbe9b62982f5b3f8e30a77wroweendif
630f5fc1277582643fe0f831a4830e15127bd047jwoolley
630f5fc1277582643fe0f831a4830e15127bd047jwoolley$(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
630f5fc1277582643fe0f831a4830e15127bd047jwoolley @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
f610c7c704235bc327dbe9b62982f5b3f8e30a77wrowe
f610c7c704235bc327dbe9b62982f5b3f8e30a77wroweFORCE:
56b2562cb4041a21bc313fde3204beabdb758800jwoolley