diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-17 14:13:17 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-17 14:13:17 +0000 |
commit | 05b111d6a245725c81a314794fb95e8375fb6720 (patch) | |
tree | 54553740e0b831fa65926aa9aef093e7bc490733 /make/calcdep.pl | |
parent | 3a186342c975a8bbd3f588d180a55e381b31883c (diff) |
Update make help, configure, and fix build of empty m_* directories
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11739 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/calcdep.pl')
-rwxr-xr-x | make/calcdep.pl | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl index 1a65f836b..05199569c 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict; use warnings; -use Getopt::Long; +use POSIX qw(getcwd); sub find_output($); sub gendep($); @@ -22,8 +22,7 @@ sub run() { mkdir 'obj'; mkdir 'modules'; symlink "$ENV{SOURCEPATH}/include", 'include'; - $build = `pwd`; - chomp $build; + $build = getcwd(); open MAKE, '>real.mk' or die "Could not write real.mk: $!"; chdir "$ENV{SOURCEPATH}/src"; @@ -52,9 +51,10 @@ END opendir my $moddir, 'modules'; for my $dir (readdir $moddir) { next unless $dir =~ /^m_/ && -d "modules/$dir"; - mkdir "$build/obj/$dir"; - dep_dir "modules/$dir"; - push @modlist, "modules/$dir.so"; + if (dep_dir "modules/$dir") { + mkdir "$build/obj/$dir"; + push @modlist, "modules/$dir.so"; + } } my $core_mk = join ' ', @core_deps; @@ -141,7 +141,12 @@ sub dep_dir($) { push @ofiles, $ofile; } closedir DIR; - my $ofiles = join ' ', @ofiles; - print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^\n"; + if (@ofiles) { + my $ofiles = join ' ', @ofiles; + print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^\n"; + return 1; + } else { + return 0; + } } |