summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-01 01:26:23 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-01 01:26:23 +0000
commitad13d2293ae8b4353d8051abe63f063622ca623a (patch)
tree0b2bf9358ba63efbe5313e86f8302e55c6ec1f1d
parent3954761f11af50ed33b88f1e6609bfa8a5dab750 (diff)
Makefile updates: Allow run-cc wrapper to be disabled by "make V=1"
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11396 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--.Makefile.inc17
-rwxr-xr-xconfigure28
-rw-r--r--src/modes/Makefile34
3 files changed, 46 insertions, 33 deletions
diff --git a/.Makefile.inc b/.Makefile.inc
index 348051af9..1b2010e33 100644
--- a/.Makefile.inc
+++ b/.Makefile.inc
@@ -6,6 +6,8 @@
# Please do not edit unless you know what you're doing.
#
+COMPILE_ROOT = $(shell pwd)
+
ifdef D
ifeq ("$(origin D)", "command line")
NICEFLAGS = @DEVELOPER@
@@ -21,6 +23,8 @@ ifndef HEADER
HEADER = std-header
endif
+NICEFLAGS += -I$(COMPILE_ROOT)/include
+
CC = @CC@
FLAGS = $(NICEFLAGS) -pedantic
LDLIBS = @LDLIBS@
@@ -32,8 +36,16 @@ LAUNCHDPATH = "/System/Library/LaunchDaemons"
LIBPATH = "@LIBRARY_DIR@"
MODULES = @MODULES@
INSTMODE = 0755
-MAKEFLAGS += --no-print-directory -s
-export FLAGS NICEFLAGS CC LDLIBS MODULES MODPATH LIBPATH INSTMODE
+MAKEFLAGS += --no-print-directory
+
+ifdef V
+ RUNCC = $(CC)
+else
+ MAKEFLAGS += --silent
+ RUNCC = $(COMPILE_ROOT)/make/run-cc.pl $(CC)
+endif
+
+export COMPILE_ROOT RUNCC FLAGS NICEFLAGS CC LDLIBS MODULES MODPATH LIBPATH INSTMODE
all: ircd mods finishmessage
@@ -133,3 +145,4 @@ configureclean:
distclean: modclean clean configureclean
+.PHONY: all debug debug-header std-header ircd mods finishmessage install module clean modclean deinstall squeakyclean launchd_dir configureclean
diff --git a/configure b/configure
index 2b0260d09..bf6ffb7c6 100755
--- a/configure
+++ b/configure
@@ -1057,13 +1057,13 @@ sub getosflags {
# Beware: Linux sets it's own cflags below for some retarded reason
$config{LDLIBS} = "-pthread -lstdc++";
- $config{FLAGS} = "-fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}";
- $config{DEVELOPER} = "-fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g";
+ $config{FLAGS} = "-pipe -fPIC -Woverloaded-virtual -Wshadow -Wformat=2 -Wmissing-format-attribute -Wall $config{OPTIMISATI}";
+ $config{DEVELOPER} = "-pipe -fPIC -Woverloaded-virtual -Wshadow -Wall -Wformat=2 -Wmissing-format-attribute -g";
$SHARED = "-shared -export-dynamic";
$config{MAKEPROG} = "make";
if ($config{OSNAME} =~ /darwin/i) {
- $config{FLAGS} = "-DDARWIN -frtti -fPIC -Wall $config{OPTIMISATI}";
+ $config{FLAGS} = "-pipe -DDARWIN -frtti -fPIC -Wall $config{OPTIMISATI}";
$SHARED = "-bundle -twolevel_namespace -undefined dynamic_lookup";
$config{LDLIBS} = "-ldl -pthread -lstdc++";
}
@@ -1385,14 +1385,14 @@ EOCHEESE
{
print FILEHANDLE "
m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
- \@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags $SHARED -o m_$i.so m_$i.cpp
+ \$(RUNCC) \$(NICEFLAGS) $cmflags \$(PICLDFLAGS) $liflags $SHARED -o m_$i.so m_$i.cpp
";
}
else
{
print FILEHANDLE "
m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps
- \@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags $SHARED -o m_$i.so m_$i.cpp
+ \$(RUNCC) \$(FLAGS) $cmflags \$(PICLDFLAGS) $liflags $SHARED -o m_$i.so m_$i.cpp
";
}
$install_list = $install_list . " install -m \$(INSTMODE) src/modules/m_$i.so \$(MODPATH)\n";
@@ -1414,7 +1414,7 @@ m_$i.so: m_$i.cpp ../../include/modules.h ../../include/users.h ../../include/ch
read_module_directory("src/modules/$name", $name);
print "Composing Makefile rules for directory \e[1;32m$name\e[0m... (\e[1;32m$mfcount files found\e[0m)\n";
print FILEHANDLE "$name.so: ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $mobjs\n";
- print FILEHANDLE " \@../../make/run-cc.pl \$(CC) -pipe \$(FLAGS) $SHARED $mliflags -o $name.so $mobjs\n";
+ print FILEHANDLE " \$(RUNCC) \$(FLAGS) $SHARED $mliflags -o $name.so $mobjs\n";
print FILEHANDLE "\n$mfrules\n";
closedir(MDIRHANDLE);
$install_list = $install_list . " install -m \$(INSTMODE) src/modules/$name.so \$(MODPATH)\n";
@@ -1439,7 +1439,7 @@ sub read_module_directory {
my $oname = $fname;
$oname =~ s/\.cpp$/.o/g;
$mfrules = $mfrules . "$reldpath/$oname: $reldpath/$fname ../../include/modules.h ../../include/users.h ../../include/channels.h ../../include/base.h ../../include/inspircd_config.h ../../include/inspircd.h ../../include/configreader.h $deps\n";
- $mfrules = $mfrules . " \@../../make/run-cc.pl \$(CC) -pipe -I../../include -I. \$(FLAGS) $cmflags $SHARED -o $reldpath/$oname -c $reldpath/$fname\n\n";
+ $mfrules = $mfrules . " \$(RUNCC) -I. \$(FLAGS) $cmflags $SHARED -o $reldpath/$oname -c $reldpath/$fname\n\n";
$mobjs = $mobjs . " $reldpath/$oname";
$mfcount++;
}
@@ -1627,18 +1627,18 @@ sub write_dynamic_makefile
if ($config{IS_DARWIN} eq "YES")
{
$libraryext = "dylib";
- $binary_rule = " \@../make/run-cc.pl \$(CC) -pipe -dynamic -bind_at_load -L. -o inspircd \$(LDLIBS) inspircd.o "
+ $binary_rule = " \$(RUNCC) -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. -o inspircd \$(LDLIBS) ";
+ $binary_rule = " \$(RUNCC) \$(FLAGS) $freebsd4libs -rdynamic -L. -o inspircd \$(LDLIBS) ";
}
open(FH,">src/Makefile") or die("Could not write src/Makefile");
print FH <<'EOM';
-CXXFLAGS = -I../include ${FLAGS}
+CXXFLAGS = ${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)
@@ -1683,11 +1683,11 @@ EOM
if (exists($core_files_list{$cpp}))
{
# core files are statically linked into the binary and do not require $SHARED shared libs switches
- $buildstring = $buildstring . " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) -c $rawcpp\n";
+ $buildstring = $buildstring . " \$(RUNCC) \$(FLAGS) -c $rawcpp\n";
}
else
{
- $buildstring = $buildstring . " \@../make/run-cc.pl \$(CC) -pipe -I../include \$(FLAGS) $SHARED -c $rawcpp\n";
+ $buildstring = $buildstring . " \$(RUNCC) \$(FLAGS) $SHARED -c $rawcpp\n";
}
if (exists($extrabuildlines{$cpp}))
@@ -1724,7 +1724,7 @@ EOM
# and now reopen the commands makefile
open(FH,">src/commands/Makefile") or die("Could not write src/commands/Makefile");
print FH <<ITEM;
-CXXFLAGS = -I../../include \${FLAGS}
+CXXFLAGS = \${FLAGS}
all:
\@echo "Don't run make here! Run it in the root directory"
@@ -1740,7 +1740,7 @@ ITEM
foreach my $cmd (@cmdlist) {
print FH <<ITEM;
cmd_$cmd.so: cmd_$cmd.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/commands/cmd_$cmd.h
- \@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) $SHARED -o cmd_$cmd.so cmd_$cmd.cpp
+ \$(RUNCC) \$(FLAGS) $SHARED -o cmd_$cmd.so cmd_$cmd.cpp
ITEM
}
diff --git a/src/modes/Makefile b/src/modes/Makefile
index 6ff181da8..d2f065d8f 100644
--- a/src/modes/Makefile
+++ b/src/modes/Makefile
@@ -1,56 +1,56 @@
-CXXFLAGS = -I../../include ${FLAGS}
+CXXFLAGS = ${FLAGS}
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
+ $(RUNCC) $(FLAGS) -export-dynamic -c umode_w.cpp
umode_o.o: umode_o.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_o.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c umode_o.cpp
umode_s.o: umode_s.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_s.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c umode_s.cpp
umode_i.o: umode_i.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_i.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c umode_i.cpp
cmode_v.o: cmode_v.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 cmode_v.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_v.cpp
cmode_t.o: cmode_t.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 cmode_t.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_t.cpp
cmode_s.o: cmode_s.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 cmode_s.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_s.cpp
cmode_p.o: cmode_p.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 cmode_p.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_p.cpp
cmode_o.o: cmode_o.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 cmode_o.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_o.cpp
cmode_n.o: cmode_n.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 cmode_n.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_n.cpp
cmode_m.o: cmode_m.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 cmode_m.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_m.cpp
cmode_l.o: cmode_l.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 cmode_l.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_l.cpp
cmode_k.o: cmode_k.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 cmode_k.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_k.cpp
cmode_i.o: cmode_i.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 cmode_i.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_i.cpp
cmode_h.o: cmode_h.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 cmode_h.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_h.cpp
cmode_b.o: cmode_b.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 cmode_b.cpp
+ $(RUNCC) $(FLAGS) -export-dynamic -c cmode_b.cpp
modeclasses.a: 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
@-rm -rf modeclasses.a