diff options
author | 张忠山 <zzs213@126.com> | 2013-07-18 14:57:46 +0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-22 08:38:01 +0200 |
commit | c6d4b14ad9e020519331a3ed636b22da20feded4 (patch) | |
tree | 2458f9973889ae97b759c79e7b77c41b059c9f9f /scripts/Makefile.lib | |
parent | 0c4108f9173ece75d96f19b447ef6464bdfdf187 (diff) | |
download | barebox-c6d4b14ad9e020519331a3ed636b22da20feded4.tar.gz barebox-c6d4b14ad9e020519331a3ed636b22da20feded4.tar.xz |
create directory for dir/file.o
kbuild: create directory for dir/file.o
When add a obj with dir to obj-y, like this
obj-y += dir/file.o
The $(obj)/dir not created, this patch fix this.
When try to add a file(which in a subdir) to my board's obj-y, the build
progress crashed.
For example, I use at91rm9200ek board, and in kernel dir run:
mkdir objtree
make O=objtree at91rm9200_defconfig
mkdir arch/arm/mach-at91/dir
touch arch/arm/mach-at91/dir/file.c
and edit arch/arm/mach-at91/dir/file.c to add some code.
then edit arch/arm/mach-at91/Makefile, change the following line:
obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o
to:
obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o dir/file.o
Now build it:
make O=objtree
Then the error appears:
...
CC arch/arm/mach-at91/board-rm9200dk.o
CC arch/arm/mach-at91/board-rm9200ek.o
CC arch/arm/mach-at91/dir/file.o
linux-2.6/arch/arm/mach-at91/dir/file.c:5:
fatal error: opening dependency file
arch/arm/mach-at91/dir/.file.o.d: No such file or directory
Check the objtree:
LANG=en ls objtree/arch/arm/mach-at91/dir
ls: cannot access objtree/arch/arm/mach-at91/dir: No such file or directory
It's apparently that the target dir not created for file.o
Check kbuild source code. It seems that kbuild create dirs for that in
$(obj-dirs). But if the dir need not to create a built-in.o, It should
never in $(obj-dirs).
So I make this patch to make sure It in $(obj-dirs)
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.lib | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 307412f8d7..b3e1540989 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -70,7 +70,7 @@ subdir-obj-y := $(filter %/built-in.o, $(obj-y)) subdir-obj-y += $(__subdir-obj-y) # $(obj-dirs) is a list of directories that contain object files -obj-dirs := $(dir $(multi-objs) $(subdir-obj-y)) +obj-dirs := $(dir $(multi-objs) $(obj-y) $(pbl-y)) # Replace multi-part objects by their individual parts, look at local dir only real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y) |