OLD | NEW |
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 # GNU Makefile based on shared rules provided by the Native Client SDK. | 5 # GNU Makefile based on shared rules provided by the Native Client SDK. |
6 # See README.Makefiles for more details. | 6 # See README.Makefiles for more details. |
7 [[]] | 7 [[]] |
8 [[def ExpandDict(key, value_in, pre_list=[], post_list=[]):]] | 8 [[def ExpandDict(key, value_in, pre_list=[], post_list=[]):]] |
9 [[ value = value_in or [] ]] | 9 [[ value = value_in or [] ]] |
10 [[ pre = pre_list or [] ]] | 10 [[ pre = pre_list or [] ]] |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 [[ source_list = ' \\\n '.join(source_list)]] | 65 [[ source_list = ' \\\n '.join(source_list)]] |
66 [[ sources = target['NAME'] + '_SOURCES']] | 66 [[ sources = target['NAME'] + '_SOURCES']] |
67 [[ cflags = target['NAME'] + '_CFLAGS']] | 67 [[ cflags = target['NAME'] + '_CFLAGS']] |
68 [[ flags = target.get('CFLAGS', [])]] | 68 [[ flags = target.get('CFLAGS', [])]] |
69 [[ flags.extend(target.get('CXXFLAGS', []))]] | 69 [[ flags.extend(target.get('CXXFLAGS', []))]] |
70 [[ if len(targets) == 1:]] | 70 [[ if len(targets) == 1:]] |
71 [[ sources = 'SOURCES']] | 71 [[ sources = 'SOURCES']] |
72 [[ cflags = 'CFLAGS']] | 72 [[ cflags = 'CFLAGS']] |
73 [[ ]] | 73 [[ ]] |
74 [[ ExpandDict(cflags, flags)]] | 74 [[ ExpandDict(cflags, flags)]] |
| 75 [[ for define in target.get('DEFINES', []):]] |
| 76 {{cflags}} += -D{{define}} |
| 77 [[ ]] |
75 [[ if 'CFLAGS_GCC' in target:]] | 78 [[ if 'CFLAGS_GCC' in target:]] |
76 ifneq ($(TOOLCHAIN),pnacl) | 79 ifneq ($(TOOLCHAIN),pnacl) |
77 {{cflags}} += {{' '.join(target['CFLAGS_GCC'])}} | 80 {{cflags}} += {{' '.join(target['CFLAGS_GCC'])}} |
78 endif | 81 endif |
79 [[ ]] | 82 [[ ]] |
| 83 [[]] |
80 {{sources}} = {{source_list}} | 84 {{sources}} = {{source_list}} |
81 | 85 |
| 86 |
82 # Build rules generated by macros from common.mk: | 87 # Build rules generated by macros from common.mk: |
83 | 88 |
84 [[if targets[0].get('DEPS'):]] | 89 [[if targets[0].get('DEPS'):]] |
85 $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep)))) | 90 $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep)))) |
86 [[if len(targets) > 1:]] | 91 [[if len(targets) > 1:]] |
87 [[ for target in targets:]] | 92 [[ for target in targets:]] |
88 [[ name = target['NAME'] ]] | 93 [[ name = target['NAME'] ]] |
89 $(foreach src,$({{name}}_SOURCES),$(eval $(call COMPILE_RULE,$(src),$({{name}}_C
FLAGS)))) | 94 $(foreach src,$({{name}}_SOURCES),$(eval $(call COMPILE_RULE,$(src),$({{name}}_C
FLAGS)))) |
90 [[else:]] | 95 [[else:]] |
91 $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) | 96 $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) |
(...skipping 14 matching lines...) Expand all Loading... |
106 # On NaCl, only produce a stripped binary for Release configs (not Debug). | 111 # On NaCl, only produce a stripped binary for Release configs (not Debug). |
107 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) | 112 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) |
108 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) | 113 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) |
109 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) | 114 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) |
110 else | 115 else |
111 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) | 116 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) |
112 endif | 117 endif |
113 [[]] | 118 [[]] |
114 | 119 |
115 $(eval $(call NMF_RULE,$(TARGET),)){{post}} | 120 $(eval $(call NMF_RULE,$(TARGET),)){{post}} |
OLD | NEW |