source: trunk/essentials/sys-devel/automake-1.10/lib/am/subdirs.am

Last change on this file was 3147, checked in by bird, 18 years ago

automake 1.10

File size: 3.9 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
3## Free Software Foundation, Inc.
4
5## This program is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 2, or (at your option)
8## any later version.
9
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
17## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18## 02110-1301, USA.
19
20RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive
21RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
22 distclean-recursive maintainer-clean-recursive
23
24.PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
25.MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
26
27# This directory's subdirectories are mostly independent; you can cd
28# into them and run `make' without going through this Makefile.
29# To change the values of `make' variables: instead of editing Makefiles,
30# (1) if the variable is set in `config.status', edit `config.status'
31# (which will cause the Makefiles to be regenerated when you run `make');
32# (2) otherwise, pass the desired values on the `make' command line.
33
34$(RECURSIVE_TARGETS):
35## Using $failcom allows "-k" to keep its natural meaning when running a
36## recursive rule.
37 @failcom='exit 1'; \
38 for f in x $$MAKEFLAGS; do \
39 case $$f in \
40 *=* | --[!k]*);; \
41 *k*) failcom='fail=yes';; \
42 esac; \
43 done; \
44 dot_seen=no; \
45 target=`echo $@ | sed s/-recursive//`; \
46 list='$(SUBDIRS)'; for subdir in $$list; do \
47 echo "Making $$target in $$subdir"; \
48 if test "$$subdir" = "."; then \
49 dot_seen=yes; \
50 local_target="$$target-am"; \
51 else \
52 local_target="$$target"; \
53 fi; \
54 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
55 || eval $$failcom; \
56 done; \
57 if test "$$dot_seen" = "no"; then \
58 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
59 fi; test -z "$$fail"
60
61
62mostlyclean: mostlyclean-recursive
63clean: clean-recursive
64distclean: distclean-recursive
65maintainer-clean: maintainer-clean-recursive
66
67## We run all `clean' targets in reverse order. Why? It's an attempt
68## to alleviate a problem that can happen when dependencies are
69## enabled. In this case, the .P file in one directory can depend on
70## some automatically generated header in an earlier directory. Since
71## the dependencies are required before any target is examined, make
72## bombs.
73$(RECURSIVE_CLEAN_TARGETS):
74## Using $failcom allows "-k" to keep its natural meaning when running a
75## recursive rule.
76 @failcom='exit 1'; \
77 for f in x $$MAKEFLAGS; do \
78 case $$f in \
79 *=* | --[!k]*);; \
80 *k*) failcom='fail=yes';; \
81 esac; \
82 done; \
83 dot_seen=no; \
84## For distclean and maintainer-clean we make sure to use the full
85## list of subdirectories. We do this so that `configure; make
86## distclean' really is a no-op, even if SUBDIRS is conditional. For
87## other clean targets this doesn't matter.
88 case "$@" in \
89 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
90 *) list='$(SUBDIRS)' ;; \
91 esac; \
92 rev=''; for subdir in $$list; do \
93 if test "$$subdir" = "."; then :; else \
94 rev="$$subdir $$rev"; \
95 fi; \
96 done; \
97## Always do `.' last.
98 rev="$$rev ."; \
99 target=`echo $@ | sed s/-recursive//`; \
100 for subdir in $$rev; do \
101 echo "Making $$target in $$subdir"; \
102 if test "$$subdir" = "."; then \
103 local_target="$$target-am"; \
104 else \
105 local_target="$$target"; \
106 fi; \
107 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
108 || eval $$failcom; \
109 done && test -z "$$fail"
Note: See TracBrowser for help on using the repository browser.