]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Work around BSD make chdir bug with symlinks
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 28 Sep 2009 15:39:46 +0000 (15:39 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Mon, 28 Sep 2009 15:39:46 +0000 (15:39 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11775 e03df62e-2008-0410-955e-edbf42e46eb7

make/calcdep.pl

index ad25875cfe782474c5dc37f35ff9c6915bfe84f2..8cc2632e3ef20129216aa454a61021d33b14e5f8 100755 (executable)
@@ -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;