Chromium Code Reviews| Index: native_client_sdk/src/tools/common.mk |
| diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk |
| index 25a6e084412267c9ce772e12b7421f85f8913001..0b39818e86a5a63feacdadf4cbf80edaf83108f2 100644 |
| --- a/native_client_sdk/src/tools/common.mk |
| +++ b/native_client_sdk/src/tools/common.mk |
| @@ -65,12 +65,19 @@ export CYGWIN |
| # |
| # Alias for standard POSIX file system commands |
| # |
| -CP:=python $(NACL_SDK_ROOT)/tools/oshelpers.py cp |
| -MKDIR:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mkdir |
| -MV:=python $(NACL_SDK_ROOT)/tools/oshelpers.py mv |
| -RM:=python $(NACL_SDK_ROOT)/tools/oshelpers.py rm |
| -WHICH:=python $(NACL_SDK_ROOT)/tools/oshelpers.py which |
| - |
| +OSHELPERS=python $(NACL_SDK_ROOT)/tools/oshelpers.py |
| +WHICH:=$(OSHELPERS) which |
| +ifdef V |
| +RM:=$(OSHELPERS) rm |
| +CP:=$(OSHELPERS) cp |
| +MKDIR:=$(OSHELPERS) mkdir |
| +MV:=$(OSHELPERS) mv |
| +else |
| +RM:=@$(OSHELPERS) rm |
| +CP:=@$(OSHELPERS) cp |
| +MKDIR:=@$(OSHELPERS) mkdir |
| +MV:=@$(OSHELPERS) mv |
| +endif |
| # |
| # Compute path to requested NaCl Toolchain |
| @@ -96,10 +103,11 @@ all: |
| # |
| # $1 = Toolchain Name |
| # |
| +RECURSIVE_TARGET?=all |
|
noelallen1
2013/02/11 23:02:44
Separate change pls.
Sam Clegg
2013/02/11 23:07:14
Done.
|
| define TOOLCHAIN_RULE |
| .PHONY: all_$(1) |
| all_$(1): |
| - +$(MAKE) TOOLCHAIN=$(1) |
| + +$(MAKE) TOOLCHAIN=$(1) $(RECURSIVE_TARGET) |
| TOOLCHAIN_LIST+=all_$(1) |
| endef |
| @@ -123,7 +131,7 @@ all_versions: $(TOOLCHAIN_LIST) |
| # |
| .PHONY: clean |
| clean: |
| - $(RM) $(TARGET).nmf |
| + $(RM) -f $(TARGET).nmf |
| $(RM) -fr $(TOOLCHAIN) |
| @@ -137,7 +145,7 @@ clean: |
| # |
| %dir.stamp : |
| $(MKDIR) -p $(dir $@) |
| - echo "Directory Stamp" > $@ |
| + @echo "Directory Stamp" > $@ |
| OUTDIR:=$(TOOLCHAIN)/$(CONFIG) |
| STAMPDIR?=$(OUTDIR) |
| @@ -191,6 +199,7 @@ endif |
| NACL_CFLAGS?=-Wno-long-long -Werror |
| NACL_CXXFLAGS?=-Wno-long-long -Werror |
| +NACL_LDFLAGS?=-Wl,-as-needed |
| # |
| # Default Paths |
| @@ -203,6 +212,27 @@ endif |
| LIB_PATHS?=$(NACL_SDK_ROOT)/lib $(EXTRA_LIB_PATHS) |
| +# |
| +# Define a LOG macro that allow a command to be run in quiet mode where |
| +# the command echoed is not the same as the actual command executed. |
| +# The primary use case for this is to avoid echoing the full compiler |
| +# and linker command in the default case. Defining V=1 will restore |
| +# the verbose behavior |
| +# |
| +# $1 = The name of the tool being run |
| +# $2 = The target file being built |
| +# $3 = The full command to run |
| +# |
| +ifdef V |
| +define LOG |
| +$(3) |
| +endef |
| +else |
| +define LOG |
| +@echo " $(1) $(2)" && $(3) |
| +endef |
| +endif |
| + |
| # |
| # If the requested toolchain is a NaCl or PNaCl toolchain, the use the |