| 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 # |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # | 21 # |
| 22 # Top Make file, which we want to trigger a rebuild on if it changes | 22 # Top Make file, which we want to trigger a rebuild on if it changes |
| 23 # | 23 # |
| 24 TOP_MAKE := $(word 1,$(MAKEFILE_LIST)) | 24 TOP_MAKE := $(word 1,$(MAKEFILE_LIST)) |
| 25 | 25 |
| 26 | 26 |
| 27 # | 27 # |
| 28 # Figure out which OS we are running on. | 28 # Figure out which OS we are running on. |
| 29 # | 29 # |
| 30 GETOS := python $(NACL_SDK_ROOT)/tools/getos.py | 30 GETOS := python $(NACL_SDK_ROOT)/tools/getos.py |
| 31 NACL_CONFIG := python $(NACL_SDK_ROOT)/tools/nacl_config.py |
| 31 FIXDEPS := python $(NACL_SDK_ROOT)/tools/fix_deps.py -c | 32 FIXDEPS := python $(NACL_SDK_ROOT)/tools/fix_deps.py -c |
| 32 OSNAME := $(shell $(GETOS)) | 33 OSNAME := $(shell $(GETOS)) |
| 33 | 34 |
| 34 | 35 |
| 35 # | 36 # |
| 36 # TOOLCHAIN=all recursively calls this Makefile for all VALID_TOOLCHAINS. | 37 # TOOLCHAIN=all recursively calls this Makefile for all VALID_TOOLCHAINS. |
| 37 # | 38 # |
| 38 ifeq ($(TOOLCHAIN),all) | 39 ifeq ($(TOOLCHAIN),all) |
| 39 | 40 |
| 40 # Define the default target | 41 # Define the default target |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 POSIX_FLAGS += -DSEL_LDR=1 | 325 POSIX_FLAGS += -DSEL_LDR=1 |
| 325 endif | 326 endif |
| 326 | 327 |
| 327 NACL_CFLAGS ?= -Wno-long-long -Werror | 328 NACL_CFLAGS ?= -Wno-long-long -Werror |
| 328 NACL_CXXFLAGS ?= -Wno-long-long -Werror | 329 NACL_CXXFLAGS ?= -Wno-long-long -Werror |
| 329 NACL_LDFLAGS += -Wl,-as-needed -pthread | 330 NACL_LDFLAGS += -Wl,-as-needed -pthread |
| 330 | 331 |
| 331 # | 332 # |
| 332 # Default Paths | 333 # Default Paths |
| 333 # | 334 # |
| 334 ifeq (,$(findstring $(TOOLCHAIN),linux mac win)) | 335 INC_PATHS ?= $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) --include-dirs) $(EXTRA_INC_
PATHS) |
| 335 INC_PATHS ?= $(NACL_SDK_ROOT)/include $(NACL_SDK_ROOT)/include/$(TOOLCHAIN) $(EX
TRA_INC_PATHS) | |
| 336 else | |
| 337 INC_PATHS ?= $(NACL_SDK_ROOT)/include/$(OSNAME) $(NACL_SDK_ROOT)/include $(EXTRA
_INC_PATHS) | |
| 338 endif | |
| 339 | |
| 340 LIB_PATHS ?= $(NACL_SDK_ROOT)/lib $(EXTRA_LIB_PATHS) | 336 LIB_PATHS ?= $(NACL_SDK_ROOT)/lib $(EXTRA_LIB_PATHS) |
| 341 | 337 |
| 342 # | 338 # |
| 343 # Define a LOG macro that allow a command to be run in quiet mode where | 339 # Define a LOG macro that allow a command to be run in quiet mode where |
| 344 # the command echoed is not the same as the actual command executed. | 340 # the command echoed is not the same as the actual command executed. |
| 345 # The primary use case for this is to avoid echoing the full compiler | 341 # The primary use case for this is to avoid echoing the full compiler |
| 346 # and linker command in the default case. Defining V=1 will restore | 342 # and linker command in the default case. Defining V=1 will restore |
| 347 # the verbose behavior | 343 # the verbose behavior |
| 348 # | 344 # |
| 349 # $1 = The name of the tool being run | 345 # $1 = The name of the tool being run |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 $(RUN_PY) -C $(CURDIR) -P $(PAGE_TC_CONFIG) \ | 490 $(RUN_PY) -C $(CURDIR) -P $(PAGE_TC_CONFIG) \ |
| 495 $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ | 491 $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ |
| 496 $(CHROME_ARGS) --no-sandbox \ | 492 $(CHROME_ARGS) --no-sandbox \ |
| 497 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" | 493 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" |
| 498 | 494 |
| 499 .PHONY: run_package | 495 .PHONY: run_package |
| 500 run_package: check_for_chrome all | 496 run_package: check_for_chrome all |
| 501 @echo "$(TOOLCHAIN) $(CONFIG)" > $(CURDIR)/run_package_config | 497 @echo "$(TOOLCHAIN) $(CONFIG)" > $(CURDIR)/run_package_config |
| 502 $(CHROME_PATH_ESCAPE) --load-and-launch-app=$(CURDIR) $(CHROME_ARGS) | 498 $(CHROME_PATH_ESCAPE) --load-and-launch-app=$(CURDIR) $(CHROME_ARGS) |
| 503 | 499 |
| 504 GDB_ARGS += -D $(TC_PATH)/$(OSNAME)_x86_newlib/bin/x86_64-nacl-gdb | 500 GDB_ARGS += -D $(shell $(NACL_CONFIG) --tool=gdb) |
| 505 GDB_ARGS += -D --eval-command="nacl-manifest $(abspath $(OUTDIR))/$(TARGET).nmf" | 501 GDB_ARGS += -D --eval-command="nacl-manifest $(abspath $(OUTDIR))/$(TARGET).nmf" |
| 506 GDB_ARGS += -D $(GDB_DEBUG_TARGET) | 502 GDB_ARGS += -D $(GDB_DEBUG_TARGET) |
| 507 | 503 |
| 508 .PHONY: debug | 504 .PHONY: debug |
| 509 debug: check_for_chrome all $(PAGE) | 505 debug: check_for_chrome all $(PAGE) |
| 510 $(RUN_PY) $(GDB_ARGS) \ | 506 $(RUN_PY) $(GDB_ARGS) \ |
| 511 -C $(CURDIR) -P $(PAGE_TC_CONFIG) \ | 507 -C $(CURDIR) -P $(PAGE_TC_CONFIG) \ |
| 512 $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ | 508 $(addprefix -E ,$(CHROME_ENV)) -- $(CHROME_PATH_ESCAPE) \ |
| 513 $(CHROME_ARGS) --enable-nacl-debug \ | 509 $(CHROME_ARGS) --enable-nacl-debug \ |
| 514 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" | 510 --register-pepper-plugins="$(PPAPI_DEBUG),$(PPAPI_RELEASE)" |
| 515 | 511 |
| 516 .PHONY: serve | 512 .PHONY: serve |
| 517 serve: all | 513 serve: all |
| 518 $(HTTPD_PY) -C $(CURDIR) | 514 $(HTTPD_PY) -C $(CURDIR) |
| 519 endif | 515 endif |
| 520 | 516 |
| 521 # uppercase aliases (for backward compatibility) | 517 # uppercase aliases (for backward compatibility) |
| 522 .PHONY: CHECK_FOR_CHROME DEBUG LAUNCH RUN | 518 .PHONY: CHECK_FOR_CHROME DEBUG LAUNCH RUN |
| 523 CHECK_FOR_CHROME: check_for_chrome | 519 CHECK_FOR_CHROME: check_for_chrome |
| 524 DEBUG: debug | 520 DEBUG: debug |
| 525 LAUNCH: run | 521 LAUNCH: run |
| 526 RUN: run | 522 RUN: run |
| 527 | 523 |
| 528 endif # TOOLCHAIN is valid... | 524 endif # TOOLCHAIN is valid... |
| 529 | 525 |
| 530 endif # TOOLCHAIN=all | 526 endif # TOOLCHAIN=all |
| OLD | NEW |