X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fcalcdep.pl;h=2ae03cc364c22681e3bfd9d02c42817ed4d8c22b;hb=b4b66ad9600ff64b62bbfeabc8dc2579918b77b3;hp=587bd64dea63d48858606359345a71801dda8f0c;hpb=19487dbebc520450e457472b97d9e7bcd5160c00;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/calcdep.pl b/make/calcdep.pl index 587bd64de..2ae03cc36 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl use strict; use warnings; use POSIX qw(getcwd); @@ -100,7 +100,7 @@ commands: $cmds modules: $mods -.PHONY: inspircd commands modules +.PHONY: all bad-target inspircd commands modules END } @@ -120,20 +120,28 @@ bad-target: all: inspircd END - my @deps; + my(@deps, @srcs); for my $file (<*.cpp>, , , , , , "threadengines/threadengine_pthread.cpp") { my $out = find_output $file, 1; + if ($out =~ m#obj/([^/]+)/[^/]+.o$#) { + mkdir "$ENV{BUILDPATH}/obj/$1"; + } dep_cpp $file, $out; next if $file =~ m#^socketengines/# && $file ne "socketengines/$ENV{SOCKETENGINE}.cpp"; push @deps, $out; + push @srcs, $file; } my $core_mk = join ' ', @deps; + my $core_src = join ' ', @srcs; print MAKE < +obj/ld-extra.cmd: $core_src + \@\$(SOURCEPATH)/make/unit-cc.pl -f\$(VERBOSE) \$\@ \$^ \$> + +bin/inspircd: obj/ld-extra.cmd $core_mk + \@\$(SOURCEPATH)/make/unit-cc.pl -l\$(VERBOSE) \$\@ \$^ \$> inspircd: bin/inspircd