Makefile revision 53
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# CDDL HEADER START
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# The contents of this file are subject to the terms of the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# Common Development and Distribution License (the "License").
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# You may not use this file except in compliance with the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# or http://www.opensolaris.org/os/licensing.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# See the License for the specific language governing permissions
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# and limitations under the License.
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# When distributing Covered Code, include this CDDL HEADER in each
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
09ab886382ad9e7149d9b72b4cf9a03ae4a1cddfDavid Lawrence# If applicable, add the following below this CDDL HEADER, with the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# fields enclosed by brackets "[]" replaced with your own identifying
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# information: Portions Copyright [yyyy] [name of copyright owner]
09ab886382ad9e7149d9b72b4cf9a03ae4a1cddfDavid Lawrence# CDDL HEADER END
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Copyright (c) 2010, Oracle and/or it's affiliates. All rights reserved.
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# for now, the assumption is we build any directory with a Makefile. This may
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# not always be the case. If we build a new make-like tool to drive the upper
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# level build, it may make different decisions and will need to include
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# appropriate dependency information.
e4757e3dafe50ae59f693eec828f68c42c197a70Andreas Gustafsson# components.mk is auto-generated by the build tools. It populates the
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington# COMPONENT_DIRS macro with a list of all directories in the workspace that
f9d068745ddfeb513db6184d9dddde835bed42d4Andreas Gustafsson# contain a component.
e4757e3dafe50ae59f693eec828f68c42c197a70Andreas Gustafssoncomponents.mk: # Makefile # $(WS_TOP)/components
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @echo "Generating component list..."
e4757e3dafe50ae59f693eec828f68c42c197a70Andreas Gustafsson @$(BASS_O_MATIC) --workspace=$(WS_TOP) --components=paths \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington | sed -e 's;^$(shell pwd)/;COMPONENT_DIRS += ;g' >$@
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafssoninstall-packages: TARGET = install-packages
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonprep build install publish: TEMPLATE_ZONE=$(ZONE)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellingtonprep build install publish: LOG = >$(WS_LOGS)/$@.$(TARGET).log 2>&1
09ab886382ad9e7149d9b72b4cf9a03ae4a1cddfDavid Lawrencedownload prep build install publish install-packages validate: $(COMPONENT_DIRS)
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian WellingtonCOMPONENT_DIRS.nosetup = $(COMPONENT_DIRS:%=%.nosetup)
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellingtonclobber: $(COMPONENT_DIRS:%=%.nosetup) clean
09ab886382ad9e7149d9b72b4cf9a03ae4a1cddfDavid Lawrence $(RM) -r $(WS_REPO) $(WS_LOGS) $(WS_LINT_CACHE)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson $(PKGSEND) -s $(PKG_REPO) create-repository \
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson --set-property publisher.prefix=$(PUBLISHER)
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson @cd ../tools ; echo "building tools..." ; $(GMAKE) setup
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# $(WS_COMPONENTS) is the home directory for the zone user, so create a profile
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson# to pass a few things on to zone based builds
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson echo "export PATH WS_TOP" >>$@
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(@:%=--component %) --make $(TARGET) $(LOG)
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington @cd $(@:%.nosetup=%) && echo "$(TARGET) $(@:%.nosetup=%)" && \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington $(@:%.nosetup=--component %) --make $(TARGET) $(LOG)
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# depends.mk is auto-generated by the build tools, bass-o-matic.py in particular
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington @echo "Generating component dependencies..."