X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=ff63173cdba2aa975e43c7b066c4232ecb6700e3;hb=1077eb20617f8df758baf17951f3594270ebd0c1;hp=c5e5b9a384a3bdbe6330877378807c9c8a34ab09;hpb=dfca3743f9f288965d08def5fffe8a03c87c8d74;p=xonotic%2Fgmqcc.git diff --git a/Makefile b/Makefile index c5e5b9a..ff63173 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ DESTDIR := +OPTIONAL:= PREFIX := /usr/local BINDIR := $(PREFIX)/bin DATADIR := $(PREFIX)/share @@ -8,8 +9,12 @@ UNAME ?= $(shell uname) CYGWIN = $(findstring CYGWIN, $(UNAME)) MINGW = $(findstring MINGW32, $(UNAME)) -CC ?= clang -CFLAGS += -Wall -Wextra -Werror -I. -fno-strict-aliasing -fsigned-char +CC ?= clang +# linker flags and optional additional libraries if required +LDFLAGS := +LIBS := -lm + +CFLAGS += -Wall -Wextra -Werror -I. -fno-strict-aliasing $(OPTIONAL) ifneq ($(shell git describe --always 2>/dev/null),) CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\"" endif @@ -17,28 +22,26 @@ endif # 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 \ - -Wno-missing-variable-declarations \ - -Wno-unknown-warning-option + -Weverything \ + -Wno-padded \ + -Wno-format-nonliteral \ + -Wno-disabled-macro-expansion \ + -Wno-conversion \ + -Wno-missing-prototypes \ + -Wno-float-equal \ + -Wno-unknown-warning-option else #Tiny C Compiler doesn't know what -pedantic-errors is # and instead of ignoring .. just errors. ifneq ($(CC), tcc) - CFLAGS +=-pedantic-errors + CFLAGS +=-pedantic-errors -ffunction-sections -fdata-sections -Wl,-gc-sections else CFLAGS += -Wno-pointer-sign -fno-common endif endif ifeq ($(track), no) - CFLAGS += -DNOTRACK + CFLAGS += -DNOTRACK endif OBJ_D = util.o code.o ast.o ir.o conout.o ftepp.o opts.o fs.o utf8.o correct.o @@ -71,12 +74,6 @@ ifneq ("$(MINGW)", "") TESTSUITE = testsuite.exe PAK = pak.exe else - #arm support for linux .. we need to allow unaligned accesses - #to memory otherwise we just segfault everywhere - ifneq (, $(findstring arm, $(shell uname -m))) - CFLAGS += -munaligned-access - endif - QCVM = qcvm GMQCC = gmqcc TESTSUITE = testsuite @@ -86,23 +83,34 @@ endif #gource flags GOURCEFLAGS= \ - --date-format "%d %B, %Y" \ - --seconds-per-day 0.01 \ - --auto-skip-seconds 1 \ - --title "GMQCC" \ - -1280x720 + --date-format "%d %B, %Y" \ + --seconds-per-day 0.01 \ + --auto-skip-seconds 1 \ + --title "GMQCC" \ + --key \ + --camera-mode overview \ + --highlight-all-users \ + --file-idle-time 0 \ + --hide progress,mouse \ + --stop-at-end \ + --max-files 99999999999 \ + --max-file-lag 0.000001 \ + --bloom-multiplier 1.3 \ + --logo doc/html/gmqcc.png \ + -1280x720 + #ffmpeg flags for gource FFMPEGFLAGS= \ - -y \ - -r 60 \ - -f image2pipe \ - -vcodec ppm \ - -i - \ - -vcodec libx264 \ - -preset ultrafast \ - -crf 1 \ - -threads 0 \ - -bf 0 + -y \ + -r 60 \ + -f image2pipe \ + -vcodec ppm \ + -i - \ + -vcodec libx264 \ + -preset ultrafast \ + -crf 1 \ + -threads 0 \ + -bf 0 #splint flags SPLINTFLAGS = \ @@ -139,7 +147,6 @@ SPLINTFLAGS = \ -kepttrans \ -unqualifiedtrans \ +matchanyintegral \ - -bufferoverflowhigh \ +voidabstract \ -nullassign \ -unrecog \ @@ -158,22 +165,22 @@ SPLINTFLAGS = \ #standard rules default: all %.o: %.c - $(CC) -c $< -o $@ $(CFLAGS) + $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) exec-standalone.o: exec.c - $(CC) -c $< -o $@ $(CFLAGS) -DQCVM_EXECUTOR=1 + $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) -DQCVM_EXECUTOR=1 $(QCVM): $(OBJ_X) - $(CC) -o $@ $^ $(CFLAGS) -lm + $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(GMQCC): $(OBJ_C) $(OBJ_D) - $(CC) -o $@ $^ $(CFLAGS) -lm + $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(TESTSUITE): $(OBJ_T) - $(CC) -o $@ $^ $(CFLAGS) -lm + $(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(PAK): $(OBJ_P) - $(CC) -o $@ $^ $(CFLAGS) + $(CC) -o $@ $^ $(LDFLAGS) all: $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) @@ -183,12 +190,15 @@ test: all @ ./$(TESTSUITE) clean: - rm -f *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 + rm -f *.o $(GMQCC) $(QCVM) $(TESTSUITE) $(PAK) *.dat gource.mp4 *.exe splint: @ splint $(SPLINTFLAGS) *.c *.h gource: + @ gource $(GOURCEFLAGS) + +gource-record: @ gource $(GOURCEFLAGS) -o - | ffmpeg $(FFMPEGFLAGS) gource.mp4 depend: @@ -207,10 +217,10 @@ depend: install: install-gmqcc install-qcvm install-doc install-gmqcc: $(GMQCC) install -d -m755 $(DESTDIR)$(BINDIR) - install -m755 $(GMQCC) $(DESTDIR)$(BINDIR)/gmqcc + install -m755 $(GMQCC) $(DESTDIR)$(BINDIR)/$(GMQCC) install-qcvm: $(QCVM) install -d -m755 $(DESTDIR)$(BINDIR) - install -m755 $(QCVM) $(DESTDIR)$(BINDIR)/qcvm + install -m755 $(QCVM) $(DESTDIR)$(BINDIR)/$(QCVM) install-doc: install -d -m755 $(DESTDIR)$(MANDIR)/man1 install -m644 doc/gmqcc.1 $(DESTDIR)$(MANDIR)/man1/