[PATCH] let kbuild mkdir for dir/file.o

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Last week I send this patch, but no reply.
Now I try to explain it clearly:

When I 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 flowwing 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 appearantly that the target dir not created for file.o

I 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)

Anybody Anyidea?

张忠山 (1):
  let kbuild mkdir for dir/file.o

 scripts/Makefile.lib |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux