diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-01 15:06:11 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-01 15:06:11 +0000 |
commit | facb1eb98f911b3e3811ad9cebaf221931ee9c7a (patch) | |
tree | 2330b4e20ad0416205959c67baa89903e8c637f1 /make/calcdep.pl | |
parent | c835102e640db1481bcc78cdebc7f875d996d9c9 (diff) |
Replace special treatment of spanningtree module directory with a generic directory build
This allows "make M=m_spanningtree" to work on a clean build tree
It also allows for other complex modules to be created (i.e. m_services)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11567 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/calcdep.pl')
-rwxr-xr-x | make/calcdep.pl | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl index 92d2cc3e0..8d85e6463 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -32,16 +32,31 @@ sub gendep { } for my $file (@ARGV) { - next unless $file =~ /cpp$/; - gendep $file; - my($path,$base) = $file =~ m#^((?:.*/)?)([^/]+)\.cpp#; - my $cmd = "$path.$base.d"; - my $ext = $path eq 'modules/' || $path eq 'commands/' ? '.so' : '.o'; - my $out = "$path$base$ext"; + if (-e $file && $file =~ /cpp$/) { + gendep $file; + my($path,$base) = $file =~ m#^((?:.*/)?)([^/]+)\.cpp#; + my $cmd = "$path.$base.d"; + my $ext = $path eq 'modules/' || $path eq 'commands/' ? '.so' : '.o'; + my $out = "$path$base$ext"; - open OUT, '>', $cmd; - print OUT "$out: $file $f2dep{$file}\n"; - print OUT "\t@../make/unit-cc.pl \$(VERBOSE) $file $out\n"; - print OUT "$cmd: $file $f2dep{$file}\n"; - print OUT "\t../make/calcdep.pl $file\n"; + open OUT, '>', $cmd; + print OUT "$out: $file $f2dep{$file}\n"; + print OUT "\t@../make/unit-cc.pl \$(VERBOSE) $file $out\n"; + print OUT "$cmd: $file $f2dep{$file}\n"; + print OUT "\t../make/calcdep.pl $file\n"; + } elsif (-d $file && $file =~ m#^(.*?)([^/]+)/?$#) { + my($path,$base) = ($1,$2); + my $cmd = "$path.$base.d"; + my $out = "$path$base.so"; + opendir DIR, $file; + my $ofiles = join ' ', grep s#(.*)\.cpp$#$path$base/$1.o#, readdir DIR; + closedir DIR; + open OUT, '>', $cmd; + print OUT "$out: $ofiles\n\t".'$(RUNCC) $(FLAGS) $(PICLDFLAGS) -o $@ ' + .$ofiles."\n"; + print OUT "$cmd: $file\n\t".'@../make/calcdep.pl '."$path$base\n"; + } else { + print "Cannot generate depencency for $file\n"; + exit 1; + } } |