Makefile revision 3953
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# CDDL HEADER START
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# The contents of this file are subject to the terms of the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# Common Development and Distribution License (the "License").
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# You may not use this file except in compliance with the License.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# or http://www.opensolaris.org/os/licensing.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# See the License for the specific language governing permissions
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# and limitations under the License.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# When distributing Covered Code, include this CDDL HEADER in each
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# If applicable, add the following below this CDDL HEADER, with the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# fields enclosed by brackets "[]" replaced with your own identifying
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# information: Portions Copyright [yyyy] [name of copyright owner]
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# CDDL HEADER END
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# for now, the assumption is we build any directory with a Makefile. This may
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# not always be the case. If we build a new make-like tool to drive the upper
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# level build, it may make different decisions and will need to include
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# appropriate dependency information.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# components.mk is auto-generated by the build tools. It populates the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# COMPONENT_DIRS macro with a list of all directories in the workspace that
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# contain a component.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore$(WS_MACH)/components.mk: $(WS_MACH) # Makefile # $(WS_TOP)/components
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @echo "Generating component list..."
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# depends.mk is auto-generated by concatenating 'depend.mk' files in each
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# component directory.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore$(WS_MACH)/depends.mk: $(WS_MACH)/components.mk
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @echo "Generating component dependencies..."
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore | sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# Walk through all of the components echoing the REQUIRED_PACKAGES for each one.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# Pass all output through sed to drop lines with whitespace between words,
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# remove whitespace from lines, drop empty lines, and REQUIRED_PACKAGES +=
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# to the lines. Pass that through sort -u
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @echo "Generating list of required packages to build consolidation..."
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore COMPONENT_HOOK='@echo $$(REQUIRED_PACKAGES:%="%\\n")' | \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore $(GSED) -e '/\S\s\S/d' -e 's/^ //g' -e '/^\s*$$/d' \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore -e 's/^/REQUIRED_PACKAGES += /' | \
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-check
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @echo "Installing any missing packages..."
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore @$(GMAKE) -f $(WS_MAKE_RULES)/environment.mk -f $< component-environment-prep
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amorezone-build prep build install publish test: LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# turn off pkglint for the individual component builds.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# In order to work around an IPS simultaneous publication issue and to improve
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# top level build performance, we postpone catalog and index updates until the
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# end of the build. Individual component builds postpone the updates until
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# they have published all of their packages.
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amorepublish: MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amore# For cases in which a component test should be skipped at at the top level
4bb7efa72ed531c10f097919636e67724ec4c25aGarrett D'Amorezone-build build install publish test: $(COMPONENT_DIRS)
$(MKDIR) $@
$(WS_REPO):
$${incorporation} ; \
$(PKGLINT) \