c4c3694cb89992196efa0ed1f850a7d22149b4d1
[platform/upstream/automake.git] / lib / am / subdirs.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2013 Free Software Foundation, Inc.
3
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
8
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
13
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive
18 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
19   distclean-recursive maintainer-clean-recursive
20
21 am__recursive_targets = \
22   $(RECURSIVE_TARGETS) \
23   $(RECURSIVE_CLEAN_TARGETS) \
24   $(am__extra_recursive_targets)
25
26 ## All documented targets which invoke 'make' recursively, or depend
27 ## on targets that do so.  GNUmakefile from gnulib depends on this.
28 AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=)
29
30 .PHONY .MAKE: $(am__recursive_targets)
31
32 # This directory's subdirectories are mostly independent; you can cd
33 # into them and run 'make' without going through this Makefile.
34 # To change the values of 'make' variables: instead of editing Makefiles,
35 # (1) if the variable is set in 'config.status', edit 'config.status'
36 #     (which will cause the Makefiles to be regenerated when you run 'make');
37 # (2) otherwise, pass the desired values on the 'make' command line.
38
39 $(am__recursive_targets):
40 ## Using $failcom allows "-k" to keep its natural meaning when running a
41 ## recursive rule.
42         @fail= failcom='exit 1'; \
43         for f in x $$MAKEFLAGS; do \
44           case $$f in \
45             *=* | --[!k]*);; \
46             *k*) failcom='fail=yes';; \
47           esac; \
48         done; \
49         dot_seen=no; \
50         target=`echo $@ | sed s/-recursive//`; \
51 ## For distclean and maintainer-clean we make sure to use the full
52 ## list of subdirectories.  We do this so that 'configure; make
53 ## distclean' really is a no-op, even if SUBDIRS is conditional.
54         case "$@" in \
55           distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
56           *) list='$(SUBDIRS)' ;; \
57         esac; \
58         for subdir in $$list; do \
59           echo "Making $$target in $$subdir"; \
60           if test "$$subdir" = "."; then \
61             dot_seen=yes; \
62             local_target="$$target-am"; \
63           else \
64             local_target="$$target"; \
65           fi; \
66           ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
67           || eval $$failcom; \
68         done; \
69         if test "$$dot_seen" = "no"; then \
70           $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
71         fi; test -z "$$fail"
72
73 mostlyclean: mostlyclean-recursive
74 clean: clean-recursive
75 distclean: distclean-recursive
76 maintainer-clean: maintainer-clean-recursive
77