• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2#    Copyright 2015-2016 Nest Labs Inc. All Rights Reserved.
3#
4#    Licensed under the Apache License, Version 2.0 (the "License");
5#    you may not use this file except in compliance with the License.
6#    You may obtain a copy of the License at
7#
8#    http://www.apache.org/licenses/LICENSE-2.0
9#
10#    Unless required by applicable law or agreed to in writing, software
11#    distributed under the License is distributed on an "AS IS" BASIS,
12#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#    See the License for the specific language governing permissions and
14#    limitations under the License.
15#
16
17#
18#    Description:
19#      This file defines automake variables and macros common to all
20#      other automake headers and files for invoking make in a list
21#      of subdirectories with a list of target goals.
22#
23
24#
25# nl-make-subdirs-with-dirs-and-goals <subdirectories> <goals>
26#
27# This iteratively invokes make with the provided target goals in each
28# subdirectory specified.
29#
30#   subdirectories  A space-delimited list of subdirectories in which to
31#                   invoke make with the provided target goals.
32#
33#   goals           A space-delimited list of target goals to
34#                   attempt to make in each specified subdirectory.
35#
36define nl-make-subdirs-with-dirs-and-goals
37+$(AM_V_at)for subdir in $(1); do \
38    echo "Making $(2) in $${subdir}"; \
39    $(MAKE) -C "$${subdir}" $(AM_MAKEFLAGS) $(2) \
40    || exit 1; \
41done
42endef # nl-make-subdirs-with-dirs-and-goals
43
44#
45# nl-make-subdirs-with-dirs <subdirectories>
46#
47# This iteratively invokes make with the target goals defined in
48# MAKECMDGOALS in each subdirectory specified.
49#
50#   subdirectories  A space-delimited list of subdirectories in which to
51#                   invoke make with the provided target goals.
52#
53define nl-make-subdirs-with-dirs
54$(call nl-make-subdirs-with-dirs-and-goals,$(1),$(MAKECMDGOALS))
55endef # nl-make-subdirs-with-dirs
56
57#
58# nl-make-subdirs-with-goals <goals>
59#
60# This iteratively invokes make with the provided target goals in the
61# subdirectories defined in SUBDIRS.
62#
63#   goals           A space-delimited list of target goals to
64#                   attempt to make in SUBDIRS.
65#
66define nl-make-subdirs-with-goals
67$(call nl-make-subdirs-with-dirs-and-goals,$(SUBDIRS),$(1))
68endef # nl-make-subdirs-with-goals
69
70#
71# nl-make-subdirs
72#
73# This iteratively invokes make with the target goals defined in
74# MAKECMDGOALS in the subdirectories defined in SUBDIRS.
75#
76define nl-make-subdirs
77$(call nl-make-subdirs-with-dirs-and-goals,$(SUBDIRS),$(MAKECMDGOALS))
78endef # nl-make-subdirs
79