summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.Makefile.inc24
-rwxr-xr-xconfigure42
-rw-r--r--src/inspircd.cpp1
-rw-r--r--src/mode.cpp3
-rw-r--r--src/modes/Makefile5
5 files changed, 44 insertions, 31 deletions
diff --git a/.Makefile.inc b/.Makefile.inc
index 1c5c77fb6..348051af9 100644
--- a/.Makefile.inc
+++ b/.Makefile.inc
@@ -24,16 +24,16 @@ endif
CC = @CC@
FLAGS = $(NICEFLAGS) -pedantic
LDLIBS = @LDLIBS@
-BASE = "$(DESTDIR)@BASE_DIR@"
-CONPATH = "$(DESTDIR)@CONFIG_DIR@"
-MODPATH = "$(DESTDIR)@MODULE_DIR@"
-BINPATH = "$(DESTDIR)@BINARY_DIR@"
-LAUNCHDPATH = "$(DESTDIR)/System/Library/LaunchDaemons"
-LIBPATH = "$(DESTDIR)@LIBRARY_DIR@"
+BASE = "@BASE_DIR@"
+CONPATH = "@CONFIG_DIR@"
+MODPATH = "@MODULE_DIR@"
+BINPATH = "@BINARY_DIR@"
+LAUNCHDPATH = "/System/Library/LaunchDaemons"
+LIBPATH = "@LIBRARY_DIR@"
MODULES = @MODULES@
INSTMODE = 0755
-MAKEFLAGS += --no-print-directory
-MAKEARGS = 'FLAGS=${FLAGS}' 'NICEFLAGS=${NICEFLAGS}' 'CC=${CC}' 'LDLIBS=${LDLIBS}' 'MODULES=${MODULES}' 'MODPATH=${MODPATH}' 'LIBPATH=${LIBPATH}' 'INSTMODE=${INSTMODE}'
+MAKEFLAGS += --no-print-directory -s
+export FLAGS NICEFLAGS CC LDLIBS MODULES MODPATH LIBPATH INSTMODE
all: ircd mods finishmessage
@@ -65,10 +65,10 @@ std-header:
@echo "*************************************"
ircd: $(HEADER)
- @${MAKE} -C src DIRNAME="src" $(MAKEARGS)
+ @${MAKE} -C src $(MAKEARGS) inspircd commands
mods: $(HEADER)
- @${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS)
+ @${MAKE} -C src/modules $(MAKEARGS)
# Make this depend on 'ircd' and 'mods', so its always output last even with -j
finishmessage: ircd mods
@@ -80,7 +80,7 @@ finishmessage: ircd mods
@echo "* make install *"
@echo "*************************************"
-install: all@EXTRA_DIR@
+install: ircd mods@EXTRA_DIR@
@-install -d -m $(INSTMODE) $(BASE)
@-install -d -m $(INSTMODE) $(LIBPATH)
@-install -d -m $(INSTMODE) $(BINPATH)
@@ -98,7 +98,7 @@ install: all@EXTRA_DIR@
@echo "*************************************"
module:
- @${MAKE} -C src/modules DIRNAME="src/modules" $(MAKEARGS) ${name}
+ @${MAKE} -C src/modules $(MAKEARGS) ${name}
clean:
@echo Cleaning...
diff --git a/configure b/configure
index c67dc3fb7..2b0260d09 100755
--- a/configure
+++ b/configure
@@ -1627,21 +1627,24 @@ sub write_dynamic_makefile
if ($config{IS_DARWIN} eq "YES")
{
$libraryext = "dylib";
- $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -c inspircd.cpp\n \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o "
+ $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o "
}
else
{
$libraryext = "so";
- $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) $freebsd4libs -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) ";
+ $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) $freebsd4libs -rdynamic -L. -o inspircd \$(LDLIBS) ";
}
open(FH,">src/Makefile") or die("Could not write src/Makefile");
- print FH <<EOM;
+ print FH <<'EOM';
-CC = im a cheezeball
-CXXFLAGS = -I../include \${FLAGS}
-CPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* //' | grep -v svn)
-RELCPPFILES = \$(shell /bin/ls -l modes/ | grep '\\.cpp' | sed 's/^.* /modes\\//' | grep -v svn)
+CXXFLAGS = -I../include ${FLAGS}
+CPPFILES = $(shell /bin/ls -l modes/ | grep '\.cpp' | sed 's/^.* //' | grep -v svn)
+RELCPPFILES = $(shell /bin/ls -l modes/ | grep '\.cpp' | sed 's/^.* /modes\//' | grep -v svn)
+
+all:
+ @echo "Don't run make here! Run it in the parent directory"
+ false
EOM
@@ -1693,14 +1696,21 @@ EOM
}
}
- print FH "all: inspircd moo\n\n\n";
-
- $deps = calcdeps("src/inspircd.cpp");
- print FH "inspircd: inspircd.cpp $deps $all_core\n";
+ print FH "inspircd: $all_core\n";
print FH "$binary_rule $all_core\n\n";
print FH $buildstring;
- print FH "moo:\n \@\${MAKE} -C \"commands\" DIRNAME=\"src/commands\" CC=\"\$(CC)\" \$(MAKEARGS)\n\n";
+ print FH <<'EOM';
+
+.PHONY: all commands
+
+commands:
+ @${MAKE} -C commands $(MAKEARGS) commands
+
+modes/modeclasses.a: $(RELCPPFILES)
+ @${MAKE} -C modes $(MAKEARGS) CPPFILES="$(CPPFILES)" modeclasses.a
+
+EOM
# close main makefile
close(FH);
@@ -1714,11 +1724,15 @@ EOM
# and now reopen the commands makefile
open(FH,">src/commands/Makefile") or die("Could not write src/commands/Makefile");
print FH <<ITEM;
-CC = i am cornholio
CXXFLAGS = -I../../include \${FLAGS}
-all: $cmdobjs
+all:
+ \@echo "Don't run make here! Run it in the root directory"
+ false
+
+.PHONY: all commands
+commands: $cmdobjs
ITEM
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index cb019ca7c..23ef19aef 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -11,6 +11,7 @@
* ---------------------------------------------------
*/
+/* $Core */
/* $Install: src/inspircd $(BINPATH) */
#include "inspircd.h"
#include <signal.h>
diff --git a/src/mode.cpp b/src/mode.cpp
index 39f5f1da2..78993caad 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -12,9 +12,6 @@
*/
/* $Core */
-/* $ExtraDeps: $(RELCPPFILES) */
-/* $ExtraObjects: modes/modeclasses.a */
-/* $ExtraBuild: @${MAKE} -C "modes" DIRNAME="src/modes" CC="$(CC)" $(MAKEARGS) CPPFILES="$(CPPFILES)" */
#include "inspircd.h"
#include "inspstring.h"
diff --git a/src/modes/Makefile b/src/modes/Makefile
index 65a7dfe16..6ff181da8 100644
--- a/src/modes/Makefile
+++ b/src/modes/Makefile
@@ -1,7 +1,8 @@
-CC = i am cornholio
CXXFLAGS = -I../../include ${FLAGS}
-all: umode_w.o umode_o.o umode_s.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a
+all:
+ @echo "Don't run make here! Run it in the root directory"
+ false
umode_w.o: umode_w.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h
@../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_w.cpp