]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - BSDmakefile
Rework some build stuff for better output and to enable strict prototypes
[xonotic/gmqcc.git] / BSDmakefile
index 947f3839a267f7c29cb477f968f296a723fbbfca..b537444355078447c89bc397c8a73a12ea69caf4 100644 (file)
@@ -10,7 +10,7 @@ GITINFO  :=
     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 +18,23 @@ 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
 
+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 +44,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)
@@ -65,7 +69,7 @@ test: all
        @ ./$(TESTSUITE)
 
 clean:
-       rm -f *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe
+       rm -rf *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe gm-qcc.tgz ./cov-int
 
 splint:
        @ splint $(SPLINTFLAGS) *.c *.h
@@ -79,6 +83,12 @@ gource-record:
 depend:
        @makedepend -Y -f BSDmakefile -w 65536 2> /dev/null ${DEPS:C/\.o/.c/g}
 
+coverity:
+       @cov-build --dir cov-int $(MAKE) -f BSDmakefile
+       @tar czf gm-qcc.tgz cov-int
+       @rm -rf cov-int
+       @echo gm-qcc.tgz generated, submit for analysis
+
 install: install-gmqcc install-qcvm install-gmqpak install-doc
 install-gmqcc: $(GMQCC)
        install -d -m755              $(DESTDIR)$(BINDIR)
@@ -97,19 +107,20 @@ install-doc:
 
 # DO NOT DELETE
 
-ast.o: gmqcc.h opts.def ast.h ir.h
-code.o: gmqcc.h opts.def
-conout.o: gmqcc.h opts.def
-correct.o: gmqcc.h opts.def
+util.o: gmqcc.h opts.def
 fs.o: gmqcc.h opts.def
-ftepp.o: gmqcc.h opts.def lexer.h
-ir.o: gmqcc.h opts.def ir.h
-lexer.o: gmqcc.h opts.def lexer.h
-main.o: gmqcc.h opts.def lexer.h
+conout.o: gmqcc.h opts.def
 opts.o: gmqcc.h opts.def
 pak.o: gmqcc.h opts.def
-parser.o: gmqcc.h opts.def lexer.h ast.h ir.h intrin.h
 stat.o: gmqcc.h opts.def
 test.o: gmqcc.h opts.def
+main.o: gmqcc.h opts.def lexer.h
+lexer.o: gmqcc.h opts.def lexer.h
+parser.o: parser.h gmqcc.h opts.def lexer.h ast.h ir.h
+code.o: gmqcc.h opts.def
+ast.o: gmqcc.h opts.def ast.h ir.h parser.h lexer.h
+ir.o: gmqcc.h opts.def ir.h
+ftepp.o: gmqcc.h opts.def lexer.h
 utf8.o: gmqcc.h opts.def
-util.o: gmqcc.h opts.def
+correct.o: gmqcc.h opts.def
+fold.o: ast.h ir.h gmqcc.h opts.def parser.h lexer.h