Makefile revision 32
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#
2N/A# Copyright (c) 2010, Oracle and/or it's 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.
32N/Acomponents.mk: Makefile # $(WS_TOP)/components
32N/A @echo "Generating component list..."
32N/A @$(TOOLS)/bass-o-matic.py --workspace=$(WS_TOP) --components=paths \
32N/A | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
32N/A
32N/Ainclude components.mk
32N/A
2N/A
2N/Adownload: TARGET = download
2N/Aprep: TARGET = prep
2N/Abuild: TARGET = build
2N/Ainstall: TARGET = install
2N/Apublish: TARGET = publish
2N/Avalidate: TARGET = validate
2N/Aclean: TARGET = clean
2N/Aclobber: TARGET = clobber
32N/Aprep build install publish: LOG = >$(WS_LOGS)/$(TARGET):$@.log 2>&1
2N/A
2N/A.DEFAULT: publish
2N/A
2N/A.PARALLEL: $(COMPONENT_DIRS)
2N/A
2N/Adownload prep build install publish validate: setup $(COMPONENT_DIRS)
2N/A
2N/Aclean clobber: $(COMPONENT_DIRS)
2N/Aifeq ($(findstring file://, $(PKG_REPO)),file://)
2N/A $(RM) -r $(PKG_REPO:file://%=%) $(WS_LOGS)
2N/Aendif
32N/A $(RM) components.mk depends.mk
2N/A
6N/Asetup: $(WS_LOGS) repo tools
2N/A
2N/A$(WS_LOGS):
2N/A $(MKDIR) $@
2N/A
2N/Arepo:
2N/A $(PKGSEND) -s $(PKG_REPO) create-repository \
2N/A --set-property publisher.prefix=$(PUBLISHER)
2N/A
6N/Atools:
6N/A @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
6N/A
32N/A$(COMPONENT_DIRS): setup FORCE
32N/A @cd $@ ; echo "$(TARGET) $@" ; $(GMAKE) $(TARGET) $(LOG)
32N/A
32N/A# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
32N/Adepends.mk: components.mk
32N/A @echo "Generating component dependencies..."
32N/A @$(TOOLS)/bass-o-matic.py --workspace=$(WS_TOP) --components=depend \
32N/A | sed -e 's;$(shell pwd)/;;g' >$@
32N/A
32N/Ainclude depends.mk
2N/A
2N/AFORCE: