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