X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=include.mk;h=081ce3b6c03f7760af4c41675461b7c4a3a3642a;hp=d664fb65bd7124e142412dd6275476cb484a9645;hb=53e9ed0d9638b911d377df28505f09c0bee62a35;hpb=65a2b83abd5d5e04a60e0c9000195643fa9c7757 diff --git a/include.mk b/include.mk index d664fb6..081ce3b 100644 --- a/include.mk +++ b/include.mk @@ -1,11 +1,13 @@ # default directories and paths DESTDIR := -OPTIONAL:= PREFIX := /usr/local BINDIR := $(PREFIX)/bin DATADIR := $(PREFIX)/share MANDIR := $(DATADIR)/man +# default flags +CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing -Wno-attributes -O2 + # compiler CC ?= clang @@ -14,7 +16,11 @@ LDFLAGS += LIBS += -lm #common objects -COMMON = ansi.o util.o stat.o fs.o opts.o conout.o +COMMON = ansi.o util.o hash.o stat.o fs.o opts.o conout.o + +#optional flags +OPTIONAL_CFLAGS := +OPTIONAL_LDFLAGS := #objects OBJ_C = $(COMMON) main.o lexer.o parser.o code.o ast.o ir.o ftepp.o utf8.o correct.o fold.o intrin.o @@ -55,6 +61,7 @@ FFMPEGFLAGS= \ #splint flags SPLINTFLAGS = \ + -preproc \ -redef \ -noeffect \ -nullderef \ @@ -97,7 +104,12 @@ SPLINTFLAGS = \ -observertrans \ -abstract \ -statictrans \ - -castfcnptr + -castfcnptr \ + -shiftimplementation \ + -shiftnegative \ + -boolcompare \ + -infloops \ + -sysunrecog #always the right rule default: all @@ -114,13 +126,16 @@ uninstall: #style rule STYLE_MATCH = \( -name '*.[ch]' -or -name '*.def' -or -name '*.qc' \) +# splint cannot parse the MSVC source +SPLINT_MATCH = \( -name '*.[ch]' -and ! -name 'msvc.c' -and ! -path './doc/*' \) + style: find . -type f $(STYLE_MATCH) -exec sed -i 's/ *$$//' '{}' ';' find . -type f $(STYLE_MATCH) -exec sed -i -e '$$a\' '{}' ';' find . -type f $(STYLE_MATCH) -exec sed -i 's/\t/ /g' '{}' ';' splint: - @splint $(SPLINTFLAGS) *.c *.h + @splint $(SPLINTFLAGS) `find . -type f $(SPLINT_MATCH)` gource: @gource $(GOURCEFLAGS)