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 c3227985c1c9d84fd77bc5143a11d192e15bad25..f43ed63e5f1bedd7c772379c6ef90d6f2212bca7 100644 |
--- a/native_client_sdk/src/tools/common.mk |
+++ b/native_client_sdk/src/tools/common.mk |
@@ -379,12 +379,16 @@ endif |
# |
# Convert a source path to a object file path. |
+# If source path is absolute then just use the basename of for the object |
+# file name (absolute sources paths with the same basename are not allowed). |
+# For relative paths use the full path to the source in the object file path |
+# name. |
# |
# $1 = Source Name |
# $2 = Arch suffix |
# |
define SRC_TO_OBJ |
-$(OUTDIR)/$(basename $(subst ..,__,$(1)))$(2).o |
+$(if $(filter /%,$(1)), $(OUTDIR)/$(basename $(notdir $(1)))$(2).o, $(OUTDIR)/$(basename $(subst ..,__,$(1)))$(2).o) |
endef |