Makefile revision 70
409N/A#
290N/A# CDDL HEADER START
290N/A#
290N/A# The contents of this file are subject to the terms of the
290N/A# Common Development and Distribution License (the "License").
290N/A# You may not use this file except in compliance with the License.
290N/A#
290N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
290N/A# or http://www.opensolaris.org/os/licensing.
290N/A# See the License for the specific language governing permissions
290N/A# and limitations under the License.
290N/A#
290N/A# When distributing Covered Code, include this CDDL HEADER in each
290N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
290N/A# If applicable, add the following below this CDDL HEADER, with the
290N/A# fields enclosed by brackets "[]" replaced with your own identifying
290N/A# information: Portions Copyright [yyyy] [name of copyright owner]
290N/A#
290N/A# CDDL HEADER END
290N/A#
290N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
395N/A#
395N/A
395N/Ainclude ../make-rules/shared-macros.mk
290N/A
454N/A# for now, the assumption is we build any directory with a Makefile. This may
290N/A# not always be the case. If we build a new make-like tool to drive the upper
448N/A# level build, it may make different decisions and will need to include
290N/A# appropriate dependency information.
290N/A
290N/A# components.mk is auto-generated by the build tools. It populates the
383N/A# COMPONENT_DIRS macro with a list of all directories in the workspace that
290N/A# contain a component.
395N/Acomponents.mk: # Makefile # $(WS_TOP)/components
290N/A @echo "Generating component list..."
395N/A @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
290N/A | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
290N/A
290N/A-include components.mk
290N/A
290N/A
383N/Adownload: TARGET = download
290N/Aprep: TARGET = prep
290N/Abuild: TARGET = build
290N/Ainstall: TARGET = install
290N/Apublish: TARGET = publish
290N/Ainstall-packages: TARGET = install-packages
290N/Avalidate: TARGET = validate
290N/Aclean: TARGET = clean
290N/Aclobber: TARGET = clobber
465N/Aprep build install publish: TEMPLATE_ZONE=$(ZONE)
465N/Aprep build install publish: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
465N/A
465N/A.DEFAULT: publish
465N/A
465N/Adownload prep build install publish install-packages validate: $(COMPONENT_DIRS)
465N/A
465N/ACOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
465N/A
465N/Aclean: $(COMPONENT_DIRS:%=%.nosetup)
465N/A $(RM) components.mk depends.mk .profile
465N/A
465N/Aclobber: $(COMPONENT_DIRS:%=%.nosetup) clean
465N/A $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
465N/A
708N/Asetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
708N/A
708N/A$(WS_LOGS):
708N/A $(MKDIR) $@
708N/A
708N/A$(WS_REPO):
708N/A $(PKGSEND) -s $(PKG_REPO) create-repository \
290N/A --set-property publisher.prefix=$(PUBLISHER)
290N/A
290N/A$(WS_LINT_CACHE): $(WS_LOGS)
395N/Aifdef CANONICAL_REPO
395N/A @echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
290N/A @(echo "set name=fmri value=pkg:/dummy" | $(PKGLINT) \
395N/A -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
395N/A >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 ; exit 0)
290N/Aelse
395N/A $(MKDIR) $(WS_LINT_CACHE)
395N/Aendif
290N/A
395N/Atools:
395N/A @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
290N/A
448N/A# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
448N/A# to pass a few things on to zone based builds
534N/A.profile:
534N/A echo "PATH=$(PATH)" >>$@
534N/A echo "WS_TOP=$(WS_TOP)" >>$@
534N/A echo "export PATH WS_TOP" >>$@
534N/A
534N/A$(COMPONENT_DIRS): setup FORCE
534N/A @cd $@ && echo "$(TARGET) $@" && \
290N/A $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
290N/A $(@:%=--component %) --make $(TARGET) $(LOG)
290N/A
534N/A$(COMPONENT_DIRS.nosetup): FORCE
290N/A @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
290N/A $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
290N/A $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
290N/A
290N/A# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
661N/Adepends.mk: components.mk
290N/A @echo "Generating component dependencies..."
290N/A @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=depend \
290N/A | sed -e 's;$(shell pwd)/;;g' >$@
395N/A
290N/A-include depends.mk
290N/A
290N/AFORCE:
290N/A