X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=Makefile;h=e31c0987124ba0596fd39040d18a920c312cabfe;hp=532300385e8cf9bf520bec357bc77a7a6646a5ff;hb=e11a17b40805b93e1e2ae80129c9d235b6d6119b;hpb=99249c8fa346d05e3d37d4c8ba532b86e54e2439 diff --git a/Makefile b/Makefile index 5323003..e31c098 100644 --- a/Makefile +++ b/Makefile @@ -9,20 +9,24 @@ CYGWIN = $(findstring CYGWIN, $(UNAME)) MINGW = $(findstring MINGW32, $(UNAME)) CC ?= clang -CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char -CFLAGS += -DGMQCC_GITINFO="`git describe`" +CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char -Wno-overlength-strings +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) - CFLAGS += \ - -Weverything \ - -Wno-padded \ - -Wno-format-nonliteral \ - -Wno-disabled-macro-expansion \ - -Wno-conversion \ - -Wno-missing-prototypes \ - -Wno-float-equal \ - -Wno-cast-align + CFLAGS += \ + -Weverything \ + -Wno-padded \ + -Wno-format-nonliteral \ + -Wno-disabled-macro-expansion \ + -Wno-conversion \ + -Wno-missing-prototypes \ + -Wno-float-equal \ + -Wno-cast-align \ + -Wno-missing-variable-declarations \ + -Wno-unknown-warning-option else #Tiny C Compiler doesn't know what -pedantic-errors is # and instead of ignoring .. just errors. @@ -76,6 +80,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 +152,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 \ @@ -128,8 +181,14 @@ install-qcvm: $(QCVM) install -m755 $(QCVM) $(DESTDIR)$(BINDIR)/qcvm install-doc: install -d -m755 $(DESTDIR)$(MANDIR)/man1 - install -m755 doc/gmqcc.1 $(DESTDIR)$(MANDIR)/man1/ - install -m755 doc/qcvm.1 $(DESTDIR)$(MANDIR)/man1/ + install -m644 doc/gmqcc.1 $(DESTDIR)$(MANDIR)/man1/ + install -m644 doc/qcvm.1 $(DESTDIR)$(MANDIR)/man1/ + +uninstall: + rm $(DESTDIR)$(BINDIR)/gmqcc + rm $(DESTDIR)$(BINDIR)/qcvm + rm $(DESTDIR)$(MANDIR)/man1/doc/gmqcc.1 + rm $(DESTDIR)$(MANDIR)/man1/doc/qcvm.1 # DO NOT DELETE