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 29 matching lines...) Expand all Loading... |
40 MULTI_PLATFORM = 1 | 40 MULTI_PLATFORM = 1 |
41 [[]] | 41 [[]] |
42 | 42 |
43 include $(NACL_SDK_ROOT)/tools/common.mk | 43 include $(NACL_SDK_ROOT)/tools/common.mk |
44 | 44 |
45 [[if desc.get('SOCKET_PERMISSIONS'):]] | 45 [[if desc.get('SOCKET_PERMISSIONS'):]] |
46 CHROME_ARGS += --allow-nacl-socket-api=localhost | 46 CHROME_ARGS += --allow-nacl-socket-api=localhost |
47 [[]] | 47 [[]] |
48 | 48 |
49 TARGET = {{targets[0]['NAME']}} | 49 TARGET = {{targets[0]['NAME']}} |
50 [[if sel_ldr and targets[0].get('SEL_LDR_LIBS'):]] | 50 [[ExpandDict('DEPS', targets[0].get('DEPS', []))]] |
51 ifdef SEL_LDR | 51 [[ExpandDict('LIBS', targets[0].get('LIBS', []))]] |
52 [[ ExpandDict('DEPS', targets[0].get('SEL_LDR_DEPS', []))]] | |
53 [[ ExpandDict('LIBS', targets[0].get('SEL_LDR_LIBS', []))]] | |
54 else | |
55 [[ ExpandDict('DEPS', targets[0].get('DEPS', []))]] | |
56 [[ ExpandDict('LIBS', targets[0].get('LIBS', []))]] | |
57 endif | |
58 [[else:]] | |
59 [[ ExpandDict('DEPS', targets[0].get('DEPS', []))]] | |
60 [[ ExpandDict('LIBS', targets[0].get('LIBS', []))]] | |
61 [[]] | |
62 | 52 |
63 [[for target in targets:]] | 53 [[for target in targets:]] |
64 [[ source_list = (s for s in sorted(target['SOURCES']) if not s.endswith('.h'))
]] | 54 [[ source_list = (s for s in sorted(target['SOURCES']) if not s.endswith('.h'))
]] |
65 [[ source_list = ' \\\n '.join(source_list)]] | 55 [[ source_list = ' \\\n '.join(source_list)]] |
66 [[ sources = target['NAME'] + '_SOURCES']] | 56 [[ sources = target['NAME'] + '_SOURCES']] |
67 [[ cflags = target['NAME'] + '_CFLAGS']] | 57 [[ cflags = target['NAME'] + '_CFLAGS']] |
68 [[ flags = target.get('CFLAGS', [])]] | 58 [[ flags = target.get('CFLAGS', [])]] |
69 [[ flags.extend(target.get('CXXFLAGS', []))]] | 59 [[ flags.extend(target.get('CXXFLAGS', []))]] |
70 [[ if len(targets) == 1:]] | 60 [[ if len(targets) == 1:]] |
71 [[ sources = 'SOURCES']] | 61 [[ sources = 'SOURCES']] |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 # On NaCl, only produce a stripped binary for Release configs (not Debug). | 99 # On NaCl, only produce a stripped binary for Release configs (not Debug). |
110 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) | 100 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) |
111 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) | 101 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) |
112 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) | 102 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) |
113 else | 103 else |
114 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) | 104 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) |
115 endif | 105 endif |
116 [[]] | 106 [[]] |
117 | 107 |
118 $(eval $(call NMF_RULE,$(TARGET),)){{post}} | 108 $(eval $(call NMF_RULE,$(TARGET),)){{post}} |
OLD | NEW |