summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmake/calcdep.pl22
1 files changed, 11 insertions, 11 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index 66eb4f3dc..b1102cfc1 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -30,7 +30,10 @@ BEGIN {
use strict;
use warnings FATAL => qw(all);
-use POSIX qw(getcwd);
+use constant {
+ BUILDPATH => $ENV{BUILDPATH},
+ SOURCEPATH => $ENV{SOURCEPATH}
+};
sub find_output;
sub gendep($);
@@ -45,16 +48,14 @@ run;
exit 0;
sub run() {
- my $build = $ENV{BUILDPATH};
- mkdir $build;
- chdir $build or die "Could not open build directory: $!";
+ mkdir BUILDPATH;
+ chdir BUILDPATH or die "Could not open build directory: $!";
unlink 'include';
- symlink "$ENV{SOURCEPATH}/include", 'include';
+ symlink "${\SOURCEPATH}/include", 'include';
mkdir $_ for qw/bin modules obj/;
- $build = getcwd();
open MAKE, '>real.mk' or die "Could not write real.mk: $!";
- chdir "$ENV{SOURCEPATH}/src";
+ chdir "${\SOURCEPATH}/src";
if ($ENV{PURE_STATIC}) {
run_static();
@@ -65,7 +66,6 @@ sub run() {
}
sub run_dynamic() {
- my $build = $ENV{BUILDPATH};
print MAKE <<END;
# DO NOT EDIT THIS FILE
# It is autogenerated by make/calcdep.pl, and will be overwritten
@@ -92,7 +92,7 @@ END
for my $file (sort readdir $coremoddir) {
next if $file =~ /^\./;
if ($file =~ /^core_/ && -d "coremods/$file" && dep_dir "coremods/$file", "modules/$file") {
- mkdir "$build/obj/$file";
+ mkdir "${\BUILDPATH}/obj/$file";
push @cmodlist, "modules/$file.so";
}
if ($file =~ /^core_.*\.cpp$/) {
@@ -111,7 +111,7 @@ END
symlink "extra/$file", "modules/$file";
}
if ($file =~ /^m_/ && -d "modules/$file" && dep_dir "modules/$file", "modules/$file") {
- mkdir "$build/obj/$file";
+ mkdir "${\BUILDPATH}/obj/$file";
push @modlist, "modules/$file.so";
}
if ($file =~ /^m_.*\.cpp$/) {
@@ -159,7 +159,7 @@ END
<modules/*.cpp>, <modules/m_*/*.cpp>, "threadengines/threadengine_pthread.cpp") {
my $out = find_output $file, 1;
if ($out =~ m#obj/([^/]+)/[^/]+.o$#) {
- mkdir "$ENV{BUILDPATH}/obj/$1";
+ mkdir "${\BUILDPATH}/obj/$1";
}
dep_cpp $file, $out, 'gen-o';
next if $file =~ m#^socketengines/# && $file ne "socketengines/socketengine_$ENV{SOCKETENGINE}.cpp";