Makefile revision 3661
200N/A#
200N/A# CDDL HEADER START
200N/A#
200N/A# The contents of this file are subject to the terms of the
200N/A# Common Development and Distribution License (the "License").
200N/A# You may not use this file except in compliance with the License.
200N/A#
200N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
200N/A# or http://www.opensolaris.org/os/licensing.
200N/A# See the License for the specific language governing permissions
200N/A# and limitations under the License.
200N/A#
200N/A# When distributing Covered Code, include this CDDL HEADER in each
200N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
200N/A# If applicable, add the following below this CDDL HEADER, with the
200N/A# fields enclosed by brackets "[]" replaced with your own identifying
200N/A# information: Portions Copyright [yyyy] [name of copyright owner]
200N/A#
200N/A# CDDL HEADER END
200N/A#
200N/A# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
200N/A#
3661N/A
200N/Ainclude ../make-rules/shared-macros.mk
200N/A
200N/A# for now, the assumption is we build any directory with a Makefile. This may
200N/A# not always be the case. If we build a new make-like tool to drive the upper
814N/A# level build, it may make different decisions and will need to include
206N/A# appropriate dependency information.
200N/A
903N/A# components.mk is auto-generated by the build tools. It populates the
618N/A# COMPONENT_DIRS macro with a list of all directories in the workspace that
200N/A# contain a component.
200N/Acomponents.mk: # Makefile # $(WS_TOP)/components
844N/A @echo "Generating component list..."
903N/A @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
903N/A | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
1273N/A
200N/A-include components.mk
3661N/A
3661N/A# depends.mk is auto-generated by concatenating 'depend.mk' files in each
200N/A# component directory.
200N/Adepends.mk: components.mk
200N/A @echo "Generating component dependencies..."
200N/A @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
200N/A | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
200N/A 2>/dev/null
200N/A
200N/A-include depends.mk
200N/A
206N/A
200N/Adownload: TARGET = download
200N/Aprep: TARGET = prep
206N/Abuild: TARGET = build
206N/Ainstall: TARGET = install
206N/Apublish: TARGET = publish
206N/Aclean: TARGET = clean
206N/Aclobber: TARGET = clobber
200N/Atest: TARGET = test
206N/Acomponent-hook: TARGET = component-hook
200N/Aprep build install publish test: TEMPLATE_ZONE=$(ZONE)
200N/Aprep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
200N/A
206N/A# turn off pkglint for the individual component builds.
200N/Aifeq ($(strip $(PKGLINT_COMPONENT)),)
206N/Apublish: MAKEFLAGS += PKGLINT=/bin/true
206N/Aendif
206N/A
200N/A# In order to work around an IPS simultaneous publication issue and to improve
200N/A# top level build performance, we postpone catalog and index updates until the
200N/A# end of the build. Individual component builds postpone the updates until
200N/A# they have published all of their packages.
903N/Apublish: MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
200N/A
200N/A
200N/A.DEFAULT: publish
206N/A
200N/Abuild install publish test: $(COMPONENT_DIRS)
200N/A
200N/ACOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
200N/A
200N/Adownload prep: $(COMPONENT_DIRS.nosetup)
206N/A
200N/Acomponent-hook: $(COMPONENT_DIRS.nosetup)
200N/A
206N/Aclean: $(COMPONENT_DIRS.nosetup)
200N/A $(RM) components.mk depends.mk .profile
200N/A
200N/Aclobber: $(COMPONENT_DIRS.nosetup) clean
200N/A @cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
200N/A $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
200N/A
2127N/A
2127N/Asetup: $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
2127N/A
2127N/A$(WS_LOGS):
200N/A $(MKDIR) $@
200N/A
200N/A$(WS_REPO):
200N/A $(PKGREPO) create $(PKG_REPO)
200N/A $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
200N/A $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
200N/A
200N/ADUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
200N/ADUMMYPKG += "set pkg.summary=dummy\n"
200N/ADUMMYPKG += "set org.opensolaris.consolidation=userland\n"
200N/ADUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
200N/A
200N/A$(WS_LINT_CACHE): $(WS_LOGS) tools
206N/Aifdef CANONICAL_REPO
200N/A @echo "Generating pkglint(1) cache from CANONICAL_REPO $(CANONICAL_REPO)..."
200N/A @(echo $(DUMMYPKG) | $(PKGLINT) \
200N/A -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
206N/A >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 || \
206N/A ( echo "pkglint(1) failed, please see $(WS_LOGS)/naughty-canonical-repo-actions"; \
200N/A exit 1 ) \
200N/A )
200N/Aelse
200N/A $(MKDIR) $(WS_LINT_CACHE)
200N/Aendif
2107N/A
200N/Atools:
200N/A @cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
200N/A
200N/A# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
206N/A# to pass a few things on to zone based builds
200N/A.profile:
200N/A echo "PATH=$(PATH)" >>$@
200N/A echo "WS_TOP=$(WS_TOP)" >>$@
200N/A echo "export PATH WS_TOP" >>$@
200N/A
200N/A$(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
200N/A @cd $@ && echo "$(TARGET) $@" && \
$(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
$(@:%=--component %) --make $(TARGET) $(LOG)
# Turn userland-incorporator warnings into build failures
INCORPORATE_WERROR ?= --Werror
incorporation:
$(PKGREPO) refresh -s $(PKG_REPO)
$(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
--version=0.$(OS_VERSION),$(BUILD_VERSION) -p $(PUBLISHER) \
-c $(CONSOLIDATION) --destdir=$(WS_LOGS) $(INCORPORATE_WERROR)
for incorporation in $(WS_LOGS)/*.p5m ; do \
$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
$${incorporation} ; \
done
publish:
$(MAKE) incorporation
# pkglint all of the published manifests in one batch.
ifdef CANONICAL_REPO
@echo 'pkglinting all package manifests...'
@$(ENV) PYTHONPATH=$(WS_TOOLS)/python \
SOLARIS_VERSION=$(SOLARIS_VERSION) \
$(PKGLINT) \
-c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
$(shell find . -name 'manifest-*.published')
endif
$(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
@cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
$(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
$(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
FORCE: