summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--Makefile.test53
-rw-r--r--Rules.make9
-rwxr-xr-xscripts/deps.pl73
3 files changed, 100 insertions, 35 deletions
diff --git a/Makefile.test b/Makefile.test
index 526aa5d..3311cde 100644
--- a/Makefile.test
+++ b/Makefile.test
@@ -7,20 +7,5 @@ export QMAKESPEC=$(QMAKESPECSDIR)/qws/linux-generic-g++
7 7
8# The following are config.in's which are generated, to avoid numerous manual edits when 8all :
9# adding packages to the build.
10#
11# NOTE: There currently exists a bug regarding this, the toplevel config.in -must- be created
12# -after- the lower level config.ins, as makecfg.pl does a find for config.in files!
13#
14# solution: generate this list and stuff into .depends, and also
15# generate config.in interdependencies (i.e. topdir config.in depends on
16# config.ins within dirs below it. dependencies are solely dir structure
17# driven)
18 9
19configs = $(TOPDIR)/x11/ipc/server/config.in $(TOPDIR)/x11/ipc/config.in $(TOPDIR)/x11/config.in $(TOPDIR)/noncore/unsupported/opiemail/ifaces/config.in $(TOPDIR)/noncore/unsupported/config.in $(TOPDIR)/noncore/tools/config.in $(TOPDIR)/noncore/tools/calc2/config.in $(TOPDIR)/noncore/todayplugins/config.in $(TOPDIR)/noncore/styles/config.in $(TOPDIR)/noncore/settings/config.in $(TOPDIR)/noncore/net/opietooth/config.in $(TOPDIR)/noncore/net/config.in $(TOPDIR)/noncore/multimedia/config.in $(TOPDIR)/noncore/graphics/config.in $(TOPDIR)/noncore/games/config.in $(TOPDIR)/noncore/decorations/config.in $(TOPDIR)/noncore/config.in $(TOPDIR)/noncore/comm/config.in $(TOPDIR)/noncore/apps/config.in $(TOPDIR)/noncore/applets/config.in $(TOPDIR)/libsql/config.in $(TOPDIR)/libopie/pim/config.in $(TOPDIR)/libopie/ofileselector/config.in $(TOPDIR)/inputmethods/config.in $(TOPDIR)/development/config.in $(TOPDIR)/core/settings/config.in $(TOPDIR)/core/pim/today/plugins/config.in $(TOPDIR)/core/pim/config.in $(TOPDIR)/core/multimedia/config.in $(TOPDIR)/core/config.in $(TOPDIR)/core/apps/config.in $(TOPDIR)/core/applets/restartapplet2/config.in $(TOPDIR)/core/applets/config.in $(TOPDIR)/config.in 10clean-configs : $(TOPDIR)/.depends
20
21all : configs
22
23configs : $(shell echo $(configs) | sort -r)
24
25clean-configs :
26 @echo "Wiping generated config.in files..." 11 @echo "Wiping generated config.in files..."
@@ -28,8 +13,17 @@ clean-configs :
28 13
29./.config: 14-include $(TOPDIR)/.config
15-include $(TOPDIR)/..config.cmd
16-include $(TOPDIR)/.depends
17
18all : $(TOPDIR)/.depends $(configs) $(subdir-y)
19
20./.config: $(configs)
30 $(call descend,scripts/kconfig,conf) 21 $(call descend,scripts/kconfig,conf)
31 @$(MAKE) -C scripts/kconfig conf 22 @if [ ! -e $@ ]; then \
23 cp $(TOPDIR)/def-configs/opie $@; \
24 fi;
25 @$(MAKE) -C scripts/kconfig conf;
32 ./scripts/kconfig/conf -s ./config.in 26 ./scripts/kconfig/conf -s ./config.in
33 27
34xconfig: 28xconfig: $(configs)
35 $(call descend,scripts/kconfig,qconf) 29 $(call descend,scripts/kconfig,qconf)
@@ -37,3 +31,3 @@ xconfig:
37 31
38menuconfig: scripts/lxdialog/lxdialog 32menuconfig: $(configs) scripts/lxdialog/lxdialog
39 $(call descend,scripts/kconfig,mconf) 33 $(call descend,scripts/kconfig,mconf)
@@ -41,3 +35,3 @@ menuconfig: scripts/lxdialog/lxdialog
41 35
42config: 36config: $(configs)
43 $(call descend,scripts/kconfig,conf) 37 $(call descend,scripts/kconfig,conf)
@@ -45,3 +39,3 @@ config:
45 39
46oldconfig: 40oldconfig: $(configs)
47 $(call descend,scripts/kconfig,conf) 41 $(call descend,scripts/kconfig,conf)
@@ -49,3 +43,3 @@ oldconfig:
49 43
50randconfig: 44randconfig: $(configs)
51 $(call descend,scripts/kconfig,conf) 45 $(call descend,scripts/kconfig,conf)
@@ -53,3 +47,3 @@ randconfig:
53 47
54allyesconfig: 48allyesconfig: $(configs)
55 $(call descend,scripts/kconfig,conf) 49 $(call descend,scripts/kconfig,conf)
@@ -57,3 +51,3 @@ allyesconfig:
57 51
58allnoconfig: 52allnoconfig: $(configs)
59 $(call descend,scripts/kconfig,conf) 53 $(call descend,scripts/kconfig,conf)
@@ -61,3 +55,3 @@ allnoconfig:
61 55
62defconfig: 56defconfig: $(configs)
63 $(call descend,scripts/kconfig,conf) 57 $(call descend,scripts/kconfig,conf)
@@ -65,7 +59,2 @@ defconfig:
65 59
66-include $(TOPDIR)/.config
67-include $(TOPDIR)/..config.cmd
68-include $(TOPDIR)/.depends
69
70all : $(TOPDIR)/.depends $(subdir-y)
71 60
diff --git a/Rules.make b/Rules.make
index 362659a..74e74fd 100644
--- a/Rules.make
+++ b/Rules.make
@@ -5,3 +5,4 @@ $(configs) :
5 5
6$(TOPDIR)/.depends : $(TOPDIR)/config.in 6$(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;)
7 @echo Generating dependency information...
7 # add to subdir-y, and add descend rules 8 # add to subdir-y, and add descend rules
@@ -19,4 +20,6 @@ $(TOPDIR)/.depends : $(TOPDIR)/config.in
19 # generation of config.in files, and config.in interdependencies 20 # generation of config.in files, and config.in interdependencies
20 find ./ -name config.in | ( for cfg in `cat`; do dir=`dirname $cfg`; name=`basename $dir`; if [ ! -e $dir/$name.pro ]; then echo $dir; fi; done; ) > dirs 21 @find $(TOPDIR)/ -name config.in | ( for cfg in `cat`; do dir=`dirname $$cfg`; name=`basename $$dir`; if [ ! -e $$dir/$$name.pro ]; then echo $$dir; fi; done; ) > dirs
21 cat dirs | for i in `cat`; do numlines="`cat dirs|grep $i 2>/dev/null|wc -l`"; if [ "$numlines" -ne "1" ]; then deps=`cat dirs|grep $i| grep -v "^$i$"|for i in \`cat|sed -e's,^./,$(TOPDIR)/,g'\`; do echo $i/config.in; done`; echo `echo $i|sed -e 's,^./,$(TOPDIR)/,'` : $deps; fi; done; 22 @echo "configs += `echo \`cat dirs | sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g' -e's,$$,/config.in,g'\``" >> .depends
23 @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $(TOPDIR)/.depends
24 @-rm -f dirs
22 25
diff --git a/scripts/deps.pl b/scripts/deps.pl
new file mode 100755
index 0000000..56c4e77
--- a/dev/null
+++ b/scripts/deps.pl
@@ -0,0 +1,73 @@
1#!/usr/bin/perl -w
2
3use strict;
4
5my %depends;
6my %tokenpath;
7
8sub getdepends ($$)
9{
10 my ($token, $path, $intoken);
11 $token = shift || return;
12 $token =~ s/CONFIG_//;
13 $path = shift || return;
14#print "opening $path/config.in\n";
15 #print "token is $token\n";
16 open( FILE, "< $path/config.in" ) || return;
17 $intoken = 0;
18 while( <FILE> ) {
19 if( $intoken == 1 ) {
20 /depends\S*(.*)/ && return $1;
21 if( /\S*(config|menu)/ ) {
22 $intoken = 0;
23 return;
24 }
25 } else {
26 /$token/ || next;
27 $intoken = 1;
28 }
29 /$token/ || next;
30 }
31 close( FILE );
32 return;
33}
34
35sub makedepends ($$)
36{
37 my ($depends, $tokenpath, $token, $depword, $mustbesep, $state);
38 $depends = shift || return;
39 $tokenpath = shift || return;
40 $mustbesep = 0;
41
42 for $token (keys %$depends){
43 print ${$tokenpath}{$token} . " : ";
44 for (split(/\s+/, ${$depends}{$token})){
45 /^\s+$/ && next;
46 /\&\&/ && next;
47 /\|\|/ && next;
48 /^$/ && next;
49 if(defined(${$tokenpath}{"CONFIG_" . $_})){
50 print '$(if $(CONFIG_' . $_ . '),' . ${$tokenpath}{"CONFIG_" . $_} . ') ';
51 } else {
52 print STDERR "ERROR in dependency generation, unable to locate path for token CONFIG_$_\n";
53 }
54 }
55 print "\n";
56 }
57}
58
59while( <> ) {
60 my $dep;
61 my ($token, $path, $pro);
62 chomp;
63 s/^\s*//g;
64 s/\s*$//g;
65 ($token, $path, $pro) = split(/\s+/,$_);
66 $tokenpath{$token} = $path;
67 $dep = getdepends($token, $path);
68 if( $dep ) {
69 $depends{$token} = $dep;
70 }
71}
72
73makedepends(\%depends, \%tokenpath);