X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fcalcdep.pl;h=2348edcebdd9f043ba121300281068e39548ae7a;hb=05e1fc8840dd783ffa65a22e0d537a1d8bdbad5c;hp=b1102cfc10553c35e4739400567ea4c112000f4c;hpb=f02e766924fb7aac0444797a67753ff2c78e5919;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/calcdep.pl b/make/calcdep.pl index b1102cfc1..2348edceb 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -77,10 +77,10 @@ bad-target: \@echo "in order to set the correct environment variables" \@exit 1 -all: inspircd coremods modules +all: inspircd modules END - my(@core_deps, @cmodlist, @modlist); + my(@core_deps, @modlist); for my $file (<*.cpp>, , , "threadengines/threadengine_pthread.cpp") { my $out = find_output $file; dep_cpp $file, $out, 'gen-o'; @@ -88,40 +88,28 @@ END push @core_deps, $out; } - opendir my $coremoddir, 'coremods'; - for my $file (sort readdir $coremoddir) { - next if $file =~ /^\./; - if ($file =~ /^core_/ && -d "coremods/$file" && dep_dir "coremods/$file", "modules/$file") { - mkdir "${\BUILDPATH}/obj/$file"; - push @cmodlist, "modules/$file.so"; - } - if ($file =~ /^core_.*\.cpp$/) { - my $out = dep_so "coremods/$file"; - push @cmodlist, $out; - } - } - - opendir my $moddir, 'modules'; - for my $file (sort readdir $moddir) { - next if $file =~ /^\./; - if (-e "modules/extra/$file" && !-l "modules/$file") { - # Incorrect symlink? - print "Replacing symlink for $file found in modules/extra\n"; - rename "modules/$file", "modules/$file~"; - symlink "extra/$file", "modules/$file"; - } - if ($file =~ /^m_/ && -d "modules/$file" && dep_dir "modules/$file", "modules/$file") { - mkdir "${\BUILDPATH}/obj/$file"; - push @modlist, "modules/$file.so"; - } - if ($file =~ /^m_.*\.cpp$/) { - my $out = dep_so "modules/$file"; - push @modlist, $out; + foreach my $directory (qw(coremods modules)) { + opendir(my $moddir, $directory); + for my $file (sort readdir $moddir) { + next if $file =~ /^\./; + if ($directory eq 'modules' && -e "modules/extra/$file" && !-l "modules/$file") { + # Incorrect symlink? + print "Replacing symlink for $file found in modules/extra\n"; + rename "modules/$file", "modules/$file~"; + symlink "extra/$file", "modules/$file"; + } + if ($file =~ /^(?:core|m)_/ && -d "$directory/$file" && dep_dir "$directory/$file", "modules/$file") { + mkdir "${\BUILDPATH}/obj/$file"; + push @modlist, "modules/$file.so"; + } + if ($file =~ /^.*\.cpp$/) { + my $out = dep_so "$directory/$file"; + push @modlist, $out; + } } } my $core_mk = join ' ', @core_deps; - my $cmods = join ' ', @cmodlist; my $mods = join ' ', @modlist; print MAKE <\n"; + print MAKE "\t@\$(SOURCEPATH)/make/unit-cc.pl link-dir\$(VERBOSE) \$\@ ${\SOURCEPATH}/src/$dir \$^ \$>\n"; return 1; } else { return 0;