summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.Makefile.inc7
-rw-r--r--src/modules/Makefile22
2 files changed, 9 insertions, 20 deletions
diff --git a/.Makefile.inc b/.Makefile.inc
index 62d23f0d7..01b82d262 100644
--- a/.Makefile.inc
+++ b/.Makefile.inc
@@ -18,21 +18,20 @@ echo "CONPATH = $CONFIG_DIR" >> Makefile
echo "MODPATH = $MODULE_DIR" >> Makefile
echo "BINPATH = $BINARY_DIR" >> Makefile
echo "MODULES =$MODULES" >> Makefile
-echo "MAKEARGS = 'PROGS=\${PROGS}' 'FLAGS=\${FLAGS}' 'CC=\${CC}' 'LDLIBS=\${LDLIBS}' 'MODULES=\${MODULES}'" >> Makefile
+echo "MAKEARGS = 'PROGS=\${PROGS}' 'FLAGS=\${FLAGS}' 'CC=\${CC}' 'LDLIBS=\${LDLIBS}' 'MODULES=\${MODULES}' 'MODPATH=\$(MODPATH)'" >> Makefile
echo "" >> Makefile
echo "all : ircd mods config" >> Makefile
echo "" >> Makefile
echo "mods:" >> Makefile
echo " \${MAKE} -C src/modules DIRNAME="src/modules" \$(MAKEARGS)" >> Makefile
-echo " mv src/modules/*.so \$(MODPATH)" >> Makefile
echo "" >> Makefile
echo "ircd:" >> Makefile
echo " \${MAKE} -C src DIRNAME="src" \$(MAKEARGS)" >> Makefile
-echo " cp src/inspircd \$(BINPATH)" >> Makefile
+echo " @cp src/inspircd \$(BINPATH)" >> Makefile
echo "" >> Makefile
echo "config:" >> Makefile
if [ -n "$COPY_CONF" ] ; then
-echo " cp conf/* \$(CONPATH)" >> Makefile
+echo " @cp conf/* \$(CONPATH)" >> Makefile
else
echo " echo \"*** Nothing to Be Done for make config\"" >> Makefile
fi
diff --git a/src/modules/Makefile b/src/modules/Makefile
index 60629b59c..36cbbe1cd 100644
--- a/src/modules/Makefile
+++ b/src/modules/Makefile
@@ -3,21 +3,11 @@
# Small modifications by <brain@ChatSpike.net>
#
-CXXFLAGS = -I../../include ${FLAGS}
+all: $(MODULES)
-MODS = `/bin/ls *.cpp | sed 's/.cpp//'`
-MODULES = $(MODS)
-
-MODS2 = `/bin/ls *.cpp`
-MODULES2 = $(MODS2:.cpp=.so)
-
-main:
- rm -f .make ; \
- for i in $(MODULES) ; do \
- echo "echo \"Compiling: $$i\"" >>.make ; \
- echo "$(CXX) $(CXXFLAGS) -shared -o $$i `echo $$i | sed 's/.so/.cpp/'`">>.make ; \
- done ; chmod u+x .make ; ./.make
-
-
-all: main
+%.so:
+ @$(MAKE) --no-print-directory TARGET=$(@:.so=)
+$(TARGET).so:
+ $(CC) -I../../include $(FLAGS) -shared -o $@ $(TARGET).cpp
+ @cp $(TARGET).so $(MODPATH)$(TARGET).so