| 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 16 matching lines...) Expand all Loading... |
| 27 {{key}} = $({{key}}_$(TOOLCHAIN)) | 27 {{key}} = $({{key}}_$(TOOLCHAIN)) |
| 28 [[]] | 28 [[]] |
| 29 | 29 |
| 30 VALID_TOOLCHAINS := {{' '.join(tools)}} | 30 VALID_TOOLCHAINS := {{' '.join(tools)}} |
| 31 {{pre}} | 31 {{pre}} |
| 32 NACL_SDK_ROOT ?= $(abspath $(CURDIR)/{{rel_sdk}}) | 32 NACL_SDK_ROOT ?= $(abspath $(CURDIR)/{{rel_sdk}}) |
| 33 [[if 'INCLUDES' in targets[0]:]] | 33 [[if 'INCLUDES' in targets[0]:]] |
| 34 EXTRA_INC_PATHS={{' '.join(targets[0]['INCLUDES'])}} | 34 EXTRA_INC_PATHS={{' '.join(targets[0]['INCLUDES'])}} |
| 35 [[]] | 35 [[]] |
| 36 | 36 |
| 37 TARGET = {{targets[0]['NAME']}} |
| 38 |
| 37 [[if multi_platform:]] | 39 [[if multi_platform:]] |
| 38 # Build with platform-specific subdirectories, to reduce the download size of | 40 # Build with platform-specific subdirectories, to reduce the download size of |
| 39 # the app. | 41 # the app. |
| 40 MULTI_PLATFORM = 1 | 42 MULTI_PLATFORM = 1 |
| 41 [[]] | 43 [[]] |
| 42 | 44 |
| 43 include $(NACL_SDK_ROOT)/tools/common.mk | 45 include $(NACL_SDK_ROOT)/tools/common.mk |
| 44 | 46 |
| 45 [[if desc.get('SOCKET_PERMISSIONS'):]] | 47 [[if desc.get('SOCKET_PERMISSIONS'):]] |
| 46 CHROME_ARGS += --allow-nacl-socket-api=localhost | 48 CHROME_ARGS += --allow-nacl-socket-api=localhost |
| 47 [[]] | 49 [[]] |
| 48 | 50 |
| 49 TARGET = {{targets[0]['NAME']}} | |
| 50 [[ExpandDict('DEPS', targets[0].get('DEPS', []))]] | 51 [[ExpandDict('DEPS', targets[0].get('DEPS', []))]] |
| 51 [[ExpandDict('LIBS', targets[0].get('LIBS', []))]] | 52 [[ExpandDict('LIBS', targets[0].get('LIBS', []))]] |
| 52 | 53 |
| 53 [[for target in targets:]] | 54 [[for target in targets:]] |
| 54 [[ source_list = (s for s in sorted(target['SOURCES']) if not s.endswith('.h'))
]] | 55 [[ source_list = (s for s in sorted(target['SOURCES']) if not s.endswith('.h'))
]] |
| 55 [[ source_list = ' \\\n '.join(source_list)]] | 56 [[ source_list = ' \\\n '.join(source_list)]] |
| 56 [[ sources = target['NAME'] + '_SOURCES']] | 57 [[ sources = target['NAME'] + '_SOURCES']] |
| 57 [[ cflags = target['NAME'] + '_CFLAGS']] | 58 [[ cflags = target['NAME'] + '_CFLAGS']] |
| 58 [[ flags = target.get('CFLAGS', [])]] | 59 [[ flags = target.get('CFLAGS', [])]] |
| 59 [[ flags.extend(target.get('CXXFLAGS', []))]] | 60 [[ flags.extend(target.get('CXXFLAGS', []))]] |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 # On NaCl, only produce a stripped binary for Release configs (not Debug). | 100 # On NaCl, only produce a stripped binary for Release configs (not Debug). |
| 100 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) | 101 ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG)))) |
| 101 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) | 102 $(eval $(call LINK_RULE,{{name}}_unstripped,$({{sources}}),$(LIBS),$(DEPS))) |
| 102 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) | 103 $(eval $(call STRIP_RULE,{{name}},{{name}}_unstripped)) |
| 103 else | 104 else |
| 104 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) | 105 $(eval $(call LINK_RULE,{{name}},$({{sources}}),$(LIBS),$(DEPS))) |
| 105 endif | 106 endif |
| 106 [[]] | 107 [[]] |
| 107 | 108 |
| 108 $(eval $(call NMF_RULE,$(TARGET),)){{post}} | 109 $(eval $(call NMF_RULE,$(TARGET),)){{post}} |
| OLD | NEW |