diff options
-rw-r--r-- | v4l/Makefile | 24 | ||||
-rwxr-xr-x | v4l/scripts/make_kconfig.pl | 21 |
2 files changed, 32 insertions, 13 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index bed3a0e42..cd3c8312c 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -31,12 +31,13 @@ endif # default compilation rule default:: config-compat.h Makefile.media links .version - echo srcdir $(SRCDIR) + @if [ "x$(SRCDIR)" != x ]; then echo SRCDIR is $(SRCDIR) ; fi $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules ./scripts/rmmod.pl check ################################################# # Object specific rules +-include $(obj)/.kconfig.dep -include $(obj)/.myconfig -include $(obj)/Makefile.media -include $(obj)/Makefile.sound @@ -143,7 +144,7 @@ remove rminstall:: media-rminstall ivtv-rminstall ################################################# # Compiling preparation rules -.version:: +.version: ifneq ($(KERNELRELEASE),) @echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version ifneq ($(SRCDIR),) @@ -226,7 +227,8 @@ clean:: distclean:: clean -rm -f .version .*.o.flags .*.o.d Makefile.media \ - Kconfig Kconfig.kern .config .config.cmd .myconfig + Kconfig Kconfig.kern .config .config.cmd .myconfig \ + .kconfig.dep -rm -rf .tmp_versions -rm -f scripts/lxdialog scripts/kconfig @find .. -name '*.orig' -exec rm '{}' \; @@ -261,26 +263,26 @@ LXDIALOG_DIR := $(shell if [ -d $(KDIR)/scripts/kconfig/lxdialog ]; then echo kc LXDIALOG_LNK := $(if $(LXDIALOG_DIR),scripts/kconfig,scripts/lxdialog) LXDIALOG := $(KDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog -.myconfig : .config +.myconfig: .config Kconfig ./scripts/make_myconfig.pl -xconfig:: links .version $(QCONF) +Kconfig: .version ./scripts/make_kconfig.pl $(KDIR) + +xconfig:: links $(QCONF) Kconfig $(QCONF) Kconfig -gconfig:: links .version $(GCONF) - ./scripts/make_kconfig.pl $(KDIR) +gconfig:: links $(GCONF) Kconfig $(QCONF) Kconfig -config:: links .version $(CONF) - ./scripts/make_kconfig.pl $(KDIR) +config:: links $(CONF) Kconfig $(CONF) Kconfig -menuconfig:: links .version $(MCONF) lxdialog - ./scripts/make_kconfig.pl $(KDIR) +menuconfig:: links $(MCONF) lxdialog Kconfig $(MCONF) Kconfig allyesconfig allmodconfig:: links .version + @echo "Creating default .config file" ./scripts/make_kconfig.pl $(KDIR) 1 # rule to build kernel conf programs diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 066df6a0e..a9db697e9 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -182,14 +182,25 @@ sub deps_ok($) return $ok; } +# List of all kconfig files read in, could be used to make dependencies +# for the output combined Kconfig file. +my @kconfigfiles = (); + +# Read and parse a Kconfig file. First base of source directory tree the +# second is the file (with path). Recursivly parses Kconfig files from +# 'source' directives. + +# Prints to OUT a combined version of all the Kconfig files. This file +# is edited slightly to disable options that need a newer kernel. sub open_kconfig($$) { my ($dir,$file)=@_; my $in = new FileHandle; my $disabled=0; my $key; -print "opening $file\n" if $debug; - open $in,"$file" or die "File not found: $file"; + print "Opening $file\n" if $debug; + open $in, "$file" or die "File not found: $file"; + push @kconfigfiles, $file; while (<$in>) { # start of a new stanza, reset if (m/^\w/) { @@ -367,6 +378,12 @@ open_kconfig (".","./Kconfig.sound"); print OUT "source Kconfig.sound\n"; close OUT; +# Create make dependency rule for the Kconfig +open OUT, '>.kconfig.dep' or die "Cannot write .kconfig.dep"; +print OUT "Kconfig: "; +print OUT join(" \\\n\t", @kconfigfiles), "\n"; +close OUT; + while ( my ($key, $value) = each(%config) ) { delete $depend{$key}; } |