[PATCH] fix kbuild module names (was: Re: oom-killer problem)

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

 



hi

had a look again. this one on top of "kbuild: fix make -rR breakage" (ie. revert
the revert) should fix the module nameing.

Sam if you agree, please add your signed-off-by and forward to Linus.

rgds
-daniel

---

[PATCH] kbuild: fix module names

commit e5c44fd88c146755da6941d047de4d97651404a9 (kbuild: fix make -rR breakage)
replaced the usage of the $(*F) variable with $(basetarget) which is defined as
	 basetarget = $(basename $(notdir $@))
to get the same, but without using the stem $(*F) because make not always
correctly supplys it. the problem are the module names which depend on the name
of 'foo.mod.o'. the original usage of the stem $(*F) gave 'foo' in this case, but
the new $(basetarget) does not. example from a
	make -p SUBDIRS=drivers/pcmcia modules

	drivers/pcmcia/pcmcia.mod.o: drivers/pcmcia/pcmcia.mod.c FORCE
	#  Implicit rule search has not been done.
	#  Implicit/static pattern stem: `drivers/pcmcia/pcmcia'
	#  Last modified 2006-06-28 16:00:14
	#  File has been updated.
	#  Successfully updated.
	# automatic
	# @ := drivers/pcmcia/pcmcia.mod.o
	# automatic
	# % :=
	# automatic
	# * := drivers/pcmcia/pcmcia
	[snip]

so the stem for 'drivers/pcmcia/pcmcia.mod.o' is just 'drivers/pcmcia/pcmcia' which
gives the correct module name. so to get back the "old" behaviour without using the
stem do an additional patsubst to get rid of the '.mod'

Signed-off-by: Daniel Ritz <[email protected]>

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index ac5f275..af3c1b6 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -15,7 +15,7 @@ depfile = $(subst $(comma),_,$(@D)/.$(@F
 ###
 # basetarget equals the filename of the target with no extension.
 # So 'foo/bar.o' becomes 'bar'
-basetarget = $(basename $(notdir $@))
+basetarget = $(patsubst %.mod,%,$(basename $(notdir $@)))
 
 ###
 # Escape single quote for use in echo statements



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux