summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.lib
diff options
context:
space:
mode:
author张忠山 <zzs213@126.com>2016-06-28 16:27:56 +0800
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-05 09:02:41 +0200
commit257abdaa36c87ce82fc41873c2004fe356301dad (patch)
treec9b912311e1e531bf3f42a7c1ec5abdf3926fba8 /scripts/Makefile.lib
parent992794d0d44cbe6c416972d9f75f9ca833fcbf87 (diff)
downloadbarebox-257abdaa36c87ce82fc41873c2004fe356301dad.tar.gz
barebox-257abdaa36c87ce82fc41873c2004fe356301dad.tar.xz
Do not rm the path from pbl-y target
Whan add some obj in a subdir to lwl-y or pbl-y, like this: lwl-y += subdir/test.o other.o the make process failed: make[2]: *** No rule to make target 'arch/arm/boards/boardname/test.o', \ needed by 'arch/arm/boards/boardname/built-in-pbl.o'. Stop. Note, there are not the part "subdir" in the path of the test.o. this patch fix this Signed-off-by: 张忠山 <zzs213@126.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r--scripts/Makefile.lib7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 27365d8df8..e55bc27789 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -39,10 +39,9 @@ endif
obj-y += $(obj-pbl-y)
pbl-y += $(obj-pbl-y)
-# for non dirs add pbl- prefix to the target
-# so we recompile the source with custom flags and custom quiet
-__pbl-y := $(notdir $(pbl-y))
-pbl-y := $(patsubst %.o,pbl-%.o,$(__pbl-y))
+# add pbl- prefix to the target
+pbl-y := $(shell echo $(pbl-y) | sed -e 's%\(\([^ \t]\+/\)*\)\([^ \t]*\.o\)%\2pbl-\3%g')
+
# add subdir from $(obj-y) too so we do not need to have the dir define in
# both $(obj-y) and $(pbl-y)
__pbl-y := $(filter-out $(pbl-y), $(filter %/, $(obj-y)))