Install msysDTK-1.0.1
[msysgit.git] / share / automake-1.7 / am / subdirs.am
blob86098e1407a7fe720efe9af016fb4549a3f4ce4c
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 ## Free Software Foundation, Inc.
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.
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.
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.
20 RECURSIVE_TARGETS += \
21 all-recursive install-data-recursive install-exec-recursive \
22 installdirs-recursive install-recursive uninstall-recursive \
23 check-recursive installcheck-recursive
25 .PHONY: $(RECURSIVE_TARGETS)
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.
34 $(RECURSIVE_TARGETS):
35         @set fnord $$MAKEFLAGS; amf=$$2; \
36         dot_seen=no; \
37         target=`echo $@ | sed s/-recursive//`; \
38         list='$(SUBDIRS)'; for subdir in $$list; do \
39           echo "Making $$target in $$subdir"; \
40           if test "$$subdir" = "."; then \
41             dot_seen=yes; \
42             local_target="$$target-am"; \
43           else \
44             local_target="$$target"; \
45           fi; \
46           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
47 ## This trick allows "-k" to keep its natural meaning when running a
48 ## recursive rule.
49            || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
50         done; \
51         if test "$$dot_seen" = "no"; then \
52           $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
53         fi; test -z "$$fail"
56 mostlyclean: mostlyclean-recursive
57 clean: clean-recursive
58 distclean: distclean-recursive
59 maintainer-clean: maintainer-clean-recursive
61 .PHONY: mostlyclean-recursive clean-recursive distclean-recursive \
62 maintainer-clean-recursive
64 ## We run all `clean' targets in reverse order.  Why?  It's an attempt
65 ## to alleviate a problem that can happen when dependencies are
66 ## enabled.  In this case, the .P file in one directory can depend on
67 ## some automatically generated header in an earlier directory.  Since
68 ## the dependencies are required before any target is examined, make
69 ## bombs.
70 mostlyclean-recursive clean-recursive distclean-recursive \
71 maintainer-clean-recursive:
72         @set fnord $$MAKEFLAGS; amf=$$2; \
73         dot_seen=no; \
74 ## For distclean and maintainer-clean we make sure to use the full
75 ## list of subdirectories.  We do this so that `configure; make
76 ## distclean' really is a no-op, even if SUBDIRS is conditional.  For
77 ## other clean targets this doesn't matter.
78         case "$@" in \
79           distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
80           *) list='$(SUBDIRS)' ;; \
81         esac; \
82         rev=''; for subdir in $$list; do \
83           if test "$$subdir" = "."; then :; else \
84             rev="$$subdir $$rev"; \
85           fi; \
86         done; \
87 ## Always do `.' last.
88         rev="$$rev ."; \
89         target=`echo $@ | sed s/-recursive//`; \
90         for subdir in $$rev; do \
91           echo "Making $$target in $$subdir"; \
92           if test "$$subdir" = "."; then \
93             local_target="$$target-am"; \
94           else \
95             local_target="$$target"; \
96           fi; \
97           (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
98 ## This trick allows "-k" to keep its natural meaning when running a
99 ## recursive rule.
100            || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
101         done && test -z "$$fail"