X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=Makefile;h=b96168d49209314327533312f2062fa4dcbed186;hp=6d4a0edfb3ccbe5b512a73ff3687492cec29c1d9;hb=1b5504fb9eae2f1eb2a0ef90afecf35387087bcb;hpb=54c89e485afab107d39cf2cbee99e58a7570db27 diff --git a/Makefile b/Makefile index 6d4a0ed..b96168d 100644 --- a/Makefile +++ b/Makefile @@ -9,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 $(OPTIONAL) +CC ?= clang +# linker flags and optional additional libraries if required +LDFLAGS := +LIBS := -lm + +CFLAGS += -Wall -Wextra -Werror -I. -fno-strict-aliasing -fsigned-char $(OPTIONAL) ifneq ($(shell git describe --always 2>/dev/null),) CFLAGS += -DGMQCC_GITINFO="\"$(shell git describe --always)\"" endif @@ -25,14 +29,13 @@ ifeq ($(CC), clang) -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. ifneq ($(CC), tcc) - CFLAGS +=-pedantic-errors + CFLAGS +=-pedantic-errors -ffunction-sections -fdata-sections -Wl,-gc-sections else CFLAGS += -Wno-pointer-sign -fno-common endif @@ -100,6 +103,7 @@ GOURCEFLAGS= \ --max-files 99999999999 \ --max-file-lag 0.000001 \ --bloom-multiplier 1.3 \ + --logo doc/html/gmqcc.png \ -1280x720 #ffmpeg flags for gource @@ -150,7 +154,6 @@ SPLINTFLAGS = \ -kepttrans \ -unqualifiedtrans \ +matchanyintegral \ - -bufferoverflowhigh \ +voidabstract \ -nullassign \ -unrecog \ @@ -169,22 +172,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) @@ -194,7 +197,7 @@ 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 @@ -221,10 +224,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/