Makefile revision 332
70N/A#
70N/A# CDDL HEADER START
1492N/A#
70N/A# The contents of this file are subject to the terms of the
70N/A# Common Development and Distribution License (the "License").
919N/A# You may not use this file except in compliance with the License.
919N/A#
919N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
919N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
919N/A#
70N/A
70N/Ainclude ../make-rules/shared-macros.mk
70N/A
70N/A# for now, the assumption is we build any directory with a Makefile. This may
851N/A# not always be the case. If we build a new make-like tool to drive the upper
851N/A# level build, it may make different decisions and will need to include
851N/A# appropriate dependency information.
851N/A
851N/A# components.mk is auto-generated by the build tools. It populates the
98N/A# COMPONENT_DIRS macro with a list of all directories in the workspace that
551N/A# contain a component.
321N/Acomponents.mk: # Makefile # $(WS_TOP)/components
321N/A @echo "Generating component list..."
550N/A @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
550N/A | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
213N/A
649N/A-include components.mk
304N/A
530N/A# depends.mk is auto-generated by concatenating 'depend.mk' files in each
425N/A# component directory.
425N/Adepends.mk: components.mk
325N/A @echo "Generating component dependencies..."
493N/A @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
536N/A | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
456N/A 2>/dev/null
320N/A
332N/A-include depends.mk
501N/A
231N/A
550N/Adownload: TARGET = download
347N/Aprep: TARGET = prep
532N/Abuild: TARGET = build
463N/Ainstall: TARGET = install
493N/Apublish: TARGET = publish
425N/Aclean: TARGET = clean
493N/Aclobber: TARGET = clobber
791N/Atest: TARGET = test
472N/Aprep build install publish test: TEMPLATE_ZONE=$(ZONE)
324N/Aprep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
347N/A
310N/A# turn off pkglint for the individual component builds.
316N/Apublish: MAKEFLAGS += PKGLINT=/bin/true
474N/A
290N/A.DEFAULT: publish
332N/A
464N/Abuild install publish test: $(COMPONENT_DIRS)
332N/A
509N/ACOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
835N/A
835N/Adownload prep: $(COMPONENT_DIRS.nosetup)
332N/A
210N/Aclean: $(COMPONENT_DIRS.nosetup)
493N/A $(RM) components.mk depends.mk .profile
792N/A
128N/Aclobber: $(COMPONENT_DIRS.nosetup) clean
414N/A $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
484N/A
326N/Asetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
493N/A
335N/A$(WS_LOGS):
493N/A $(MKDIR) $@
493N/A
729N/A$(WS_REPO):
425N/A $(PKGREPO) create $(PKG_REPO)
370N/A $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
70N/A
400N/A$(WS_LINT_CACHE): $(WS_LOGS)
294N/Aifdef CANONICAL_REPO
435N/A @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
800N/A @(echo "set name=fmri value=pkg:/dummy" | $(PKGLINT) \
98N/A -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
434N/A >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
505N/Aelse
277N/A $(MKDIR) $(WS_LINT_CACHE)
433N/Aendif
546N/A
356N/Atools:
289N/A @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
326N/A
439N/A# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
469N/A# to pass a few things on to zone based builds
290N/A.profile:
542N/A echo "PATH=$(PATH)" >>$@
424N/A echo "WS_TOP=$(WS_TOP)" >>$@
286N/A echo "export PATH WS_TOP" >>$@
475N/A
295N/A$(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
70N/A @cd $@ && echo "$(TARGET) $@" && \
299N/A $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
262N/A $(@:%=--component %) --make $(TARGET) $(LOG)
539N/A
277N/Apublish:
332N/A $(PKGREPO) rebuild -s $(PKG_REPO)
332N/A# pkglint all of the published manifests in one batch.
493N/Aifdef CANONICAL_REPO
70N/A @echo 'pkglinting all package manifests...'
70N/A @$(ENV) PYTHONPATH=$(WS_TOOLS)/python $(PKGLINT) \
319N/A -c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
280N/A $(shell find . -name 'manifest-*.published')
319N/Aendif
70N/A
1117N/A$(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
1470N/A @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
1117N/A $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
98N/A $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
1376N/A
1376N/AFORCE:
98N/A