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

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

automake 1.8.5

File size: 3.7 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003
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., 59 Temple Place - Suite 330, Boston, MA
18## 02111-1307, USA.
19
20RECURSIVE_TARGETS += \
21all-recursive check-recursive installcheck-recursive
22
23.PHONY: $(RECURSIVE_TARGETS)
24
25# This directory's subdirectories are mostly independent; you can cd
26# into them and run `make' without going through this Makefile.
27# To change the values of `make' variables: instead of editing Makefiles,
28# (1) if the variable is set in `config.status', edit `config.status'
29# (which will cause the Makefiles to be regenerated when you run `make');
30# (2) otherwise, pass the desired values on the `make' command line.
31
32$(RECURSIVE_TARGETS):
33 @set fnord $$MAKEFLAGS; amf=$$2; \
34 dot_seen=no; \
35 target=`echo $@ | sed s/-recursive//`; \
36 list='$(SUBDIRS)'; for subdir in $$list; do \
37 echo "Making $$target in $$subdir"; \
38 if test "$$subdir" = "."; then \
39 dot_seen=yes; \
40 local_target="$$target-am"; \
41 else \
42 local_target="$$target"; \
43 fi; \
44 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
45## This trick allows "-k" to keep its natural meaning when running a
46## recursive rule.
47 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
48 done; \
49 if test "$$dot_seen" = "no"; then \
50 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
51 fi; test -z "$$fail"
52
53
54mostlyclean: mostlyclean-recursive
55clean: clean-recursive
56distclean: distclean-recursive
57maintainer-clean: maintainer-clean-recursive
58
59.PHONY: mostlyclean-recursive clean-recursive distclean-recursive \
60maintainer-clean-recursive
61
62## We run all `clean' targets in reverse order. Why? It's an attempt
63## to alleviate a problem that can happen when dependencies are
64## enabled. In this case, the .P file in one directory can depend on
65## some automatically generated header in an earlier directory. Since
66## the dependencies are required before any target is examined, make
67## bombs.
68mostlyclean-recursive clean-recursive distclean-recursive \
69maintainer-clean-recursive:
70 @set fnord $$MAKEFLAGS; amf=$$2; \
71 dot_seen=no; \
72## For distclean and maintainer-clean we make sure to use the full
73## list of subdirectories. We do this so that `configure; make
74## distclean' really is a no-op, even if SUBDIRS is conditional. For
75## other clean targets this doesn't matter.
76 case "$@" in \
77 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
78 *) list='$(SUBDIRS)' ;; \
79 esac; \
80 rev=''; for subdir in $$list; do \
81 if test "$$subdir" = "."; then :; else \
82 rev="$$subdir $$rev"; \
83 fi; \
84 done; \
85## Always do `.' last.
86 rev="$$rev ."; \
87 target=`echo $@ | sed s/-recursive//`; \
88 for subdir in $$rev; do \
89 echo "Making $$target in $$subdir"; \
90 if test "$$subdir" = "."; then \
91 local_target="$$target-am"; \
92 else \
93 local_target="$$target"; \
94 fi; \
95 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
96## This trick allows "-k" to keep its natural meaning when running a
97## recursive rule.
98 || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
99 done && test -z "$$fail"
Note: See TracBrowser for help on using the repository browser.