]> jfr.im git - irc/quakenet/newserv.git/blobdiff - build.mk.in
Remove valgrind suppressions file
[irc/quakenet/newserv.git] / build.mk.in
index 9b4d6ae3ec0c010424b11500f7e2733651c7f107..dc18a8a56212fd3113b0672f5df37eb9d29bcfe8 100644 (file)
@@ -5,14 +5,15 @@ INCPATH=../
 CFLAGS=
 CC=gcc
 LEX=flex
+MFLAGS=
 
 @sinclude@ @includel@$(INCPATH)defaults.mk@includel@
 @sinclude@ @includel@$(INCPATH)settings.mk@includel@
 
 @ifeq@${HOOKS_NEW}@ifeqsep@1@ifeqend@
-HOOK_ENGINE=old
-@else@
 HOOK_ENGINE=new
+@else@
+HOOK_ENGINE=old
 @endif@
 
 # if USE_VALGRIND == 1
@@ -20,35 +21,29 @@ HOOK_ENGINE=new
   CFLAGS+=-DUSE_VALGRIND
   SSTRING_ENGINE=valgrind
 
-  # if SSTRING_NEW == 1
-  @ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@
+## if SSTRING_NEW == 1
+@ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@
     IMPOSSIBLE="USE_VALGRIND and SSTRING_NEW"
-  @endif@
+@endif@ # SSTRING_NEW == 1
 
-  # if SSTRING_MMAP == 1
-  @ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@
+## if SSTRING_MMAP == 1
+@ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@
     IMPOSSIBLE="USE_VALGRIND and SSTRING_MMAP"
-  @endif@
-@else@
+@endif@ ## SSTRING_MMAP == 1
+@else@ # USE_VALGRIND == 1
 
-  # if SSTRING_NEW == 1
-  @ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@
+## if SSTRING_NEW == 1
+@ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@
     SSTRING_ENGINE=new
-  @else@
+@else@ ## SSTRING_NEW == 1
     SSTRING_ENGINE=old
 
-    # if SSTRING_MMAP == 1
-    @ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@
+### if SSTRING_MMAP == 1
+@ifeq@${SSTRING_MMAP}@ifeqsep@1@ifeqend@
       IMPOSSIBLE="SSTRING_MMAP without SSTRING_NEW"
-    @endif@
-  @endif@
-@endif@
-
-@ifeq@${SSTRING_NEW}@ifeqsep@1@ifeqend@
-HOOK_ENGINE=old
-@else@
-HOOK_ENGINE=new
-@endif@
+@endif@ ### SSTRING_MMAP == 1
+@endif@ ## SSTRING_NEW == 1
+@endif@ # USE_VALGRIND == 1
 
 @ifdef@ IMPOSSIBLE
 @error@ impossible combination of settings: ${IMPOSSIBLE}@errorend@
@@ -57,6 +52,7 @@ HOOK_ENGINE=new
 @ifndef@ BUILDID
 BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/+ /-/;s/ /-/" @shellend@
 @endif@
+MFLAGS+=BUILDID=$(BUILDID)
 
 .SUFFIXES: .so .y .l
 
@@ -69,17 +65,24 @@ BUILDID @shell@ (hg id || echo "unknown") | sed -e "s/+ /-/;s/ /-/" @shellend@
 
 .PHONY: checksettings default
 
+@ifndef@ CHECKEDSETTINGS
 default: checksettings all
 
 checksettings:
-       @test -f .settings.mk || cp settings.mk .settings.mk
-       @diff .settings.mk settings.mk >/dev/null || $(MAKE) -e FORCECHECK=1 realchecksettings
+       @touch ${INCPATH}/settings.mk
+       @test -f ${INCPATH}/.settings.mk || cp ${INCPATH}/settings.mk ${INCPATH}/.settings.mk
+       @diff ${INCPATH}/.settings.mk ${INCPATH}/settings.mk >/dev/null || $(MAKE) -e FORCECHECK=1 realchecksettings
 
 realchecksettings:
 
 @ifdef@ FORCECHECK
 @error@ you must run make clean if you change settings.mk@errorend@
 @endif@
+@endif@
+MFLAGS+=CHECKEDSETTINGS=1
 
-CFLAGS+=-Wall -g -finline-functions -funroll-loops -std=c99 -I./ -DBUILDID=$(BUILDID)
-CFLAGS+=-fPIC -export-dynamic
+CFLAGS+=-Wall -g -finline-functions -funroll-loops
+@ifndef@ NOC99
+CFLAGS+=-std=c99
+@endif@
+CFLAGS+=-I./ -DBUILDID=$(BUILDID) -fPIC -export-dynamic