Rewritten rule details; only execute rule when SUBPROJECTS is not empty;

added verbose commenting


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@14797 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-10-17 16:46:03 +00:00
parent 1d9fb1e4ee
commit 2b623481ce

View file

@ -3,10 +3,11 @@
#
# Master Makefile rules to build a set of GNUstep-base subprojects.
#
# Copyright (C) 1997 Free Software Foundation, Inc.
# Copyright (C) 1997-2002 Free Software Foundation, Inc.
#
# Author: Scott Christley <scottc@net-community.com>
# Author: Ovidiu Predescu <ovidiu@net-community.com>
# Author: Nicola Pero <n.pero@mi.flashnet.it>
#
# This file is part of the GNUstep Makefile Package.
#
@ -25,33 +26,48 @@ include $(GNUSTEP_MAKEFILES)/rules.make
endif
#
# The list of directory names with the subprojects is in the makefile
# variable SUBPROJECTS
# The list of aggregate project directory names is in the makefile
# variable SUBPROJECTS. The name is unforunate, because it is confusingly
# similar to xxx_SUBPROJECTS, which is used for subprojects.
#
# SUBPROJECTS - which is implemented in this file - are just a list of
# directories; we step in each directory in turn, and run a submake in
# there. The project types in the directories can be anything -
# tools, documentation, libraries, bundles, applications, whatever.
# For example, if your package is composed by a library and then by
# some tools using the library, you could have the library in one
# directory, the tools in another directory, and have a top level
# GNUmakefile which has the two as SUBPROJECTS.
#
# xxx_SUBPROJECTS - which is *not* implemented in this file, I'm just
# explaining it here to make clear the difference - are again a list
# of directories, each of which should contain a *subproject* project
# type (as implemented by subproject.make), which builds stuff into a
# .o file, which is then automatically linked into the xxx instance by
# gnustep-make when the top-level xxx is built. For example, a
# library might be broken into many separate subprojects, each of
# which implementing a logically separated part of the library; the
# top-level GNUmakefile will then build the library, specifying
# xxx_SUBPROJECTS for the library to be those directories.
# gnustep-make will step in all dirs, compile the subprojects, and
# then finally automatically link the subprojects into the main
# library.
SUBPROJECTS := $(strip $(SUBPROJECTS))
#
# Internal targets
#
ifneq ($(SUBPROJECTS),)
internal-all internal-install internal-uninstall internal-clean \
internal-distclean internal-check::
@ target=$(subst internal-,,$@); \
for f in $(SUBPROJECTS) __done; do \
if [ $$f != __done ]; then \
echo Making $$target in $$f...; \
mf=$(MAKEFILE_NAME); \
if [ ! -f "$$f/$$mf" -a -f "$$f/Makefile" ]; then \
mf=Makefile; \
echo "WARNING: No $(MAKEFILE_NAME) found for subproject $$f; using 'Makefile'"; \
fi; \
if $(MAKE) -C $$f -f $$mf --no-keep-going \
GNUSTEP_INSTALLATION_DIR="$(GNUSTEP_INSTALLATION_DIR)" \
$$target; then \
:; else exit $$?; \
fi; \
@ operation=$(subst internal-,,$@); \
for f in $(SUBPROJECTS); do \
echo "Making $$operation in $$f..."; \
mf=$(MAKEFILE_NAME); \
if [ ! -f "$$f/$$mf" -a -f "$$f/Makefile" ]; then \
mf=Makefile; \
echo "WARNING: No $(MAKEFILE_NAME) found for aggregate project $$f; using 'Makefile'"; \
fi; \
if $(MAKE) -C $$f -f $$mf --no-keep-going $$operation; then \
:; else exit $$?; \
fi; \
done
endif
## Local variables:
## mode: makefile
## End: