summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rwxr-xr-xmake/calcdep.pl55
-rw-r--r--make/template/main.mk11
-rwxr-xr-xmake/unit-cc.pl36
3 files changed, 4 insertions, 98 deletions
diff --git a/make/calcdep.pl b/make/calcdep.pl
index f3ed04725..5dc0f6878 100755
--- a/make/calcdep.pl
+++ b/make/calcdep.pl
@@ -59,11 +59,7 @@ sub run() {
open MAKE, '>real.mk' or die "Could not write real.mk: $!";
chdir "${\SOURCEPATH}/src";
- if ($ENV{INSPIRCD_STATIC}) {
- run_static();
- } else {
- run_dynamic();
- }
+ run_dynamic();
close MAKE;
}
@@ -133,56 +129,11 @@ modules: $mods
END
}
-sub run_static() {
- print MAKE <<END;
-# DO NOT EDIT THIS FILE
-# It is autogenerated by make/calcdep.pl, and will be overwritten
-# every time you rerun make in the main directory
-VPATH = \$(SOURCEPATH)/src
-
-bad-target:
- \@echo "This Makefile must be run by a sub-make from the source"
- \@echo "in order to set the correct environment variables"
- \@exit 1
-
-all: inspircd
-
-END
- my(@deps, @srcs);
- for my $file (<*.cpp>, <socketengines/*.cpp>, <coremods/*.cpp>, <coremods/core_*/*.cpp>,
- <modules/*.cpp>, <modules/m_*/*.cpp>, "threadengines/threadengine_pthread.cpp") {
- my $out = find_output $file, 1;
- if ($out =~ m#obj/([^/]+)/[^/]+.o$#) {
- mkdir "${\BUILDPATH}/obj/$1";
- }
- dep_cpp $file, $out, 'gen-o';
- next if $file =~ m#^socketengines/# && $file ne "socketengines/socketengine_$ENV{SOCKETENGINE}.cpp";
- push @deps, $out;
- push @srcs, $file;
- }
-
- my $core_mk = join ' ', @deps;
- my $core_src = join ' ', @srcs;
- print MAKE <<END;
-
-obj/ld-extra.cmd: $core_src
- \@\$(SOURCEPATH)/make/unit-cc.pl gen-ld \$\@ \$^ \$>
-
-bin/inspircd: $core_mk obj/ld-extra.cmd
- \@\$(SOURCEPATH)/make/unit-cc.pl static-ld \$\@ \$^ \$>
-
-inspircd: bin/inspircd
-
-.PHONY: all bad-target inspircd
-
-END
-}
-
sub find_output {
- my($file, $static) = @_;
+ my $file = shift;
my($path,$base) = $file =~ m#^((?:.*/)?)([^/]+)\.cpp# or die "Bad file $file";
if ($path eq 'modules/' || $path eq 'coremods/') {
- return $static ? "obj/$base.o" : "modules/$base.so";
+ return "modules/$base.so";
} elsif ($path eq '' || $path eq 'modes/' || $path =~ /^[a-z]+engines\/$/) {
return "obj/$base.o";
} elsif ($path =~ m#modules/(m_.*)/# || $path =~ m#coremods/(core_.*)/#) {
diff --git a/make/template/main.mk b/make/template/main.mk
index 447d64b3b..071e5da73 100644
--- a/make/template/main.mk
+++ b/make/template/main.mk
@@ -120,10 +120,6 @@ ifndef INSPIRCD_VERBOSE
MAKEFLAGS += --silent
endif
-ifdef INSPIRCD_STATIC
- CORECXXFLAGS += -DINSPIRCD_STATIC
-endif
-
# Append any flags set in the environment after the base flags so
# that they can be overridden if necessary.
CORECXXFLAGS += $(CPPFLAGS) $(CXXFLAGS)
@@ -134,7 +130,6 @@ export BUILDPATH
export CORECXXFLAGS
export CORELDFLAGS
export CXX
-export INSPIRCD_STATIC
export INSPIRCD_VERBOSE
export LDLIBS
export PICLDFLAGS
@@ -178,10 +173,6 @@ debug-header:
@echo "*************************************"
mod-header:
-ifdef INSPIRCD_STATIC
- @echo 'Cannot build specific targets in pure-static build'
- @exit 1
-endif
@echo 'Building specific targets:'
mod-footer: target
@@ -227,9 +218,7 @@ install: target
@-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH)
@-$(INSTALL) -d -m $(INSTMODE_DIR) $(SCRPATH)
[ "$(BUILDPATH)/bin/" -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" $(BINPATH)
-ifndef INSPIRCD_STATIC
[ "$(BUILDPATH)/modules/" -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so $(MODPATH)
-endif
-$(INSTALL) -m $(INSTMODE_BIN) @CONFIGURE_DIRECTORY@/inspircd $(SCRPATH) 2>/dev/null
-$(INSTALL) -m $(INSTMODE_LIB) .gdbargs $(SCRPATH)/.gdbargs 2>/dev/null
ifeq ($(SYSTEM), darwin)
diff --git a/make/unit-cc.pl b/make/unit-cc.pl
index 1cf6cf866..311c4c260 100755
--- a/make/unit-cc.pl
+++ b/make/unit-cc.pl
@@ -37,11 +37,7 @@ chdir $ENV{BUILDPATH};
my $type = shift;
my $out = shift;
-if ($type eq 'gen-ld') {
- do_static_find(@ARGV);
-} elsif ($type eq 'static-ld') {
- do_static_link(@ARGV);
-} elsif ($type eq 'core-ld') {
+if ($type eq 'core-ld') {
do_core_link(@ARGV);
} elsif ($type eq 'link-dir') {
do_link_dir(@ARGV);
@@ -71,36 +67,6 @@ sub rpath($) {
return $message;
}
-sub do_static_find {
- my @flags;
- for my $file (@ARGV) {
- push @flags, rpath(get_directive($file, 'LinkerFlags', ''));
- }
- open F, '>', $out;
- print F join ' ', @flags;
- close F;
- exit 0;
-}
-
-sub do_static_link {
- my $execstr = "$ENV{CXX} -o $out $ENV{CORELDFLAGS}";
- my $link_flags = '';
- for (@ARGV) {
- if (/\.cmd$/) {
- open F, '<', $_;
- my $libs = <F>;
- chomp $libs;
- $link_flags .= ' '.$libs;
- close F;
- } else {
- $execstr .= ' '.$_;
- }
- }
- $execstr .= ' '.$ENV{LDLIBS}.' '.$link_flags;
- message 'LINK', $out, $execstr;
- exec $execstr;
-}
-
sub do_core_link {
my $execstr = "$ENV{CXX} -o $out $ENV{CORELDFLAGS} @_ $ENV{LDLIBS}";
message 'LINK', $out, $execstr;