diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/bsd-dep.mk | 4 | ||||
-rw-r--r-- | make/bsd-real.mk | 10 | ||||
-rwxr-xr-x | make/calcdep.pl | 4 | ||||
-rw-r--r-- | make/gnu-dep.mk | 12 | ||||
-rw-r--r-- | make/gnu-real.mk | 13 |
5 files changed, 26 insertions, 17 deletions
diff --git a/make/bsd-dep.mk b/make/bsd-dep.mk index 5fe31e89f..4d2f8e1dc 100644 --- a/make/bsd-dep.mk +++ b/make/bsd-dep.mk @@ -1,7 +1,7 @@ -DFILES != perl -e 'print join " ", grep s/\.cpp/.d/, <*.cpp>, <commands/*.cpp>, <modes/*.cpp>, <modules/*.cpp>' +DFILES != perl -e 'print join " ", grep s/\.cpp/.d/, <*.cpp>, <commands/*.cpp>, <modes/*.cpp>, <modules/*.cpp>, <modules/m_spanningtree/*.cpp>' DFILES += socketengines/$(SOCKETENGINE).d threadengines/threadengine_pthread.d -all: $(DFILES) +alldep: $(DFILES) .SUFFIXES: .d .cpp diff --git a/make/bsd-real.mk b/make/bsd-real.mk index ea3e1482c..4ae834329 100644 --- a/make/bsd-real.mk +++ b/make/bsd-real.mk @@ -2,10 +2,13 @@ CORE_TARGS != perl -e 'print join " ", grep s/\.cpp/.o/, <*.cpp>' MODE_TARGS != perl -e 'print join " ", grep s/\.cpp/.o/, <modes/*.cpp>' CMD_TARGS != perl -e 'print join " ", grep s/\.cpp/.so/, <commands/*.cpp>' MOD_TARGS != perl -e 'print join " ", grep s/\.cpp/.so/, <modules/*.cpp>' +SPANNINGTREE_TARGS != perl -e 'print join " ", grep s/\.cpp/.o/, <modules/m_spanningtree/*.cpp>' + CORE_TARGS += modeclasses.a threadengines/threadengine_pthread.o CORE_TARGS += socketengines/$(SOCKETENGINE).o +MOD_TARGS += modules/m_spanningtree.so -DFILES != perl -e 'print join " ", grep s/\.cpp/.d/, <*.cpp>, <commands/*.cpp>, <modes/*.cpp>, <modules/*.cpp>' +DFILES != perl -e 'print join " ", grep s/\.cpp/.d/, <*.cpp>, <commands/*.cpp>, <modes/*.cpp>, <modules/*.cpp>, <modules/m_spanningtree/*.cpp>' DFILES += socketengines/$(SOCKETENGINE).d threadengines/threadengine_pthread.d all: inspircd commands modules @@ -17,8 +20,11 @@ modules: $(MOD_TARGS) modeclasses.a: $(MODE_TARGS) @../make/run-cc.pl ar crs modeclasses.a $(MODE_TARGS) +modules/m_spanningtree.so: $(SPANNINGTREE_TARGS) + $(RUNCC) $(FLAGS) -shared -export-dynamic -o $@ $(SPANNINGTREE_TARGS) + inspircd: $(CORE_TARGS) - $(RUNCC) $(FLAGS) -rdynamic -L. -o inspircd $(LDLIBS) $(CORE_TARGS) + $(RUNCC) $(FLAGS) $(CORE_FLAGS) -o inspircd $(LDLIBS) $(CORE_TARGS) .for FILE in $(DFILES) .include "$(FILE)" diff --git a/make/calcdep.pl b/make/calcdep.pl index 2b6742be3..bcbb7cbd0 100755 --- a/make/calcdep.pl +++ b/make/calcdep.pl @@ -16,8 +16,10 @@ open OUT, '>', $out or die "Could not write $out: $!"; my $cc_deps = qx($ENV{CC} $ENV{FLAGS} -MM $file); $cc_deps =~ s/.*?:\s*//; -my $ext = $file =~ m#(modules|commands)/# ? '.so' : '.o'; +my $ext = $file =~ m#(modules|commands)/[^/]+$# ? '.so' : '.o'; print OUT "$base$ext: $cc_deps"; print OUT "\t@../make/unit-cc.pl \$(VERBOSE) $file $base$ext\n"; print OUT "$base.d: $cc_deps"; +print OUT "\t\@\$(VDEP_IN)\n"; print OUT "\t../make/calcdep.pl $file\n"; +print OUT "\t\@\$(VDEP_OUT)\n"; diff --git a/make/gnu-dep.mk b/make/gnu-dep.mk index e8c70c0cd..f0ebb4d59 100644 --- a/make/gnu-dep.mk +++ b/make/gnu-dep.mk @@ -1,11 +1,3 @@ -DFILES = $(patsubst %.cpp,%.d,$(wildcard *.cpp)) -DFILES += $(patsubst %.cpp,%.d,$(wildcard commands/*.cpp)) -DFILES += $(patsubst %.cpp,%.d,$(wildcard modes/*.cpp)) -DFILES += $(patsubst %.cpp,%.d,$(wildcard modules/*.cpp)) -DFILES += socketengines/$(SOCKETENGINE).d threadengines/threadengine_pthread.d +VDEP_OUT = echo -n . -all: $(DFILES) - -%.d: %.cpp - @../make/calcdep.pl $< - @echo -n . +include ../make/gnu-real.mk diff --git a/make/gnu-real.mk b/make/gnu-real.mk index 263467038..c868aa933 100644 --- a/make/gnu-real.mk +++ b/make/gnu-real.mk @@ -2,17 +2,21 @@ CORE_TARGS = $(patsubst %.cpp,%.o,$(wildcard *.cpp)) MODE_TARGS = $(patsubst %.cpp,%.o,$(wildcard modes/*.cpp)) CMD_TARGS = $(patsubst %.cpp,%.so,$(wildcard commands/*.cpp)) MOD_TARGS = $(patsubst %.cpp,%.so,$(wildcard modules/*.cpp)) +SPANNINGTREE_TARGS = $(patsubst %.cpp,%.o,$(wildcard modules/m_spanningtree/*.cpp)) CORE_TARGS += modeclasses.a threadengines/threadengine_pthread.o CORE_TARGS += socketengines/$(SOCKETENGINE).o +MOD_TARGS += modules/m_spanningtree.so DFILES = $(patsubst %.cpp,%.d,$(wildcard *.cpp)) DFILES += $(patsubst %.cpp,%.d,$(wildcard commands/*.cpp)) DFILES += $(patsubst %.cpp,%.d,$(wildcard modes/*.cpp)) DFILES += $(patsubst %.cpp,%.d,$(wildcard modules/*.cpp)) +DFILES += $(patsubst %.cpp,%.d,$(wildcard modules/m_spanningtree/*.cpp)) DFILES += socketengines/$(SOCKETENGINE).d threadengines/threadengine_pthread.d all: inspircd commands modules +alldep: $(DFILES) commands: $(CMD_TARGS) @@ -21,12 +25,17 @@ modules: $(MOD_TARGS) modeclasses.a: $(MODE_TARGS) @../make/run-cc.pl ar crs modeclasses.a $(MODE_TARGS) +modules/m_spanningtree.so: $(SPANNINGTREE_TARGS) + $(RUNCC) $(FLAGS) -shared -export-dynamic -o $@ $(SPANNINGTREE_TARGS) + inspircd: $(CORE_TARGS) - $(RUNCC) $(FLAGS) -rdynamic -L. -o inspircd $(LDLIBS) $(CORE_TARGS) + $(RUNCC) $(FLAGS) $(CORE_FLAGS) -o inspircd $(LDLIBS) $(CORE_TARGS) %.d: %.cpp + @$(VDEP_IN) @../make/calcdep.pl $< + @$(VDEP_OUT) -.PHONY: all commands modules +.PHONY: all alldep commands modules -include $(DFILES) |