From 2e5bad993ea8348397a47c03529870a3b99ed57b Mon Sep 17 00:00:00 2001 From: frostycoolslug Date: Fri, 8 Apr 2005 22:39:46 +0000 Subject: Added Dynamic src/modules/Makefile generation, during ./configure the script will search modules for /* $CompileFlags: */ and append any given flags to its g++ line. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1017 e03df62e-2008-0410-955e-edbf42e46eb7 --- configure | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index f8528dc13..c86190a2d 100755 --- a/configure +++ b/configure @@ -86,6 +86,34 @@ if [ "$1" = "-update" -o "$2" = "-update" ] ; then s%@MODULES@%$MODULES%g " .${file}.inc >> $file done + echo -e "\033[0;37mWriting \033[1;32msrc/modules/Makefile\033[0;37m" + rm -f src/modules/Makefile + + # Generate the Header.. + + echo "# (C) ChatSpike development team" >> src/modules/Makefile + echo "# Makefile by " >> src/modules/Makefile + echo "# Many Thanks to Andrew Church " >> src/modules/Makefile + echo "# for assisting with making this work right." >> src/modules/Makefile + echo "#" >> src/modules/Makefile + echo "# Automatically Generated by ./configure to add a module" >> src/modules/Makefile + echo "# please run ./configure --update" >> src/modules/Makefile + echo "" >> src/modules/Makefile + echo "all: \$(MODULES)" >> src/modules/Makefile + echo "" >> src/modules/Makefile + + + for module in src/modules/*.cpp ; do + flags=`grep '$CompileFlags: ' $module | sed 's/\/\* $CompileFlags://' | sed 's/\*\///'` + mod=`echo $module | sed 's/.cpp/.so/' | sed 's/src\/modules\///'` + mod2=`echo $module | sed 's/src\/modules\///'` + echo "$mod:" >> src/modules/Makefile + echo " \$(CC) -I../../include \$(FLAGS) -shared$flags -o $mod $mod2" >> src/modules/Makefile + echo " @cp $mod \$(MODPATH)/" >> src/modules/Makefile + echo "" >> src/modules/Makefile + done + + echo "Complete." exit 1; fi @@ -502,9 +530,35 @@ for file in Makefile inspircd; do s%@MODULES@%$MODULES%g " .${file}.inc >> $file done - `chmod 700 inspircd` +echo -e "\033[0;37mWriting \033[1;32msrc/modules/Makefile\033[0;37m" +rm -f src/modules/Makefile + +# Generate the Header.. + +echo "# (C) ChatSpike development team" >> src/modules/Makefile +echo "# Makefile by " >> src/modules/Makefile +echo "# Many Thanks to Andrew Church " >> src/modules/Makefile +echo "# for assisting with making this work right." >> src/modules/Makefile +echo "#" >> src/modules/Makefile +echo "# Automatically Generated by ./configure to add a module" >> src/modules/Makefile +echo "# please run ./configure --update" >> src/modules/Makefile +echo "" >> src/modules/Makefile +echo "all: \$(MODULES)" >> src/modules/Makefile +echo "" >> src/modules/Makefile + +for module in src/modules/*.cpp ; do + flags=`grep '$CompileFlags: ' $module | sed 's/\/\* $CompileFlags://' | sed 's/\*\///'` + mod=`echo $module | sed 's/.cpp/.so/' | sed 's/src\/modules\///'` + mod2=`echo $module | sed 's/src\/modules\///'` + echo "$mod:" >> src/modules/Makefile + echo " \$(CC) -I../../include \$(FLAGS) -shared$flags -o $mod $mod2" >> src/modules/Makefile + echo " @cp $mod \$(MODPATH)/" >> src/modules/Makefile + echo "" >> src/modules/Makefile +done + + echo "" echo "" -- cgit v1.2.3