]> err.no Git - sope/blob - gnustep-make/Master/aggregate.make
gnu runtime bugfix
[sope] / gnustep-make / Master / aggregate.make
1 #
2 #   aggregate.make
3 #
4 #   Master Makefile rules to build a set of GNUstep-base subprojects.
5 #
6 #   Copyright (C) 1997-2002 Free Software Foundation, Inc.
7 #
8 #   Author:  Scott Christley <scottc@net-community.com>
9 #   Author:  Ovidiu Predescu <ovidiu@net-community.com>
10 #   Author:  Nicola Pero <n.pero@mi.flashnet.it>
11 #
12 #   This file is part of the GNUstep Makefile Package.
13 #
14 #   This library is free software; you can redistribute it and/or
15 #   modify it under the terms of the GNU General Public License
16 #   as published by the Free Software Foundation; either version 2
17 #   of the License, or (at your option) any later version.
18 #   
19 #   You should have received a copy of the GNU General Public
20 #   License along with this library; see the file COPYING.LIB.
21 #   If not, write to the Free Software Foundation,
22 #   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
24 ifeq ($(RULES_MAKE_LOADED),)
25 include $(GNUSTEP_MAKEFILES)/rules.make
26 endif
27
28 #
29 # The list of aggregate project directory names is in the makefile
30 # variable SUBPROJECTS.  The name is unforunate, because it is confusingly
31 # similar to xxx_SUBPROJECTS, which is used for subprojects.
32 #
33 # SUBPROJECTS - which is implemented in this file - are just a list of
34 # directories; we step in each directory in turn, and run a submake in
35 # there.  The project types in the directories can be anything -
36 # tools, documentation, libraries, bundles, applications, whatever.
37 # For example, if your package is composed by a library and then by
38 # some tools using the library, you could have the library in one
39 # directory, the tools in another directory, and have a top level
40 # GNUmakefile which has the two as SUBPROJECTS.
41 #
42 # xxx_SUBPROJECTS - which is *not* implemented in this file, I'm just
43 # explaining it here to make clear the difference - are again a list
44 # of directories, each of which should contain a *subproject* project
45 # type (as implemented by subproject.make), which builds stuff into a
46 # .o file, which is then automatically linked into the xxx instance by
47 # gnustep-make when the top-level xxx is built.  For example, a
48 # library might be broken into many separate subprojects, each of
49 # which implementing a logically separated part of the library; the
50 # top-level GNUmakefile will then build the library, specifying
51 # xxx_SUBPROJECTS for the library to be those directories.
52 # gnustep-make will step in all dirs, compile the subprojects, and
53 # then finally automatically link the subprojects into the main
54 # library.
55 SUBPROJECTS := $(strip $(SUBPROJECTS))
56
57 ifneq ($(SUBPROJECTS),)
58 internal-all internal-install internal-uninstall internal-clean \
59   internal-distclean internal-check internal-strings::
60         @ operation=$(subst internal-,,$@); \
61           abs_build_dir="$(ABS_GNUSTEP_BUILD_DIR)"; \
62         for f in $(SUBPROJECTS); do \
63           echo "Making $$operation in $$f..."; \
64           mf=$(MAKEFILE_NAME); \
65           if [ ! -f "$$f/$$mf" -a -f "$$f/Makefile" ]; then \
66             mf=Makefile; \
67             echo "WARNING: No $(MAKEFILE_NAME) found for aggregate project $$f; using 'Makefile'"; \
68           fi; \
69           if [ "$${abs_build_dir}" = "." ]; then \
70             gsbuild="."; \
71           else \
72             gsbuild="$${abs_build_dir}/$$f"; \
73           fi; \
74           if $(MAKE) -C $$f -f $$mf --no-keep-going $$operation \
75                GNUSTEP_BUILD_DIR="$$gsbuild"; then \
76             :; else exit $$?; \
77           fi; \
78         done
79 endif
80