diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2006-09-03 06:11:28 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2006-09-03 06:11:28 -0700 |
commit | 2c18ae81f3896cdfad3471781d3c8aaaaa0bbe80 (patch) | |
tree | 77841d259bf0fd2050f364c30ab6493b0a8c4f8b /v4l/Makefile | |
parent | 7f333ce6d8e31fc39b9f25440c458200687918ef (diff) | |
download | mediapointer-dvb-s2-2c18ae81f3896cdfad3471781d3c8aaaaa0bbe80.tar.gz mediapointer-dvb-s2-2c18ae81f3896cdfad3471781d3c8aaaaa0bbe80.tar.bz2 |
Keep rules in v4l/Makefile from confusing kernel
From: Trent Piepho <xyzzy@speakeasy.org>
v4l/Makefile not only calls the kernel Makefile to do the module
building, but it is in turn included by the kernel Makefile. This means
_all_ the rules in v4l/Makefile get used by the kernel Makefile when it
tries to build the modules. Some of these rules, for files like .config,
Kconfig, .version, confuse the kernel building process. The kernel make
thinks, "I need to remake _my_ Kconfig file because my .version file is
out of date." But that rule was never supposed to be used by the kernel,
it is just for v4l!
This is fixed by putting $(obj) in front of all these files' rules. That
way the kernel will never think the rules refer to its files and try to
use them.
Really, this whole business of having the kernel Makefile include
v4l/Makefile is rather complex. It might be a good idea to create
v4l/Kbuild, which the kernel will use in preference to v4l/Makefile, so
that we don't have to worry about v4l/Makefile getting used in two
different contexts.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l/Makefile')
-rw-r--r-- | v4l/Makefile | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index f9af44703..afea31ea8 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -30,7 +30,7 @@ endif ################################################# # default compilation rule -default:: config-compat.h Makefile.media links .version oss +default:: config-compat.h Makefile.media links $(obj)/.version oss @if [ "x$(SRCDIR)" != x ]; then echo SRCDIR is $(SRCDIR) ; fi $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules ./scripts/rmmod.pl check @@ -74,7 +74,7 @@ endif # make will try to automatically rebuild the Makefile and all includes, # and if any of them change, make will start over with the updated files -.myconfig: .config Kconfig +$(obj)/.myconfig: $(obj)/.config $(obj)/Kconfig ./scripts/make_myconfig.pl # If it doesn't exist, this rule will build Makefile.media. If it does @@ -184,7 +184,7 @@ remove rminstall:: media-rminstall ivtv-rminstall ################################################# # Compiling preparation rules -.version: +$(obj)/.version: ifneq ($(KERNELRELEASE),) @echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version ifneq ($(SRCDIR),) @@ -308,12 +308,12 @@ LXDIALOG := $(KDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog # without destroying the user's configuration. Lacking that, we will # just touch .config if it already exists, and run make_kconfig if it # doesn't. -.config: .version +$(obj)/.config: $(obj)/.version @echo Updating/Creating .config - @if [ -e .config ]; then touch .config ; else \ + @if [ -e $(obj)/.config ]; then touch $(obj)/.config ; else \ ./scripts/make_kconfig.pl $(KDIR) ; fi -Kconfig: .version +$(obj)/Kconfig: $(obj)/.version ./scripts/make_kconfig.pl $(KDIR) # With make -j, it's possible that both the .config and Kconfig rules @@ -321,19 +321,19 @@ Kconfig: .version # doesn't appear to be any way around this, but it doesn't cause a # failure. One make_kconfig.pl will just overwrite the other's output. -xconfig:: $(QCONF) Kconfig - $(QCONF) Kconfig +xconfig:: $(QCONF) $(obj)/Kconfig + $(QCONF) $(obj)/Kconfig -gconfig:: $(GCONF) Kconfig - $(QCONF) Kconfig +gconfig:: $(GCONF) $(obj)/Kconfig + $(QCONF) $(obj)/Kconfig -config:: $(CONF) Kconfig - $(CONF) Kconfig +config:: $(CONF) $(obj)/Kconfig + $(CONF) $(obj)/Kconfig -menuconfig:: $(MCONF) lxdialog Kconfig - $(MCONF) Kconfig +menuconfig:: $(MCONF) lxdialog $(obj)/Kconfig + $(MCONF) $(obj)/Kconfig -allyesconfig allmodconfig:: .version +allyesconfig allmodconfig:: $(obj)/.version ./scripts/make_kconfig.pl $(KDIR) 1 # rule to build kernel conf programs |