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