summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-28 15:39:46 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-28 15:39:46 +0000
commit5e1d239f3d94bd1afd3ce64c2f47a64305f1e1f0 (patch)
tree611f786a20f4b0f60fb21ae84a67644b22d55306 /make
parentd811ffeda29eff11fb0a381f5f17b6d65ae0460b (diff)
Work around BSD make chdir bug with symlinks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11775 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make')
-rwxr-xr-xmake/calcdep.pl12
1 files changed, 7 insertions, 5 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index ad25875cf..8cc2632e3 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -18,10 +18,12 @@ sub run() {
my $build = $ENV{BUILDPATH};
mkdir $build;
chdir $build or die "Could not open build directory: $!";
- mkdir 'bin';
- mkdir 'obj';
- mkdir 'modules';
symlink "$ENV{SOURCEPATH}/include", 'include';
+ mkdir $_ for qw/bin modules obj/;
+# BSD make has a horribly annoying bug resulting in an extra chdir of the make process
+# Create symlinks to work around it
+ symlink "../$_", "obj/$_" for qw/bin modules obj/;
+
$build = getcwd();
open MAKE, '>real.mk' or die "Could not write real.mk: $!";
chdir "$ENV{SOURCEPATH}/src";
@@ -73,7 +75,7 @@ END
print MAKE <<END;
bin/inspircd: $core_mk
- cd \$(BUILDPATH); \$(RUNCC) -o \$\@ \$(CORELDFLAGS) \$(LDLIBS) \$^ \$>
+ \$(RUNCC) -o \$\@ \$(CORELDFLAGS) \$(LDLIBS) \$^ \$>
inspircd: bin/inspircd
modules: $mods
@@ -154,7 +156,7 @@ sub dep_dir($) {
closedir DIR;
if (@ofiles) {
my $ofiles = join ' ', @ofiles;
- print MAKE "$dir.so: $ofiles\n\tcd \$(BUILDPATH); \$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^ \$>\n";
+ print MAKE "$dir.so: $ofiles\n\t\$(RUNCC) \$(PICLDFLAGS) -o \$\@ \$^ \$>\n";
return 1;
} else {
return 0;