summaryrefslogtreecommitdiff
path: root/.Makefile.inc
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 /.Makefile.inc
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 '.Makefile.inc')
-rw-r--r--.Makefile.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/.Makefile.inc b/.Makefile.inc
index 6b8d7274f..ebe4391b3 100644
--- a/.Makefile.inc
+++ b/.Makefile.inc
@@ -55,17 +55,25 @@ CXXFLAGS += -I../include
@GNU_ONLY MAKEFLAGS += --no-print-directory
+@GNU_ONLY SOURCEPATH = $(shell /bin/pwd)
+@BSD_ONLY SOURCEPATH != /bin/pwd
+@IFDEF O
+ BUILDPATH = $(O)
+@ELSE
+ BUILDPATH = src
+@ENDIF
+
@IFDEF V
RUNCC = $(CC)
VERBOSE = -v
@ELSE
@GNU_ONLY MAKEFLAGS += --silent
@BSD_ONLY MAKE += -s
- RUNCC = ../make/run-cc.pl $(CC)
+ RUNCC = $(SOURCEPATH)/make/run-cc.pl $(CC)
@ENDIF
@DO_EXPORT RUNCC CXXFLAGS CC LDLIBS PICLDFLAGS VERBOSE SOCKETENGINE CORELDFLAGS
-@DO_EXPORT BASE CONPATH MODPATH BINPATH
+@DO_EXPORT BASE CONPATH MODPATH BINPATH SOURCEPATH
# Default target
TARGET = all
@@ -86,8 +94,8 @@ TARGET = all
all: $(FOOTER)
target: $(HEADER)
-@GNU_ONLY $(MAKEENV) $(MAKE) -C src -f ../make/gnu-real.mk $(TARGET)
-@BSD_ONLY $(MAKEENV) $(MAKE) -C src -f ../make/bsd-real.mk $(TARGET)
+@GNU_ONLY $(MAKEENV) $(MAKE) -C $(BUILDPATH) -f ../make/gnu-real.mk $(TARGET)
+@BSD_ONLY $(MAKEENV) $(MAKE) -C $(BUILDPATH) -f ../make/bsd-real.mk $(TARGET)
debug:
@${MAKE} D=1 all
@@ -191,6 +199,7 @@ help:
@echo 'Flags:'
@echo ' V=1 Show the full command being executed instead of "BUILD: dns.cpp"'
@echo ' D=1 Enable debug build, for module development or crash tracing'
+ @echo ' O=objdir Use an alternate location for storing object files'
@echo ' -j <N> Run a parallel build using N jobs'
@echo ''
@echo 'User targets:'