Makefile.subdirs revision 919
688N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
1370N/A# Makefile.subdirs has rules for recursively iterating through module subdirs
688N/A#
688N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
919N/A# Use is subject to license terms.
919N/A#
919N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
688N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
688N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1179N/A# DEALINGS IN THE SOFTWARE.
1370N/A#
1179N/A#
1179N/A
1064N/A# Need to set $MACH
688N/Ainclude $(TOP)/common/Makefile.init
688N/A
688N/AOS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
688N/A
1370N/A.DEFAULT:
688N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=$@
688N/A
688N/AWorld: clean all
688N/A
688N/Aclean: clean-subdirs clean-obsolete-subdirs
688N/A
1370N/Aclean-subdirs:
688N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean
688N/A
688N/Asubdirs: $(OS_SUBDIRS)
1370N/A
1370N/A$(OS_SUBDIRS): ALWAYS_RUN
1370N/A @case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
688N/A cd $@ ; \
1370N/A print "## making" $(OS_TARGET) "in open-src/$(DIRNAME)$@..."; \
1370N/A $(MAKE) $(MAKEFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" $(OS_TARGET)
688N/A
1370N/Aclean-obsolete-subdirs:
688N/A @ set +e; \
688N/A if [[ ! -z "$(OBSOLETE_SUBDIRS)" ]] ; then \
688N/A for i in $(OBSOLETE_SUBDIRS) ; do \
1370N/A if [[ -d $$i ]] ; then \
688N/A if [[ -f $$i/Makefile ]] ; then \
688N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean OS_SUBDIRS=$$i ; \
688N/A else ; \
688N/A print "## removing obsolete build directories in open-src/$(DIRNAME)$$i..."; \
688N/A ($(START_CMD_ECHO) ; \
688N/A cd $$i && rm -rf build_32 build_64 ) ; \
688N/A if [[ -d $$i/SCCS ]] ; then \
1370N/A ($(START_CMD_ECHO) ; rmdir $$i/SCCS) ; \
688N/A fi ; \
688N/A ($(START_CMD_ECHO) ; rmdir $$i ) ; \
688N/A fi ; \
688N/A fi ; \
688N/A done ; \
688N/A fi ; \
688N/A return 0
688N/A
688N/A# Dummy target to force another target to always be run, even if a file
688N/A# or directory with the same name already exists (as it will for subdirs)
688N/AALWAYS_RUN:
688N/A
1370N/A# Tell dmake it can build subdirs in parallel
688N/A.PARALLEL: $(OS_SUBDIRS)
688N/A