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