Chromium Code Reviews| 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 | 10 |
| 11 # | 11 # |
| 12 # Toolchain | 12 # Toolchain |
| 13 # | 13 # |
| 14 # This makefile is designed to work with the NEWLIB toolchain which is | 14 # This makefile is designed to work with the NEWLIB toolchain which is |
| 15 # currently supported by x86 and ARM. To switch to glibc, you would need | 15 # currently supported by x86 and ARM. To switch to glibc, you would need |
| 16 # to drop support for ARM. | 16 # to drop support for ARM. |
| 17 # | 17 # |
| 18 TOOLCHAIN?=newlib | 18 VALID_TOOLCHAINS?=newlib |
| 19 TOOLCHAIN?=$(word 1,$(VALID_TOOLCHAINS)) | |
| 20 | |
| 21 | |
| 22 # | |
| 23 # Top Make file, which we want to trigger a rebuild on if it changes | |
| 24 # | |
| 25 TOP_MAKE:=$(word 1,$(MAKEFILE_LIST)) | |
| 26 | |
| 27 | |
| 28 # | |
| 29 # Verify we selected a valid toolchain for this example | |
| 30 # | |
| 31 ifeq (,$(findstring $(TOOLCHAIN),$(VALID_TOOLCHAINS))) | |
| 32 $(warning Availbile choices are: $(VALID_TOOLCHAINS)) | |
| 33 $(error Can not use TOOLCHAIN=$(TOOLCHAIN) on this example.) | |
| 34 endif | |
| 35 | |
| 19 | 36 |
| 20 # | 37 # |
| 21 # Build Configuration | 38 # Build Configuration |
| 22 # | 39 # |
| 23 # The SDK provides two sets of libraries, Debug and Release. Debug libraries | 40 # The SDK provides two sets of libraries, Debug and Release. Debug libraries |
| 24 # are compiled without optimizations to make debugging easier. By default | 41 # are compiled without optimizations to make debugging easier. By default |
| 25 # this will build a Debug configuration. | 42 # this will build a Debug configuration. |
| 26 # | 43 # |
| 27 CONFIG?=Debug | 44 CONFIG?=Debug |
| 28 | 45 |
| 29 | 46 |
| 47 | |
| 30 # Note for Windows: | 48 # Note for Windows: |
| 31 # Both GCC and LLVM bases tools (include the version of Make.exe that comes | 49 # Both GCC and LLVM bases tools (include the version of Make.exe that comes |
| 32 # with the SDK) both expect and are capable of dealing with the '/' seperator. | 50 # with the SDK) both expect and are capable of dealing with the '/' seperator. |
| 33 # For that reason, the tools in the SDK, including build, compilers, scripts | 51 # For that reason, the tools in the SDK, including build, compilers, scripts |
| 34 # all have a preference for POSIX style command-line arguments. | 52 # all have a preference for POSIX style command-line arguments. |
| 35 # | 53 # |
| 36 # Keep in mind however that the shell is responsible for command-line escaping, | 54 # Keep in mind however that the shell is responsible for command-line escaping, |
| 37 # globbing, and variable expansion, so those may change based on which shell | 55 # globbing, and variable expansion, so those may change based on which shell |
| 38 # is used. For Cygwin shells this can include automatic and incorrect expansion | 56 # is used. For Cygwin shells this can include automatic and incorrect expansion |
| 39 # of response files (files starting with '@'). | 57 # of response files (files starting with '@'). |
| 40 # | 58 # |
| 41 | |
| 42 # Disable DOS PATH warning when using Cygwin based NaCl tools on Windows. | 59 # Disable DOS PATH warning when using Cygwin based NaCl tools on Windows. |
| 43 # | 60 # |
| 44 CYGWIN?=nodosfilewarning | 61 CYGWIN?=nodosfilewarning |
| 45 export CYGWIN | 62 export CYGWIN |
| 46 | 63 |
| 47 | 64 |
| 48 # | 65 # |
| 49 # Get pepper directory for toolchain and includes. | 66 # Alias for standard POSIX file system commands |
| 50 # | 67 # |
| 51 # If NACL_SDK_ROOT is not set, then assume it can be found a two directories up, | 68 CP:=python $(NACL_SDK_ROOT)/tools/oshelpers.py cp |
| 52 # from the default example directory location. | 69 MKDIR:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mkdir |
| 53 # | 70 MV:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mv |
| 54 THIS_MAKEFILE:=$(abspath $(lastword $(MAKEFILE_LIST))) | 71 RM:=python $(NACL_SDK_ROOT)/tools/oshelpers.py rm |
| 55 THIS_DIR:=$(abspath $(dir $(THIS_MAKEFILE))) | |
| 56 NACL_SDK_ROOT?=$(abspath $(dir $(THIS_MAKEFILE))../..) | |
| 57 | 72 |
| 58 | 73 |
| 59 # | 74 # |
| 60 # Defaults build flags | |
| 61 # | |
| 62 # Convert warnings to errors, and build with no optimization. | |
| 63 # | |
| 64 NACL_WARNINGS:=-Wno-long-long -Werror | |
| 65 OPT_FLAGS:=-g -O0 | |
| 66 CXX_FLAGS:=-pthread -I$(NACL_SDK_ROOT)/include | |
| 67 LD_FLAGS:=-pthread | |
| 68 | |
| 69 | |
| 70 # | |
| 71 # Library Paths | |
| 72 # | |
| 73 # Libraries are stored in different directories for each achitecture as well | |
| 74 # as different subdirectories for Debug vs Release configurations. This make | |
| 75 # only supports the Debug configuration for simplicity. | |
| 76 # | |
| 77 # By default for x86 32 bit this expands to: | |
| 78 # $(NACL_SDK_ROOT)/lib/newlib_x86_32/Debug | |
| 79 # | |
| 80 LD_X86_32:=-L$(NACL_SDK_ROOT)/lib/$(TOOLCHAIN)_x86_32/$(CONFIG) | |
| 81 LD_X86_64:=-L$(NACL_SDK_ROOT)/lib/$(TOOLCHAIN)_x86_64/$(CONFIG) | |
| 82 LD_ARM:=-L$(NACL_SDK_ROOT)/lib/$(TOOLCHAIN)_arm/$(CONFIG) | |
| 83 | |
| 84 | |
| 85 # | |
| 86 # Compute path to requested NaCl Toolchain | 75 # Compute path to requested NaCl Toolchain |
| 87 # | 76 # |
| 88 OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py) | 77 OSNAME:=$(shell python $(NACL_SDK_ROOT)/tools/getos.py) |
| 89 TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain) | 78 TC_PATH:=$(abspath $(NACL_SDK_ROOT)/toolchain) |
| 90 | 79 |
| 91 | 80 |
| 92 # | |
| 93 # Alias for standard POSIX file system commands | |
| 94 # | |
| 95 CP:=python $(NACL_SDK_ROOT)/tools/oshelpers.py cp | |
| 96 MKDIR:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mkdir | |
| 97 MV:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mv | |
| 98 RM:=python $(NACL_SDK_ROOT)/tools/oshelpers.py rm | |
| 99 | 81 |
| 100 | 82 |
| 101 # | 83 # |
| 102 # The default target | 84 # The default target |
| 103 # | 85 # |
| 104 # If no targets are specified on the command-line, the first target listed in | 86 # If no targets are specified on the command-line, the first target listed in |
| 105 # the makefile becomes the default target. By convention this is usually called | 87 # the makefile becomes the default target. By convention this is usually called |
| 106 # the 'all' target. Here we leave it blank to be first, but define it later | 88 # the 'all' target. Here we leave it blank to be first, but define it later |
| 107 # | 89 # |
| 108 all: | 90 all: |
| 109 | 91 |
| 110 | 92 |
| 111 # | 93 # |
| 94 # The target for all versions | |
| 95 # | |
| 96 # If no targets are specified on the command-line, the first target listed in | |
|
binji
2013/01/16 22:46:55
this comment is wrong
noelallen1
2013/01/16 23:21:10
Done.
| |
| 97 # the makefile becomes the default target. By convention this is usually called | |
| 98 # the 'all' target. Here we leave it blank to be first, but define it later | |
| 99 # | |
| 100 # | |
| 101 # Target a toolchain | |
| 102 # | |
| 103 # $1 = Toolchain Name | |
| 104 # | |
| 105 define TOOLCHAIN_RULE | |
| 106 .PHONY: all_$(1) | |
| 107 all_$(1): | |
| 108 +$(MAKE) TOOLCHAIN=$(1) | |
| 109 TOOLCHAIN_LIST+=all_$(1) | |
| 110 endef | |
| 111 | |
| 112 USABLE_TOOLCHAINS=$(filter $(OSNAME) newlib glibc pnacl,$(VALID_TOOLCHAINS)) | |
| 113 $(foreach tool,$(USABLE_TOOLCHAINS),$(eval $(call TOOLCHAIN_RULE,$(tool),$(dep)) )) | |
| 114 all_versions: $(TOOLCHAIN_LIST) | |
| 115 | |
| 116 # | |
| 112 # Target to remove temporary files | 117 # Target to remove temporary files |
| 113 # | 118 # |
| 114 .PHONY: clean | 119 .PHONY: clean |
| 115 clean: | 120 clean: |
| 116 $(RM) $(TARGET).nmf | 121 $(RM) $(TARGET).nmf |
| 117 $(RM) -fr $(TOOLCHAIN) | 122 $(RM) -fr $(TOOLCHAIN) |
| 118 | 123 |
| 119 # | |
| 120 # Macros for TOOLS | |
| 121 # | |
| 122 # We use the C++ compiler for everything and then use the -Wl,-as-needed flag | |
| 123 # in the linker to drop libc++ unless it's actually needed. | |
| 124 # | |
| 125 X86_CXX?=$(TC_PATH)/$(OSNAME)_x86_$(TOOLCHAIN)/bin/i686-nacl-g++ | |
| 126 X86_LINK?=$(TC_PATH)/$(OSNAME)_x86_$(TOOLCHAIN)/bin/i686-nacl-g++ -Wl,-as-needed | |
| 127 | |
| 128 ARM_CXX?=$(TC_PATH)/$(OSNAME)_arm_$(TOOLCHAIN)/bin/arm-nacl-g++ | |
| 129 ARM_LINK?=$(TC_PATH)/$(OSNAME)_arm_$(TOOLCHAIN)/bin/arm-nacl-g++ -Wl,-as-needed | |
| 130 | |
| 131 PNACL_CXX?=$(TC_PATH)/$(OSNAME)_x86_$(TOOLCHAIN)/newlib/bin/pnacl-clang++ -c | |
| 132 PNACL_LINK?=$(TC_PATH)/$(OSNAME)_x86_$(TOOLCHAIN)/newlib/bin/pnacl-clang++ | |
| 133 | |
| 134 | 124 |
| 135 # | 125 # |
| 136 # Rules for output directories. | 126 # Rules for output directories. |
| 137 # | 127 # |
| 138 # Output will be places in a directory name based on Toolchain and configuration | 128 # Output will be places in a directory name based on Toolchain and configuration |
| 139 # be default this will be "newlib/Debug". We use a python wrapped MKDIR to | 129 # be default this will be "newlib/Debug". We use a python wrapped MKDIR to |
| 140 # proivde a cross platform solution. The use of '|' checks for existance instead | 130 # proivde a cross platform solution. The use of '|' checks for existance instead |
| 141 # of timestamp, since the directory can update when files change. | 131 # of timestamp, since the directory can update when files change. |
| 142 # | 132 # |
| 143 $(TOOLCHAIN): | 133 $(TOOLCHAIN): |
| 144 $(MKDIR) $(TOOLCHAIN) | 134 $(MKDIR) $(TOOLCHAIN) |
| 145 | 135 |
| 146 $(TOOLCHAIN)/$(CONFIG): | $(TOOLCHAIN) | 136 $(TOOLCHAIN)/$(CONFIG): | $(TOOLCHAIN) |
| 147 $(MKDIR) $(TOOLCHAIN)/$(CONFIG) | 137 $(MKDIR) $(TOOLCHAIN)/$(CONFIG) |
| 148 | 138 |
| 149 OUTDIR:=$(TOOLCHAIN)/$(CONFIG) | 139 OUTDIR:=$(TOOLCHAIN)/$(CONFIG) |
| 140 -include $(OUTDIR)/*.d | |
|
binji
2013/01/16 22:46:55
maybe give this its own header and description...?
| |
| 150 | 141 |
| 151 | 142 |
| 152 # | 143 # |
| 153 # Dependency Macro | 144 # Dependency Macro |
| 154 # | 145 # |
| 155 # $1 = Name of dependency | 146 # $1 = Name of dependency |
| 156 # | 147 # |
| 157 define DEPEND_RULE | 148 define DEPEND_RULE |
| 158 .PHONY: $(1) | 149 .PHONY: $(1) |
| 159 $(1): | 150 $(1): |
| 160 +$(MAKE) -C $(NACL_SDK_ROOT)/src/$(1) | 151 +$(MAKE) -C $(NACL_SDK_ROOT)/src/$(1) |
| 161 DEPS_LIST+=$(1) | 152 DEPS_LIST+=$(1) |
| 162 endef | 153 endef |
| 163 | 154 |
| 164 # | |
| 165 # Compile Macro | |
| 166 # | |
| 167 # $1 = Source Name | |
| 168 # | |
| 169 # By default, if $(1) = source.c, this rule expands to: | |
| 170 # newlib/Debug/source_x86_32.o : souce.c Makefile | newlib/Debug | |
| 171 # | |
| 172 # Which means if 'source.c' or Makefile are newer than the object | |
| 173 # newlib/Debug/source_x86_32.o, then run the step: | |
| 174 # $(X86_CC) -o newlib/Debug/source_x86_32.o -c source.c .... | |
| 175 # | |
| 176 # We repeat this expansion for 64 bit X86 and conditionally for ARM if | |
| 177 # TOOLCHAIN=newlib | |
| 178 # | |
| 179 define COMPILE_RULE | |
| 180 $(OUTDIR)/$(basename $(1))_x86_32.o : $(1) $(THIS_MAKE) | $(OUTDIR) | |
| 181 $(X86_CXX) -o $$@ -c $$< -m32 $(OPT_FLAGS) $(CXX_FLAGS) $(NACL_WARNINGS) | |
| 182 | 155 |
| 183 $(OUTDIR)/$(basename $(1))_x86_64.o : $(1) $(THIS_MAKE) | $(OUTDIR) | 156 ifeq ('win','$(TOOLCHAIN)') |
| 184 » $(X86_CXX) -o $$@ -c $$< -m64 $(OPT_FLAGS) $(CXX_FLAGS) $(NACL_WARNINGS) | 157 HOST_EXT=.dll |
| 185 | 158 else |
| 186 $(OUTDIR)/$(basename $(1))_arm.o : $(1) $(THIS_MAKE) | $(OUTDIR) | 159 HOST_EXT=.so |
| 187 » $(ARM_CXX) -o $$@ -c $$< $(OPT_FLAGS) $(CXX_FLAGS) $(NACL_WARNINGS) | |
| 188 | |
| 189 $(OUTDIR)/$(basename $(1))_pnacl.o : $(1) $(THIS_MAKE) | $(OUTDIR) | |
| 190 » $(PNACL_CXX) -o $$@ -c $$< $(OPT_FLAGS) $(CXX_FLAGS) $(NACL_WARNINGS) | |
| 191 endef | |
| 192 | |
| 193 | |
| 194 # | |
| 195 # Link Macro | |
| 196 # | |
| 197 # $1 = Target Name | |
| 198 # $2 = List of Sources | |
| 199 # | |
| 200 # By default, if $(1) = foo $(2) = A.c B.cc, this rule expands to: | |
| 201 # newlib/Debug/foo_x86_32.nexe : newlib/Debug/A_x86_32.o ... | |
| 202 # | |
| 203 # Which means if A_x86_32.o or sourceB_32.o is newer than the nexe then | |
| 204 # run the build step: | |
| 205 # $(X86_LINK) -o newlib/Debug/foo_x86_32.nexe newlib/Debug/A_x86_32.o ... | |
| 206 # | |
| 207 # Note: | |
| 208 # We expand each library as '-l<name>' which will look for lib<name> in the | |
| 209 # directory specified by $(LD_X86_32) | |
| 210 # | |
| 211 # We repeat this expansion for 64 bit X86 and conditionally for ARM if | |
| 212 # TOOLCHAIN=newlib | |
| 213 # | |
| 214 define LINK_RULE | |
| 215 NMF_TARGETS+=$(OUTDIR)/$(1)_x86_32.nexe | |
| 216 $(OUTDIR)/$(1)_x86_32.nexe : $(foreach src,$(2),$(OUTDIR)/$(basename $(src))_x86 _32.o) | |
| 217 » $(X86_LINK) -o $$@ $$^ -m32 $(LD_X86_32) $(LD_FLAGS) $(foreach lib,$(LIB S),-l$(lib)) | |
| 218 | |
| 219 NMF_TARGETS+=$(OUTDIR)/$(1)_x86_64.nexe | |
| 220 $(OUTDIR)/$(1)_x86_64.nexe : $(foreach src,$(2),$(OUTDIR)/$(basename $(src))_x86 _64.o) | |
| 221 » $(X86_LINK) -o $$@ $$^ -m64 $(LD_X86_64) $(LD_FLAGS) $(foreach lib,$(LIB S),-l$(lib)) | |
| 222 | |
| 223 NMF_TARGETS+=$(OUTDIR)/$(1)_arm.nexe | |
| 224 $(OUTDIR)/$(1)_arm.nexe : $(foreach src,$(2),$(OUTDIR)/$(basename $(src))_arm.o) | |
| 225 » $(ARM_LINK) -o $$@ $$^ $(LD_ARM) $(LD_FLAGS) $(foreach lib,$(LIBS),-l$(l ib)) | |
| 226 | |
| 227 NMF_TARGETS+=$(OUTDIR)/$(1).pexe | |
| 228 $(OUTDIR)/$(1).pexe : $(foreach src,$(2),$(OUTDIR)/$(basename $(src))_pnacl.o) | |
| 229 » $(PNACL_LINK) -o $$@ $$^ $(LD_PNACL) $(LD_FLAGS) $(foreach lib,$(LIBS),- l$(lib)) | |
| 230 endef | |
| 231 | |
| 232 | |
| 233 | |
| 234 # | |
| 235 # Generate NMF_TARGETS | |
| 236 # | |
| 237 ARCHES=x86_32 x86_64 | |
| 238 ifeq "newlib" "$(TOOLCHAIN)" | |
| 239 ARCHES+=arm | |
| 240 endif | |
| 241 NMF_ARCHES:=$(foreach arch,$(ARCHES),_$(arch).nexe) | |
| 242 | |
| 243 ifeq "pnacl" "$(TOOLCHAIN)" | |
| 244 NMF_ARCHES:=.pexe | |
| 245 endif | 160 endif |
| 246 | 161 |
| 247 | 162 |
| 248 # | 163 # |
| 249 # NMF Manifiest generation | 164 # Common Compile Options |
| 250 # | 165 # |
| 251 # Use the python script create_nmf to scan the binaries for dependencies using | 166 ifeq ('Release','$(CONFIG)') |
| 252 # objdump. Pass in the (-L) paths to the default library toolchains so that we | 167 POSIX_OPT_FLAGS?=-g -O2 -pthread |
| 253 # can find those libraries and have it automatically copy the files (-s) to | 168 else |
| 254 # the target directory for us. | 169 POSIX_OPT_FLAGS?=-g -O0 -pthread |
| 170 endif | |
| 171 | |
| 172 NACL_CFLAGS?=-Wno-long-long -Werror | |
| 173 NACL_CXXFLAGS?=-Wno-long-long -Werror | |
| 174 | |
| 255 # | 175 # |
| 256 # $1 = Target Name (the basename of the nmf | 176 # Default Paths |
| 257 # $2 = Additional create_nmf.py arguments | |
| 258 # | 177 # |
| 259 NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py | 178 ifeq (,$(findstring $(TOOLCHAIN),linux mac win)) |
| 260 GLIBC_DUMP:=$(TC_PATH)/$(OSNAME)_x86_glibc/x86_64-nacl/bin/objdump | 179 INC_PATHS?=$(NACL_SDK_ROOT)/include |
| 261 GLIBC_PATHS:=-L $(TC_PATH)/$(OSNAME)_x86_glibc/x86_64-nacl/lib32 | 180 LIB_PATHS?=$(NACL_SDK_ROOT)/lib |
| 262 GLIBC_PATHS+=-L $(TC_PATH)/$(OSNAME)_x86_glibc/x86_64-nacl/lib | 181 else |
| 182 INC_PATHS?=$(NACL_SDK_ROOT)/include/$(OSNAME) $(NACL_SDK_ROOT)/include | |
| 183 LIB_PATHS?=$(NACL_SDK_ROOT)/lib/$(OSNAME) $(NACL_SDK_ROOT)/lib | |
| 184 endif | |
| 263 | 185 |
| 264 define NMF_RULE | 186 # |
| 265 $(OUTDIR)/$(1).nmf : $(foreach arch,$(NMF_ARCHES),$(OUTDIR)/$(1)$(arch)) | 187 # If the requested toolchain is a NaCl or PNaCl toolchain, the use the |
| 266 » $(NMF) -o $$@ $$^ -D $(GLIBC_DUMP) $(GLIBC_PATHS) -s $(OUTDIR) $(2) | 188 # macros and targets defined in nacl.mk, otherwise use the host sepecific |
|
binji
2013/01/16 22:46:55
comment is wrong
| |
| 189 # macros and targets. | |
| 190 # | |
| 191 ifneq (,$(findstring $(TOOLCHAIN),linux mac)) | |
| 192 include $(NACL_SDK_ROOT)/tools/host_gcc.mk | |
| 193 endif | |
| 267 | 194 |
| 268 all : $(DEPS_LIST) $(OUTDIR)/$(1).nmf | 195 ifneq (,$(findstring $(TOOLCHAIN),win)) |
| 269 endef | 196 include $(NACL_SDK_ROOT)/tools/host_vc.mk |
| 197 endif | |
| 198 | |
| 199 ifneq (,$(findstring $(TOOLCHAIN),glibc newlib)) | |
| 200 include $(NACL_SDK_ROOT)/tools/nacl_gcc.mk | |
| 201 endif | |
| 202 | |
| 203 ifneq (,$(findstring $(TOOLCHAIN),pnacl)) | |
| 204 include $(NACL_SDK_ROOT)/tools/nacl_llvm.mk | |
| 205 endif | |
| 270 | 206 |
| 271 | 207 |
| 272 # | 208 # |
| 273 # Verify we can find the Chrome executable if we need to launch it. | 209 # Verify we can find the Chrome executable if we need to launch it. |
| 274 # | 210 # |
| 275 .PHONY: CHECK_FOR_CHROME RUN LAUNCH | 211 .PHONY: CHECK_FOR_CHROME RUN LAUNCH |
| 276 CHECK_FOR_CHROME: | 212 CHECK_FOR_CHROME: |
| 277 ifeq (,$(wildcard $(CHROME_PATH))) | 213 ifeq (,$(wildcard $(CHROME_PATH))) |
| 278 $(warning No valid Chrome found at CHROME_PATH=$(CHROME_PATH)) | 214 $(warning No valid Chrome found at CHROME_PATH=$(CHROME_PATH)) |
| 279 $(error Set CHROME_PATH via an environment variable, or command-line.) | 215 $(error Set CHROME_PATH via an environment variable, or command-line.) |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 290 # Add this to launch Chrome with additional environment variables defined. | 226 # Add this to launch Chrome with additional environment variables defined. |
| 291 # Each element should be specified as KEY=VALUE, with whitespace separating | 227 # Each element should be specified as KEY=VALUE, with whitespace separating |
| 292 # key-value pairs. e.g. | 228 # key-value pairs. e.g. |
| 293 # CHROME_ENV=FOO=1 BAR=2 BAZ=3 | 229 # CHROME_ENV=FOO=1 BAR=2 BAZ=3 |
| 294 CHROME_ENV?= | 230 CHROME_ENV?= |
| 295 | 231 |
| 296 # Additional arguments to pass to Chrome. | 232 # Additional arguments to pass to Chrome. |
| 297 CHROME_ARGS+=--enable-nacl --enable-pnacl --incognito --ppapi-out-of-process | 233 CHROME_ARGS+=--enable-nacl --enable-pnacl --incognito --ppapi-out-of-process |
| 298 | 234 |
| 299 | 235 |
| 300 CONFIG?=Debug | 236 # Paths to Debug and Release versions of the Host Pepper plugins |
| 237 PPAPI_DEBUG=$(abspath $(OSNAME)/Debug/$(TARGET)$(HOST_EXT));application/x-ppapi- debug | |
| 238 PPAPI_RELEASE=$(abspath $(OSNAME)/Release/$(TARGET)$(HOST_EXT));application/x-pp api-release | |
| 239 | |
| 240 info: | |
| 241 » @echo "DEBUG=$(PPAPI_DEBUG)" | |
| 242 | |
| 301 PAGE?=index_$(TOOLCHAIN)_$(CONFIG).html | 243 PAGE?=index_$(TOOLCHAIN)_$(CONFIG).html |
| 302 | 244 |
| 303 RUN: LAUNCH | 245 RUN: LAUNCH |
| 304 LAUNCH: CHECK_FOR_CHROME all | 246 LAUNCH: CHECK_FOR_CHROME all |
| 305 ifeq (,$(wildcard $(PAGE))) | 247 ifeq (,$(wildcard $(PAGE))) |
| 306 $(warning No valid HTML page found at $(PAGE)) | 248 $(warning No valid HTML page found at $(PAGE)) |
| 307 $(error Make sure TOOLCHAIN and CONFIG are properly set) | 249 $(error Make sure TOOLCHAIN and CONFIG are properly set) |
| 308 endif | 250 endif |
| 309 » $(RUN_PY) -C $(THIS_DIR) -P $(PAGE) $(addprefix -E ,$(CHROME_ENV)) -- \ | 251 » $(RUN_PY) -C $(CURDIR) -P $(PAGE) $(addprefix -E ,$(CHROME_ENV)) -- \ |
| 310 $(CHROME_PATH) $(CHROME_ARGS) \ | 252 $(CHROME_PATH) $(CHROME_ARGS) \ |
| 311 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" | 253 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" |
| 312 | 254 |
| OLD | NEW |