summaryrefslogtreecommitdiff
path: root/make/gnu-real.mk
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-16 20:00:15 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-16 20:00:15 +0000
commitc90f2b28d2224c1147d51a1d223a7b9082565cc6 (patch)
tree62098e63cc622d9889a9ed205a1c4487c8c20c84 /make/gnu-real.mk
parent3626aeb9ce4798c73cf3a5621388406062c450f7 (diff)
Allow make on a read-only source tree using make O=objdir
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11733 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make/gnu-real.mk')
-rw-r--r--make/gnu-real.mk20
1 files changed, 8 insertions, 12 deletions
diff --git a/make/gnu-real.mk b/make/gnu-real.mk
index e892295a6..338a5112d 100644
--- a/make/gnu-real.mk
+++ b/make/gnu-real.mk
@@ -1,11 +1,13 @@
-CORE_TARGS = $(patsubst %.cpp,%.o,$(wildcard *.cpp) $(wildcard modes/*.cpp))
-CMD_TARGS = $(patsubst %.cpp,%.so,$(wildcard commands/*.cpp))
-MOD_TARGS = $(patsubst %.cpp,%.so,$(wildcard modules/*.cpp))
+SRC = $(SOURCEPATH)/src
+VPATH = $(SRC)
+CORE_TARGS = $(patsubst $(SRC)/%.cpp,%.o,$(wildcard $(SRC)/*.cpp $(SRC)/modes/*.cpp))
+CMD_TARGS = $(patsubst $(SRC)/%.cpp,%.so,$(wildcard $(SRC)/commands/*.cpp))
+MOD_TARGS = $(patsubst $(SRC)/%.cpp,%.so,$(wildcard $(SRC)/modules/*.cpp))
CORE_TARGS += socketengines/$(SOCKETENGINE).o threadengines/threadengine_pthread.o
-MOD_TARGS += $(shell perl -e 'print join " ", grep s!/?$$!.so!, grep -d, <modules/m_*>')
+MOD_TARGS += $(shell perl -e 'chdir "$$ENV{SOURCEPATH}/src"; print join " ", grep s!/?$$!.so!, grep -d, <modules/m_*>')
-DFILES = $(shell ../make/calcdep.pl -all)
+DFILES = $(shell perl $(SOURCEPATH)/make/calcdep.pl -all)
all: inspircd commands modules
@@ -14,13 +16,7 @@ commands: $(CMD_TARGS)
modules: $(MOD_TARGS)
inspircd: $(CORE_TARGS)
- $(RUNCC) -o $@ $(CORELDFLAGS) $(LDLIBS) $(CORE_TARGS)
-
-.%.d: %.cpp
- @../make/calcdep.pl -file $<
-
-.%.d: %
- @../make/calcdep.pl -file $<
+ $(RUNCC) -o $@ $(CORELDFLAGS) $(LDLIBS) $^
.PHONY: all alldep commands modules