Makefile.subdirs revision 851
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# -*- Makefile -*- rules commonly shared among X consolidation open source dirs
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Makefile.subdirs has rules for recursively iterating through module subdirs
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Use is subject to license terms.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Permission is hereby granted, free of charge, to any person obtaining a
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# copy of this software and associated documentation files (the
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# "Software"), to deal in the Software without restriction, including
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# without limitation the rights to use, copy, modify, merge, publish,
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# distribute, and/or sell copies of the Software, and to permit persons
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# to whom the Software is furnished to do so, provided that the above
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# copyright notice(s) and this permission notice appear in all copies of
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# the Software and that both the above copyright notice(s) and this
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# permission notice appear in supporting documentation.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
99d5e173470cf967aa87653364ed614299e7b511Tim Haley# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
ad135b5d644628e791c3188a6ecbd9c257961ef8Christopher Siden# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Except as contained in this notice, the name of a copyright holder
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# shall not be used in advertising or otherwise to promote the sale, use
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# or other dealings in this Software without prior written authorization
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# of the copyright holder.
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# ident "@(#)Makefile.subdirs 1.5 09/12/05 SMI"
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Need to set $MACH
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksOS_SUBDIRS=$(OS_SUBDIRS_$(MACH))
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=$@
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksWorld: clean all
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksclean: clean-subdirs clean-obsolete-subdirs
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarksclean-subdirs:
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarkssubdirs: $(OS_SUBDIRS)
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks$(OS_SUBDIRS): ALWAYS_RUN
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks @case '${MAKEFLAGS}' in *[ik]*) set +e;; esac; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks print "## making" $(OS_TARGET) "in open-src/$(DIRNAME)$@..."; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks $(MAKE) $(MAKEFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" $(OS_TARGET)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwclean-obsolete-subdirs:
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks @ set +e; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks if [[ ! -z "$(OBSOLETE_SUBDIRS)" ]] ; then \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks for i in $(OBSOLETE_SUBDIRS) ; do \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks if [[ -d $$i ]] ; then \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks if [[ -f $$i/Makefile ]] ; then \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks $(MAKE) $(MAKEFLAGS) subdirs OS_TARGET=clean OS_SUBDIRS=$$i ; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks print "## removing obsolete build directories in open-src/$(DIRNAME)$$i..."; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks ($(START_CMD_ECHO) ; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks cd $$i && rm -rf build_32 build_64 ) ; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks if [[ -d $$i/SCCS ]] ; then \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks ($(START_CMD_ECHO) ; rmdir $$i/SCCS) ; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks ($(START_CMD_ECHO) ; rmdir $$i ) ; \
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Dummy target to force another target to always be run, even if a file
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# or directory with the same name already exists (as it will for subdirs)
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks# Tell dmake it can build subdirs in parallel
ecd6cf800b63704be73fb264c3f5b6e0dafc068dmarks.PARALLEL: $(OS_SUBDIRS)