summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 00:08:27 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-15 00:08:27 +0000
commit217bbed4e4228d31ab3cbbac3d4b28054137dab4 (patch)
tree2db06b3f7f5c029c7a9684c0492110722b676a81 /native_client_sdk
parent6106ff69131097b4bb3df5e44ad55a63f6aef3f3 (diff)
downloadchromium_src-217bbed4e4228d31ab3cbbac3d4b28054137dab4.zip
chromium_src-217bbed4e4228d31ab3cbbac3d4b28054137dab4.tar.gz
chromium_src-217bbed4e4228d31ab3cbbac3d4b28054137dab4.tar.bz2
[NaCl SDK] Before bundling, clean all built libraries.
The "clean" make rule wasn't cleaning for all toolchains. BUG=none R=sbc@chromium.org Review URL: https://codereview.chromium.org/15017017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/build_tools/build_projects.py7
-rwxr-xr-xnative_client_sdk/src/build_tools/build_sdk.py5
-rw-r--r--native_client_sdk/src/examples/Makefile34
-rw-r--r--native_client_sdk/src/tools/common.mk73
4 files changed, 67 insertions, 52 deletions
diff --git a/native_client_sdk/src/build_tools/build_projects.py b/native_client_sdk/src/build_tools/build_projects.py
index b2c329f..185bd2b 100755
--- a/native_client_sdk/src/build_tools/build_projects.py
+++ b/native_client_sdk/src/build_tools/build_projects.py
@@ -147,7 +147,7 @@ def BuildProjectsBranch(pepperdir, platform, branch, deps=True, clean=False,
extra_args += ['IGNORE_DEPS=1']
try:
- buildbot_common.Run([make, '-j8', 'all_versions'] + extra_args,
+ buildbot_common.Run([make, '-j8', 'TOOLCHAIN=all'] + extra_args,
cwd=make_dir)
except:
print 'Failed to build ' + branch
@@ -155,7 +155,7 @@ def BuildProjectsBranch(pepperdir, platform, branch, deps=True, clean=False,
if clean:
# Clean to remove temporary files but keep the built
- buildbot_common.Run([make, '-j8', 'clean'] + extra_args,
+ buildbot_common.Run([make, '-j8', 'clean', 'TOOLCHAIN=all'] + extra_args,
cwd=make_dir)
@@ -222,8 +222,7 @@ def main(args):
filters['NAME'] = options.project
print 'Filter by name: ' + str(options.project)
- project_tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, verbose=options.verbose,
- filters=filters)
+ project_tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, filters=filters)
parse_dsc.PrintProjectTree(project_tree)
UpdateHelpers(pepperdir, platform, clobber=options.clobber)
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index dc194e3..0bb7b3a 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -636,11 +636,12 @@ def BuildStepMakeAll(pepperdir, platform, directory, step_name,
if not deps:
extra_args += ['IGNORE_DEPS=1']
- buildbot_common.Run([make, '-j8', 'all_versions'] + extra_args,
+ buildbot_common.Run([make, '-j8', 'TOOLCHAIN=all'] + extra_args,
cwd=make_dir)
if clean:
# Clean to remove temporary files but keep the built libraries.
- buildbot_common.Run([make, '-j8', 'clean'] + extra_args, cwd=make_dir)
+ buildbot_common.Run([make, '-j8', 'clean', 'TOOLCHAIN=all'] + extra_args,
+ cwd=make_dir)
def BuildStepBuildLibraries(pepperdir, platform, directory, clean=True):
diff --git a/native_client_sdk/src/examples/Makefile b/native_client_sdk/src/examples/Makefile
index 6ca12be..e21cbe8 100644
--- a/native_client_sdk/src/examples/Makefile
+++ b/native_client_sdk/src/examples/Makefile
@@ -14,6 +14,10 @@ PROJECTS:= \
HTTPD:={{rel_sdk}}/tools/httpd.py
+ifeq ($(TOOLCHAIN),all)
+TOOLCHAIN_ARG:=TOOLCHAIN=all
+endif
+
# Define the default target
all:
@@ -23,41 +27,37 @@ all:
# Macro defines a phony target for each example, and adds it to a list of
# targets.
#
+# Note: We use targets for each project (instead of an explicit recipe) so
+# each project can be built in parallel.
+#
define TARGET
TARGET_LIST+=$(1)_TARGET
.PHONY: $(1)_TARGET
$(1)_TARGET:
- +$(MAKE) -C $(1)
-
-VERSIONS_LIST+=$(1)_VERSIONS
-.PHONY: $(1)_VERSIONS
-$(1)_VERSIONS:
- +$(MAKE) -C $(1) all_versions
-
-CLEAN_LIST+=$(1)_CLEAN
-.PHONY: $(1)_CLEAN
-$(1)_CLEAN:
- +$(MAKE) -C $(1) clean
+ +$(MAKE) -C $(1) $(TOOLCHAIN_ARG) $(MAKECMDGOALS)
endef
# Define the various targets via the Macro
$(foreach proj,$(PROJECTS),$(eval $(call TARGET,$(proj))))
+.PHONY: all
all: $(TARGET_LIST)
@echo Done building targets.
-all_versions: $(VERSIONS_LIST)
- @echo Done building all versions.
-
-clean: $(CLEAN_LIST)
+.PHONY: clean
+clean: $(TARGET_LIST)
@echo Done cleaning targets.
+.PHONY: run
run: all
@echo Starting up python webserver.
python $(HTTPD)
-# uppercase aliases (for backward compatibility)
+# Phony aliases for backward compatibility
RUN: run
-.PHONY: RUN run
+all_versions:
+ +$(MAKE) TOOLCHAIN=all
+
+.PHONY: RUN all_versions
diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk
index 387aad8..c3458f6 100644
--- a/native_client_sdk/src/tools/common.mk
+++ b/native_client_sdk/src/tools/common.mk
@@ -7,7 +7,6 @@
# http://www.gnu.org/software/make/manual/make.html
#
-
#
# Toolchain
#
@@ -33,6 +32,48 @@ OSNAME:=$(shell $(GETOS))
#
+# TOOLCHAIN=all recursively calls this Makefile for all VALID_TOOLCHAINS.
+#
+ifeq ($(TOOLCHAIN),all)
+
+# Define the default target
+all:
+
+#
+# Generate a new MAKE command for each TOOLCHAIN.
+#
+# Note: We use targets for each toolchain (instead of an explicit recipe) so
+# each toolchain can be built in parallel.
+#
+# $1 = Toolchain Name
+#
+define TOOLCHAIN_RULE
+TOOLCHAIN_TARGETS += $(1)_TARGET
+.PHONY: $(1)_TARGET
+$(1)_TARGET:
+ +$(MAKE) TOOLCHAIN=$(1) $(MAKECMDGOALS)
+endef
+
+#
+# The target for all versions
+#
+USABLE_TOOLCHAINS=$(filter $(OSNAME) newlib glibc pnacl,$(VALID_TOOLCHAINS))
+
+ifeq ($(NO_HOST_BUILDS),1)
+USABLE_TOOLCHAINS:=$(filter-out $(OSNAME),$(USABLE_TOOLCHAINS))
+endif
+
+# Define the toolchain targets for all usable toolchains via the macro.
+$(foreach tool,$(USABLE_TOOLCHAINS),$(eval $(call TOOLCHAIN_RULE,$(tool))))
+
+.PHONY: all clean install
+all: $(TOOLCHAIN_TARGETS)
+clean: $(TOOLCHAIN_TARGETS)
+install: $(TOOLCHAIN_TARGETS)
+
+else # TOOLCHAIN=all
+
+#
# Verify we selected a valid toolchain for this example
#
ifeq (,$(findstring $(TOOLCHAIN),$(VALID_TOOLCHAINS)))
@@ -156,34 +197,6 @@ install:
.PHONY: install
-#
-# Target a toolchain
-#
-# $1 = Toolchain Name
-#
-define TOOLCHAIN_RULE
-.PHONY: all_$(1)
-all_$(1):
- +$(MAKE) TOOLCHAIN=$(1)
-TOOLCHAIN_LIST+=all_$(1)
-endef
-
-
-#
-# The target for all versions
-#
-USABLE_TOOLCHAINS=$(filter $(OSNAME) newlib glibc pnacl,$(VALID_TOOLCHAINS))
-
-ifeq ($(NO_HOST_BUILDS),1)
-USABLE_TOOLCHAINS:=$(filter-out $(OSNAME),$(USABLE_TOOLCHAINS))
-endif
-
-$(foreach tool,$(USABLE_TOOLCHAINS),$(eval $(call TOOLCHAIN_RULE,$(tool),$(dep))))
-
-.PHONY: all_versions
-all_versions: $(TOOLCHAIN_LIST)
-
-
OUTBASE?=.
OUTDIR:=$(OUTBASE)/$(TOOLCHAIN)/$(CONFIG)
STAMPDIR?=$(OUTDIR)
@@ -427,3 +440,5 @@ CHECK_FOR_CHROME: check_for_chrome
DEBUG: debug
LAUNCH: run
RUN: run
+
+endif # TOOLCHAIN=all