diff options
author | frostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-08 22:39:46 +0000 |
---|---|---|
committer | frostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-08 22:39:46 +0000 |
commit | 2e5bad993ea8348397a47c03529870a3b99ed57b (patch) | |
tree | 41e2b383c3626c2ffa5c808e29934e08bfe7a7d3 | |
parent | 793a44d06155cd93f08179a96967a75e347b2cb0 (diff) |
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
-rwxr-xr-x | configure | 56 | ||||
-rw-r--r-- | src/modules/Makefile | 10 |
2 files changed, 55 insertions, 11 deletions
@@ -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 <Craig@ChatSpike.net>" >> src/modules/Makefile + echo "# Many Thanks to Andrew Church <achurch@achurch.org>" >> 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 <Craig@ChatSpike.net>" >> src/modules/Makefile +echo "# Many Thanks to Andrew Church <achurch@achurch.org>" >> 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 "" diff --git a/src/modules/Makefile b/src/modules/Makefile deleted file mode 100644 index b0c50a569..000000000 --- a/src/modules/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# (C) ChatSpike development team -# Makefile by <Craig@ChatSpike.net> -# Many Thanks to Andrew Church <achurch@achurch.org> -# for assisting with making this work right. - -all: $(MODULES) - -%.so: %.cpp - $(CC) -I../../include $(FLAGS) -shared -o $@ $< - @cp $@ $(MODPATH)/ |