]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - BSDmakefile
This should be the tag
[xonotic/gmqcc.git] / BSDmakefile
index c33c796916d27dfa22bf9b0122cd40667eb4b1d2..5e2dc21ee68729f8a4dc815dfc7253ec8138fd4c 100644 (file)
@@ -4,13 +4,14 @@
 .include "include.mk"
 
 GITTEST  != git describe --always 2>/dev/null
+VALTEST  != valgrind --version 2>/dev/null
 GITINFO  :=
 
 .if $(GITTEST)
     GITINFO != git describe --always
 .endif
 
-CFLAGS   +=  -Wall -Wextra -Werror -fno-strict-aliasing -DGMQCC_GITINFO=\"$(GITINFO)\"$(OPTIONAL)
+CFLAGS   +=  -Wall -Wextra -Werror -Wstrict-aliasing
 
 .if $(CC) == clang
     CFLAGS +=   -Weverything\
@@ -18,19 +19,28 @@ CFLAGS   +=  -Wall -Wextra -Werror -fno-strict-aliasing -DGMQCC_GITINFO=\"$(GITI
                 -Wno-format-nonliteral\
                 -Wno-disabled-macro-expansion\
                 -Wno-conversion\
-                -Wno-missing-prototypes\
                 -Wno-float-equal\
                 -Wno-unknown-warning-option\
                 -Wno-cast-align\
-                -Wstrict-prototypes
+                -pedantic-errors
 .else
-.    if $(CC) == tcc
-       CFLAGS += -Wstrict-prototypes -pedantic-errors
+.    if $(CC) != g++
+       CFLAGS += -Wmissing-prototypes -Wstrict-prototypes
+.    endif
+
+.    if $(CC) != tcc
+       CFLAGS += -pedantic-errors
 .    else
        CFLAGS += -Wno-pointer-sign -fno-common
 .    endif
 .endif
 
+.if !$(VALTEST)
+    CFLAGS += -DNVALGRIND
+.endif
+
+
+CFLAGS += -DGMQCC_GITINFO=\"$(GITINFO)\" $(OPTIONAL)
 DEPS != for i in $(OBJ_C) $(OBJ_P) $(OBJ_T) $(OBJ_X); do echo $$i; done | sort | uniq
 
 QCVM      = qcvm
@@ -40,10 +50,10 @@ PAK       = gmqpak
 
 #standard rules
 c.o: ${.IMPSRC} 
-       $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS)
+       $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) 
 
 exec-standalone.o: exec.c
-       $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS) -DQCVM_EXECUTOR=1
+       $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1
 
 $(QCVM): $(OBJ_X)
        $(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X)