2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
7034N/A# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/Ainclude ../make-rules/shared-macros.mk
2N/A
23N/A# for now, the assumption is we build any directory with a Makefile. This may
23N/A# not always be the case. If we build a new make-like tool to drive the upper
23N/A# level build, it may make different decisions and will need to include
23N/A# appropriate dependency information.
23N/A
32N/A# components.mk is auto-generated by the build tools. It populates the
32N/A# COMPONENT_DIRS macro with a list of all directories in the workspace that
32N/A# contain a component.
3996N/A$(WS_MACH)/components.mk: $(WS_MACH) # Makefile # $(WS_TOP)/components
32N/A @echo "Generating component list..."
34N/A @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
32N/A | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
32N/A
3996N/A-include $(WS_MACH)/components.mk
32N/A
225N/A# depends.mk is auto-generated by concatenating 'depend.mk' files in each
225N/A# component directory.
3996N/A$(WS_MACH)/depends.mk: $(WS_MACH)/components.mk
225N/A @echo "Generating component dependencies..."
225N/A @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
225N/A | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
225N/A 2>/dev/null
225N/A
3996N/A-include $(WS_MACH)/depends.mk
225N/A
3996N/A#
3996N/A# Walk through all of the components echoing the REQUIRED_PACKAGES for each one.
3996N/A# Pass all output through sed to drop lines with whitespace between words,
3996N/A# remove whitespace from lines, drop empty lines, and REQUIRED_PACKAGES +=
3996N/A# to the lines. Pass that through sort -u
3996N/A#
3996N/A$(WS_MACH)/requires.mk: $(WS_MACH)
3996N/A @echo "Generating list of required packages to build consolidation..."
3996N/A @$(GMAKE) component-hook \
3996N/A COMPONENT_HOOK='@echo $$(REQUIRED_PACKAGES:%="%\\n")' | \
3996N/A $(GSED) -e '/\S\s\S/d' -e 's/^ //g' -e '/^\s*$$/d' \
3996N/A -e 's/^/REQUIRED_PACKAGES += /' | \
3996N/A sort -u >$(@)
3996N/A
3996N/Asystem-check:: $(WS_MACH)/requires.mk
3996N/A @$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-check
3996N/A
3996N/Asystem-prep:: $(WS_MACH)/requires.mk
3996N/A @echo "Installing any missing packages..."
3996N/A @$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-prep
2N/A
38N/Adownload: TARGET = download
38N/Aprep: TARGET = prep
38N/Abuild: TARGET = build
38N/Ainstall: TARGET = install
38N/Apublish: TARGET = publish
38N/Aclean: TARGET = clean
38N/Aclobber: TARGET = clobber
83N/Atest: TARGET = test
3996N/Azone-build: TARGET = component-zone-build
1273N/Acomponent-hook: TARGET = component-hook
3996N/Azone-build prep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
2N/A
92N/A# turn off pkglint for the individual component builds.
634N/Aifeq ($(strip $(PKGLINT_COMPONENT)),)
92N/Apublish: MAKEFLAGS += PKGLINT=/bin/true
634N/Aendif
92N/A
1900N/A# In order to work around an IPS simultaneous publication issue and to improve
1900N/A# top level build performance, we postpone catalog and index updates until the
1900N/A# end of the build. Individual component builds postpone the updates until
1900N/A# they have published all of their packages.
1900N/Apublish: MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
1900N/A
1900N/A
2N/A.DEFAULT: publish
2N/A
3996N/Azone-build build install publish test: $(COMPONENT_DIRS)
2N/A
34N/ACOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
2N/A
3996N/Adownload:: $(COMPONENT_DIRS.nosetup)
3996N/Aprep: $(COMPONENT_DIRS.nosetup)
3996N/Acomponent-environment-check:: $(COMPONENT_DIRS.nosetup)
1273N/Acomponent-hook: $(COMPONENT_DIRS.nosetup)
1273N/A
313N/Aclean: $(COMPONENT_DIRS.nosetup)
3996N/A $(RM) $(WS_MACH)/components.mk $(WS_MACH)/depends.mk \
3996N/A $(WS_MACH)/requires.mk $(WS_MACH)/*.p5m
2N/A
313N/Aclobber: $(COMPONENT_DIRS.nosetup) clean
814N/A @cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
3988N/A $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE) \
3988N/A $(shell find . -name 'manifest-*.published')
34N/A
814N/A
3996N/Asetup: $(WS_MACH) $(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)
2N/A
3996N/A$(WS_MACH) $(WS_LOGS):
2N/A $(MKDIR) $@
2N/A
70N/A$(WS_REPO):
105N/A $(PKGREPO) create $(PKG_REPO)
105N/A $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
883N/A $(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)
2N/A
634N/ADUMMYPKG = "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
634N/ADUMMYPKG += "set pkg.summary=dummy\n"
634N/ADUMMYPKG += "set org.opensolaris.consolidation=userland\n"
634N/ADUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
634N/A
2238N/A$(WS_LINT_CACHE): $(WS_LOGS) tools
70N/Aifdef CANONICAL_REPO
2290N/A @echo "Generating pkglint(1) cache from CANONICAL_REPO $(CANONICAL_REPO)..."
634N/A @(echo $(DUMMYPKG) | $(PKGLINT) \
70N/A -c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
2290N/A >$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 || \
2290N/A ( echo "pkglint(1) failed, please see $(WS_LOGS)/naughty-canonical-repo-actions"; \
2290N/A exit 1 ) \
2290N/A )
70N/Aelse
70N/A $(MKDIR) $(WS_LINT_CACHE)
70N/Aendif
70N/A
6N/Atools:
814N/A @cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup
6N/A
313N/A$(COMPONENT_DIRS): $(WS_LOGS) setup FORCE
38N/A @cd $@ && echo "$(TARGET) $@" && \
3996N/A $(BASS_O_MATIC) $(@:%=--component %) --make $(TARGET) $(LOG)
34N/A
3468N/A# Turn userland-incorporator warnings into build failures
3468N/AINCORPORATE_WERROR ?= --Werror
3468N/A
2238N/Aincorporation:
7034N/A $(WS_TOOLS)/userland-incorporator \
7034N/A --repository $(PKG_REPO) \
7034N/A --version 0.$(OS_VERSION),$(BUILD_VERSION) \
7034N/A --publisher $(PUBLISHER) \
7034N/A --consolidation $(CONSOLIDATION) \
7034N/A --destdir $(WS_MACH) \
7034N/A --static-content-file $(WS_COMPONENTS)/meta-packages/incorporation-cache \
7034N/A $(INCORPORATE_WERROR)
3996N/A for incorporation in $(WS_MACH)/*.p5m ; do \
3468N/A $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
3468N/A $${incorporation} ; \
3468N/A done
2238N/A
2238N/Apublish:
4561N/Aifneq ($(BUILD_TYPE), evaluation)
4561N/A # evaluation packages don't need to be incorporated
2238N/A $(MAKE) incorporation
4561N/Aendif
92N/A# pkglint all of the published manifests in one batch.
92N/Aifdef CANONICAL_REPO
92N/A @echo 'pkglinting all package manifests...'
2541N/A @$(ENV) PYTHONPATH=$(WS_TOOLS)/python \
2541N/A SOLARIS_VERSION=$(SOLARIS_VERSION) \
2541N/A $(PKGLINT) \
92N/A -c $(WS_LINT_CACHE) -f $(WS_TOOLS)/pkglintrc \
92N/A $(shell find . -name 'manifest-*.published')
92N/Aendif
92N/A
313N/A$(COMPONENT_DIRS.nosetup): $(WS_LOGS) FORCE
38N/A @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
3996N/A $(BASS_O_MATIC) $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
32N/A
2N/AFORCE: