components/Makefile
author Drew Fisher <drew.fisher@oracle.com>
Mon, 31 Mar 2014 16:44:02 -0700
branchs11-update
changeset 3028 5e73a3a3f66a
parent 2994 3705b92dce6a
child 3476 c35c8f1a6df1
permissions -rw-r--r--
PSARC/2013/350 OpenStack for Solaris (Umbrella) PSARC/2014/007 OpenStack client API components for Grizzly PSARC/2014/048 OpenStack Keystone (OpenStack Identity Service) PSARC/2014/049 OpenStack Nova (OpenStack Compute Service) PSARC/2014/054 OpenStack Cinder (OpenStack Block Storage Service) PSARC/2014/055 OpenStack Glance (OpenStack Image Service) PSARC/2014/058 OpenStack Horizon (OpenStack Dashboard) PSARC/2014/059 OpenStack Neutron (OpenStack Networking Service) 17531161 greenlet doesn't build with gcc 4.7.X 18143276 greenlet can crash with register window corruption on MP SPARC 18290089 integrate cinderclient 18290097 integrate glanceclient 18290102 integrate keystoneclient 18290109 integrate neutronclient 18290113 integrate novaclient 18290119 integrate swiftclient 18290125 integrate quantumclient 18307582 Request to integrate Cinder into userland 18307595 Request to integrate Glance into userland 18307626 Request to integrate Horizon into userland 18307641 Request to integrate Keystone into userland 18307650 Request to integrate Neutron into userland 18307659 Request to integrate Nova into userland 18321909 a few Python packages deliver both po and mo files 18362900 Dnsmasq's SMF method_credential is missing a privilege 18363793 Dnsmasq should use SIOCSXARP ioctl

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
#

include ../make-rules/shared-macros.mk

# for now, the assumption is we build any directory with a Makefile.  This may
# not always be the case. If we build a new make-like tool to drive the upper
# level build, it may make different decisions and will need to include
# appropriate dependency information.

# components.mk is auto-generated by the build tools.  It populates the
# COMPONENT_DIRS macro with a list of all directories in the workspace that
# contain a component.
components.mk:	# Makefile # $(WS_TOP)/components
	@echo "Generating component list..."
	@$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
		| sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@

-include components.mk

# depends.mk is auto-generated by concatenating 'depend.mk' files in each
# component directory.
depends.mk:     components.mk
	@echo "Generating component dependencies..."
	@cat $(shell $(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
		| sed -e 's;^$(shell pwd)/;;g' -e 's;$$;/depend.mk;g') >$@ \
		2>/dev/null
 
-include depends.mk


download:		TARGET = download
prep:			TARGET = prep
build:			TARGET = build
install:		TARGET = install
publish:		TARGET = publish
clean:			TARGET = clean
clobber:		TARGET = clobber
test:			TARGET = test
component-hook:		TARGET = component-hook
prep build install publish test:	TEMPLATE_ZONE=$(ZONE)
prep build install publish test:	LOG = >$(WS_LOGS)/$(@F).$(TARGET).log 2>&1

# turn off pkglint for the individual component builds.
ifeq   ($(strip $(PKGLINT_COMPONENT)),)
publish:		MAKEFLAGS += PKGLINT=/bin/true
endif

# In order to work around an IPS simultaneous publication issue and to improve
# top level build performance, we postpone catalog and index updates until the
# end of the build.  Individual component builds postpone the updates until
# they have published all of their packages.
publish:		MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes


.DEFAULT:	publish

build install publish test: $(COMPONENT_DIRS)

COMPONENT_DIRS.nosetup =	$(COMPONENT_DIRS:%=%.nosetup)

download prep:	$(COMPONENT_DIRS.nosetup)

component-hook:	$(COMPONENT_DIRS.nosetup)

clean:		$(COMPONENT_DIRS.nosetup)
	$(RM) components.mk depends.mk .profile

clobber:	$(COMPONENT_DIRS.nosetup) clean
	@cd ../tools ; echo "clobbering tools..." ; $(GMAKE) clobber
	$(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)


setup:	$(WS_LOGS) $(WS_REPO) tools $(WS_LINT_CACHE)

$(WS_LOGS):
	$(MKDIR) $@

$(WS_REPO):
	$(PKGREPO) create $(PKG_REPO)
	$(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER)
	$(PKGREPO) add-publisher -s $(PKG_REPO) $(PUBLISHER_LOCALIZABLE)

DUMMYPKG =  "set name=fmri value=pkg:/dummy@0,$(BUILD_VERSION)\n"
DUMMYPKG += "set pkg.summary=dummy\n"
DUMMYPKG += "set org.opensolaris.consolidation=userland\n"
DUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"

$(WS_LINT_CACHE):	$(WS_LOGS) tools
ifdef CANONICAL_REPO
	@echo "Generating pkglint(1) cache from CANONICAL_REPO $(CANONICAL_REPO)..."
	@(echo $(DUMMYPKG) | $(PKGLINT) \
		-c $(WS_LINT_CACHE) -r $(CANONICAL_REPO) /dev/fd/0 \
		>$(WS_LOGS)/naughty-canonical-repo-actions 2>&1 || \
		( echo "pkglint(1) failed, please see $(WS_LOGS)/naughty-canonical-repo-actions"; \
		  exit 1 ) \
	)
else
	$(MKDIR) $(WS_LINT_CACHE)
endif

tools:
	@cd ../tools ; echo "building tools..." ; $(GMAKE) clean setup

# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
# to pass a few things on to zone based builds
.profile:
	echo "PATH=$(PATH)" >>$@
	echo "WS_TOP=$(WS_TOP)" >>$@
	echo "export PATH WS_TOP" >>$@

$(COMPONENT_DIRS):	$(WS_LOGS) setup FORCE
	@cd $@ && echo "$(TARGET) $@" && \
	 $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
			 $(@:%=--component %) --make $(TARGET) $(LOG)

incorporation:
	$(PKGREPO) refresh -s $(PKG_REPO)
	$(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
	  -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \
	  -s "$(CONSOLIDATION) consolidation incorporation" \
	  -d "This incorporation constrains packages from the $(CONSOLIDATION) consolidation" \
	  -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
	  $(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m

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: