Makefile.subdirs revision 943
493N/A# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
493N/A# Makefile.subdirs has rules for recursively iterating through module subdirs
493N/A#
943N/A# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
493N/A#
493N/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
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
493N/A#
493N/A#
493N/A
493N/A# Need to set $MACH
493N/Ainclude $(TOP)/common/Makefile.init
493N/A
493N/AOS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
493N/A
705N/A.DEFAULT:
705N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=$@
493N/A
493N/AWorld: clean all
493N/A
851N/Aclean: clean-subdirs clean-obsolete-subdirs
851N/A
851N/Aclean-subdirs:
606N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean
493N/A
810N/Asubdirs: $(OS_SUBDIRS)
810N/A
810N/A$(OS_SUBDIRS): ALWAYS_RUN
606N/A @case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
810N/A cd $@ ; \
810N/A print "## making" $(OS_TARGET) "in open-src/$(DIRNAME)$@..."; \
810N/A $(MAKE) $(MAKEFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" $(OS_TARGET)
606N/A
606N/Aclean-obsolete-subdirs:
851N/A @ set +e; \
606N/A if [[ ! -z "$(OBSOLETE_SUBDIRS)" ]] ; then \
606N/A for i in $(OBSOLETE_SUBDIRS) ; do \
606N/A if [[ -d $$i ]] ; then \
606N/A if [[ -f $$i/Makefile ]] ; then \
606N/A $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean OS_SUBDIRS=$$i ; \
606N/A else ; \
606N/A print "## removing obsolete build directories in open-src/$(DIRNAME)$$i..."; \
922N/A ($(START_CMD_ECHO) ; cd $$i && rm -rf build* ) ; \
851N/A ($(START_CMD_ECHO) ; rmdir $$i ) ; \
606N/A fi ; \
606N/A fi ; \
606N/A done ; \
606N/A fi ; \
606N/A return 0
810N/A
810N/A# Dummy target to force another target to always be run, even if a file
810N/A# or directory with the same name already exists (as it will for subdirs)
810N/AALWAYS_RUN:
810N/A
810N/A# Tell dmake it can build subdirs in parallel
810N/A.PARALLEL: $(OS_SUBDIRS)