OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # | 5 # |
6 # GNU Make based build file. For details on GNU Make see: | 6 # GNU Make based build file. For details on GNU Make see: |
7 # http://www.gnu.org/software/make/manual/make.html | 7 # http://www.gnu.org/software/make/manual/make.html |
8 # | 8 # |
9 | 9 |
10 PROJECTS := \ | 10 PROJECTS := \ |
11 [[for project in projects:]] | 11 [[for project in projects:]] |
12 {{project}} \ | 12 {{project}} \ |
13 [[]] | 13 [[]] |
14 | 14 |
15 [[for dep in deps:]] | |
16 {{dep}} | |
binji
2014/04/28 21:01:22
Can you give an example of what this will generate
noelallen1
2014/04/28 23:00:33
Done.
| |
17 [[]] | |
18 | |
15 HTTPD_PY := python {{rel_sdk}}/tools/httpd.py | 19 HTTPD_PY := python {{rel_sdk}}/tools/httpd.py |
16 | 20 |
17 ifeq ($(TOOLCHAIN),all) | 21 ifeq ($(TOOLCHAIN),all) |
18 TOOLCHAIN_ARG:=TOOLCHAIN=all | 22 TOOLCHAIN_ARG:=TOOLCHAIN=all |
19 endif | 23 endif |
20 | 24 |
21 # Define the default target | 25 # Define the default target |
22 all: | 26 all: |
23 | 27 |
24 # | 28 # |
25 # Target Macro | 29 # Target Macro |
26 # | 30 # |
27 # Macro defines a phony target for each example, and adds it to a list of | 31 # Macro defines a phony target for each example, and adds it to a list of |
28 # targets. | 32 # targets. |
29 # | 33 # |
30 # Note: We use targets for each project (instead of an explicit recipe) so | 34 # Note: We use targets for each project (instead of an explicit recipe) so |
31 # each project can be built in parallel. | 35 # each project can be built in parallel. |
32 # | 36 # |
33 define TARGET | 37 define TARGET |
34 ALL_TARGET_LIST+=$(1)_ALL_TARGET | 38 ALL_TARGET_LIST+=$(1)_ALL_TARGET |
35 .PHONY: $(1)_ALL_TARGET | 39 .PHONY: $(1)_ALL_TARGET |
36 $(1)_ALL_TARGET: | 40 $(1)_ALL_TARGET: $$($(1)_DEPS) |
37 +$(MAKE) -C $(1) $(TOOLCHAIN_ARG) all | 41 +$(MAKE) -C $(1) $(TOOLCHAIN_ARG) all |
38 | 42 |
39 CLEAN_TARGET_LIST+=$(1)_CLEAN_TARGET | 43 CLEAN_TARGET_LIST+=$(1)_CLEAN_TARGET |
40 .PHONY: $(1)_CLEAN_TARGET | 44 .PHONY: $(1)_CLEAN_TARGET |
41 $(1)_CLEAN_TARGET: | 45 $(1)_CLEAN_TARGET: |
42 +$(MAKE) -C $(1) $(TOOLCHAIN_ARG) clean | 46 +$(MAKE) -C $(1) $(TOOLCHAIN_ARG) clean |
43 endef | 47 endef |
44 | 48 |
45 | 49 |
46 # Define the various targets via the Macro | 50 # Define the various targets via the Macro |
(...skipping 13 matching lines...) Expand all Loading... | |
60 @$(HTTPD_PY) | 64 @$(HTTPD_PY) |
61 | 65 |
62 # Phony aliases for backward compatibility | 66 # Phony aliases for backward compatibility |
63 RUN: run | 67 RUN: run |
64 run: serve | 68 run: serve |
65 | 69 |
66 all_versions: | 70 all_versions: |
67 +$(MAKE) TOOLCHAIN=all | 71 +$(MAKE) TOOLCHAIN=all |
68 | 72 |
69 .PHONY: RUN all_versions | 73 .PHONY: RUN all_versions |
OLD | NEW |