X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=Makefile;h=33b77c9d9fe564193a0c5c83c1237d1ee4b844a9;hp=c5297d6bca36a06bbe53489bece99cc8428cbecd;hb=3ecae267adeb4395d6f6df7ebb05cd56fc03bfb8;hpb=e59d50ee5dfc09c3ed3cca74a9909483349b37ae diff --git a/Makefile b/Makefile index c5297d6..33b77c9 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,10 @@ CYGWIN = $(findstring CYGWIN, $(UNAME)) MINGW = $(findstring MINGW32, $(UNAME)) CC ?= clang -CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char -O2 -CFLAGS += -DGMQCC_GITINFO="`git describe`" +CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char +ifneq ($(shell git describe --always 2>/dev/null),) + CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\"" +endif #turn on tons of warnings if clang is present # but also turn off the STUPID ONES ifeq ($(CC), clang) @@ -76,6 +78,57 @@ else endif endif +#splint flags +SPLINTFLAGS = \ + -redef \ + -noeffect \ + -nullderef \ + -usedef \ + -type \ + -mustfreeonly \ + -nullstate \ + -varuse \ + -mustfreefresh \ + -compdestroy \ + -compmempass \ + -nullpass \ + -onlytrans \ + -predboolint \ + -boolops \ + -exportlocal \ + -incondefs \ + -macroredef \ + -retvalint \ + -nullret \ + -predboolothers \ + -globstate \ + -dependenttrans \ + -branchstate \ + -compdef \ + -temptrans \ + -usereleased \ + -warnposix \ + -shiftimplementation \ + +charindex \ + -kepttrans \ + -unqualifiedtrans \ + +matchanyintegral \ + -bufferoverflowhigh \ + +voidabstract \ + -nullassign \ + -unrecog \ + -casebreak \ + -retvalbool \ + -retvalother \ + -mayaliasunique \ + -realcompare \ + -observertrans \ + -shiftnegative \ + -freshtrans \ + -abstract \ + -statictrans \ + -castfcnptr + #standard rules default: all %.o: %.c @@ -97,16 +150,14 @@ all: $(GMQCC) $(QCVM) $(TESTSUITE) check: all @ ./$(TESTSUITE) - -# alias to check because test.o exists and people will get confused -# about the undefined references to X. test: check + @ ./$(TESTSUITE) clean: rm -f *.o $(GMQCC) $(QCVM) $(TESTSUITE) *.dat splint: - @ ./splint.sh + @ splint $(SPLINTFLAGS) *.c *.h depend: @makedepend -Y -w 65536 2> /dev/null \