summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure34
1 files changed, 29 insertions, 5 deletions
diff --git a/configure b/configure
index 83eb03606..fc798310f 100755
--- a/configure
+++ b/configure
@@ -1060,12 +1060,29 @@ wildcard.o: wildcard.cpp ../include/base.h ../include/wildcard.h ../include/insp
socket.o: socket.cpp ../include/base.h ../include/inspircd.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c socket.cpp
-
EOM
close(FH);
}
sub write_dynamic_makefile {
+
+ my $i = 0;
+ my @cmdlist = ();
+ opendir(DIRHANDLE, "src");
+ foreach $name (sort readdir(DIRHANDLE)) {
+ if ($name =~ /^cmd_(.+)\.cpp$/) {
+ $cmdlist[$i++] = $1;
+ }
+ }
+ closedir(DIRHANDLE);
+
+ my $cmdobjs = "";
+ my $srcobjs = "";
+ foreach my $cmd (@cmdlist) {
+ $cmdobjs = $cmdobjs . "cmd_$cmd.o ";
+ $srcobjs = $srcobjs . "cmd_$cmd.cpp ";
+ i}
+
open(FH,">src/Makefile") or die("Could not write src/Makefile");
print FH <<EOM;
# Insp Makefile :p
@@ -1079,7 +1096,7 @@ CC = im a cheezeball
CXXFLAGS = -I../include \${FLAGS}
-all: libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so inspircd
+all: libIRCDcull_list.so libIRCDuserprocess.so libIRCDsocketengine.so libIRCDsocket.so libIRCDhash.so libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so $cmdobjs libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDcommand_parse.so inspircd
inspircd: inspircd.cpp ../include/base.h ../include/channels.h ../include/inspircd.h ../include/channels.h ../include/globals.h ../include/inspircd_config.h ../include/socket.h
\$(CC) -I../include \$(FLAGS) -rdynamic -L. inspircd.cpp -o inspircd \$(LDLIBS) libIRCDchannels.so libIRCDmode.so libIRCDxline.so libIRCDstring.so libIRCDasyncdns.so libIRCDbase.so libIRCDio.so libIRCDmessage.so libIRCDcommands.so libIRCDdnsqueue.so libIRCDdynamic.so libIRCDusers.so libIRCDmodules.so libIRCDwildcard.so libIRCDhelper.so libIRCDhash.so libIRCDsocket.so libIRCDsocketengine.so libIRCDuserprocess.so libIRCDcull_list.so libIRCDcommand_parse.so
@@ -1140,9 +1157,9 @@ libIRCDmessage.so: message.cpp ../include/base.h ../include/message.h ../include
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c message.cpp
\$(CC) -shared -o libIRCDmessage.so message.o
-libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+libIRCDcommands.so: commands.cpp ../include/base.h ../include/commands.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h $srcobjs
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c commands.cpp
- \$(CC) -shared -o libIRCDcommands.so commands.o
+ \$(CC) -shared -o libIRCDcommands.so commands.o $cmdobjs
libIRCDdnsqueue.so: dnsqueue.cpp ../include/base.h ../include/dnsqueue.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
\$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c dnsqueue.cpp
@@ -1169,5 +1186,12 @@ libIRCDsocket.so: socket.cpp ../include/base.h ../include/inspircd.h ../include/
\$(CC) -shared -o libIRCDsocket.so socket.o
EOM
-close(FH);
+ foreach my $cmd (@cmdlist) {
+ print FH <<ITEM;
+cmd_$cmd.o: cmd_$cmd.cpp ../include/base.h ../include/modules.h ../include/inspircd.h ../include/channels.h ../include/users.h ../include/globals.h ../include/inspircd_config.h
+ \$(CC) -pipe -I../include \$(FLAGS) -export-dynamic -c cmd_$cmd.cpp
+
+ITEM
+ }
+ close(FH);
}