diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2006-08-31 16:35:56 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2006-08-31 16:35:56 -0700 |
commit | ae00b25c2d3cb4ccca19d197bba285ebca7896a5 (patch) | |
tree | 92aa510b092d123c38ea7cee581cd27efd47d290 | |
parent | 60afcd8be0160ea0420df3b93a07f258952cb135 (diff) | |
download | mediapointer-dvb-s2-ae00b25c2d3cb4ccca19d197bba285ebca7896a5.tar.gz mediapointer-dvb-s2-ae00b25c2d3cb4ccca19d197bba285ebca7896a5.tar.bz2 |
Create dependencies for Kconfig file
From: Trent Piepho <xyzzy@speakeasy.org>
Add the ability to the make_kconfig.pl script to create a file
named ".kconfig.dep" which can be included in a Makefile and defines the
dependencies of the v4l/Kconfig file. That is, all the individual
Kconfig files that were used to make it.
Added a rule to v4l/Makefile to remake Kconfig when needed, and include
.kconfig.deps to get Kconfig's dependencies. Adjust the config targets
so that they depend on Kconfig, rather than including the commands to
create Kconfig in the config targets' scripts. The config targets no
longer depend on .version, as they don't need it themselves. Rather,
it's Kconfig that needs .version, so it's made one of Kconfig's
dependencies.
Add Kconfig as a dependency to .myconfig, it should be there since the
make_myconfig.pl script uses Kconfig.
Now if you change any of the Kconfig files, the v4l/Kconfig file will
automatically get remade. This will in turn cause .myconfig to be
re-made, and any new options will appear in .myconfig (turned off).
Ideally this should trigger some kind of oldconfig system to update
.config.
Fix the .version rule so that instead of re-creating .version every time,
it is only created when it didn't already exist. Since Kconfig depends
on .version, it was getting re-created every time too. If .version
existed, it would just get re-created to the same thing anyway.
Stop echoing the echo srcdir command itself and don't echo anything if
SRCDIR is blank.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-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}; } |