summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 19:09:59 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-19 19:09:59 +0000
commit6f9beb0813ec77e920fb8c7dc10741d8bca0e9c9 (patch)
tree1798c5d8e452d1effbf5fcba22405439cb4f6f40 /native_client_sdk
parenta7412437b978e666933480b1864ebc3f695f38d8 (diff)
downloadchromium_src-6f9beb0813ec77e920fb8c7dc10741d8bca0e9c9.zip
chromium_src-6f9beb0813ec77e920fb8c7dc10741d8bca0e9c9.tar.gz
chromium_src-6f9beb0813ec77e920fb8c7dc10741d8bca0e9c9.tar.bz2
[NaCl SDK] Fix building on dependencies under common.mk.
The stamp files used to signal when a given library was up-to-date were not depending on the installed libraries. R=binji@chromium.org Review URL: https://codereview.chromium.org/19412002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/examples/demo/nacl_io/example.dsc3
-rw-r--r--native_client_sdk/src/examples/demo/pi_generator/example.dsc3
-rw-r--r--native_client_sdk/src/examples/getting_started/simple_hello_world/example.dsc3
-rw-r--r--native_client_sdk/src/examples/tutorial/dlopen/example.dsc3
-rw-r--r--native_client_sdk/src/tools/nacl_gcc.mk21
5 files changed, 21 insertions, 12 deletions
diff --git a/native_client_sdk/src/examples/demo/nacl_io/example.dsc b/native_client_sdk/src/examples/demo/nacl_io/example.dsc
index a86a5dd..11e331b 100644
--- a/native_client_sdk/src/examples/demo/nacl_io/example.dsc
+++ b/native_client_sdk/src/examples/demo/nacl_io/example.dsc
@@ -12,7 +12,8 @@
'queue.c',
'queue.h',
],
- 'LIBS': ['nacl_io', 'ppapi', 'pthread']
+ 'DEPS': ['nacl_io'],
+ 'LIBS': ['ppapi', 'pthread']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/demo/pi_generator/example.dsc b/native_client_sdk/src/examples/demo/pi_generator/example.dsc
index e62adee..b55396c1 100644
--- a/native_client_sdk/src/examples/demo/pi_generator/example.dsc
+++ b/native_client_sdk/src/examples/demo/pi_generator/example.dsc
@@ -5,7 +5,8 @@
'NAME' : 'pi_generator',
'TYPE' : 'main',
'SOURCES' : ['pi_generator.cc'],
- 'LIBS': ['ppapi_simple', 'nacl_io', 'ppapi_cpp', 'ppapi', 'pthread']
+ 'DEPS': ['ppapi_simple', 'nacl_io', 'ppapi_cpp'],
+ 'LIBS': ['ppapi', 'pthread']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/getting_started/simple_hello_world/example.dsc b/native_client_sdk/src/examples/getting_started/simple_hello_world/example.dsc
index 8a7a8de..353c7fc 100644
--- a/native_client_sdk/src/examples/getting_started/simple_hello_world/example.dsc
+++ b/native_client_sdk/src/examples/getting_started/simple_hello_world/example.dsc
@@ -6,7 +6,8 @@
'NAME' : 'simple_hello_world',
'TYPE' : 'main',
'SOURCES' : ['hello_world.c'],
- 'LIBS': ['ppapi_simple', 'nacl_io', 'ppapi_cpp', 'ppapi', 'pthread']
+ 'DEPS': ['ppapi_simple', 'nacl_io', 'ppapi_cpp'],
+ 'LIBS': ['ppapi', 'pthread']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/tutorial/dlopen/example.dsc b/native_client_sdk/src/examples/tutorial/dlopen/example.dsc
index d7c1ca1..8a1f104 100644
--- a/native_client_sdk/src/examples/tutorial/dlopen/example.dsc
+++ b/native_client_sdk/src/examples/tutorial/dlopen/example.dsc
@@ -5,7 +5,8 @@
'NAME': 'dlopen',
'TYPE': 'main',
'SOURCES': ['dlopen.cc'],
- 'LIBS': ['nacl_io', 'dl', 'ppapi_cpp', 'ppapi', 'pthread']
+ 'DEPS': ['nacl_io', 'ppapi_cpp'],
+ 'LIBS': ['dl', 'ppapi', 'pthread']
},
{
'NAME' : 'eightball',
diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk
index 3a1aee7..d046714 100644
--- a/native_client_sdk/src/tools/nacl_gcc.mk
+++ b/native_client_sdk/src/tools/nacl_gcc.mk
@@ -162,22 +162,29 @@ else
ARCHES ?= ${VALID_ARCHES}
endif
+GLIBC_REMAP :=
+
#
# SO Macro
#
+# As well as building and installing a shared library this rule adds dependencies
+# on the library's .stamp file in STAMPDIR. However, the rule for creating the stamp
+# file is part of LIB_RULE, so users of the DEPS system are currently required to
+# use the LIB_RULE macro as well as the SO_RULE for each shared library.
+#
# $1 = Target Name
# $2 = List of Sources
# $3 = List of LIBS
# $4 = List of DEPS
# $5 = 1 => Don't add to NMF.
#
-GLIBC_REMAP :=
define SO_RULE
ifneq (,$(findstring x86_32,$(ARCHES)))
all: $(OUTDIR)/lib$(1)_x86_32.so
$(OUTDIR)/lib$(1)_x86_32.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32_pic)) $(4)
$(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter-out $(4),$$^) -shared -m32 $(LD_X86_32) $$(LD_FLAGS) $(foreach lib,$(3),-l$(lib)))
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so
install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so
$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so: $(OUTDIR)/lib$(1)_x86_32.so
$(MKDIR) -p $$(dir $$@)
@@ -193,6 +200,7 @@ all: $(OUTDIR)/lib$(1)_x86_64.so
$(OUTDIR)/lib$(1)_x86_64.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64_pic)) $(4)
$(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter-out $(4),$$^) -shared -m64 $(LD_X86_64) $$(LD_FLAGS) $(foreach lib,$(3),-l$(lib)))
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so
install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so
$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so: $(OUTDIR)/lib$(1)_x86_64.so
$(MKDIR) -p $$(dir $$@)
@@ -204,7 +212,6 @@ endif
endif
endef
-
#
# LIB Macro
#
@@ -214,13 +221,8 @@ endef
# $4 = VC Link Flags (unused)
#
define LIB_RULE
-$(STAMPDIR)/$(1).stamp: $(OUTDIR)/lib$(1)_x86_32.a
-$(STAMPDIR)/$(1).stamp: $(OUTDIR)/lib$(1)_x86_64.a
-ifneq ($(TOOLCHAIN),glibc)
-$(STAMPDIR)/$(1).stamp: $(OUTDIR)/lib$(1)_arm.a
-endif
-
$(STAMPDIR)/$(1).stamp:
+ @echo " STAMP $$@"
@echo "TOUCHED $$@" > $(STAMPDIR)/$(1).stamp
ifneq (,$(findstring x86_32,$(ARCHES)))
@@ -229,6 +231,7 @@ $(OUTDIR)/lib$(1)_x86_32.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32)
$(MKDIR) -p $$(dir $$@)
$(call LOG,LIB ,$$@,$(X86_32_LIB) -cr $$@ $$^)
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a
install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a
$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a: $(OUTDIR)/lib$(1)_x86_32.a
$(MKDIR) -p $$(dir $$@)
@@ -241,6 +244,7 @@ $(OUTDIR)/lib$(1)_x86_64.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64)
$(MKDIR) -p $$(dir $$@)
$(call LOG,LIB ,$$@,$(X86_64_LIB) -cr $$@ $$^)
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a
install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a
$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a: $(OUTDIR)/lib$(1)_x86_64.a
$(MKDIR) -p $$(dir $$@)
@@ -254,6 +258,7 @@ $(OUTDIR)/lib$(1)_arm.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm))
$(MKDIR) -p $$(dir $$@)
$(call LOG,LIB ,$$@,$(ARM_LIB) -cr $$@ $$^)
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a
install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a
$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a: $(OUTDIR)/lib$(1)_arm.a
$(MKDIR) -p $$(dir $$@)