X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=BSDmakefile;h=5e2dc21ee68729f8a4dc815dfc7253ec8138fd4c;hb=c8a1b6563ef73f82e39202bc9802fee355a4699b;hp=6aea46ef781b590be0f573a07b085f598c221671;hpb=6f749d61b1688752bb902efd635f55d584ad7087;p=xonotic%2Fgmqcc.git diff --git a/BSDmakefile b/BSDmakefile index 6aea46e..5e2dc21 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -4,13 +4,14 @@ .include "include.mk" GITTEST != git describe --always 2>/dev/null +VALTEST != valgrind --version 2>/dev/null GITINFO := .if $(GITTEST) GITINFO != git describe --always .endif -CFLAGS += -Wall -Wextra -Werror -fno-strict-aliasing -DGMQCC_GITINFO=\"$(GITINFO)\"$(OPTIONAL) +CFLAGS += -Wall -Wextra -Werror -Wstrict-aliasing .if $(CC) == clang CFLAGS += -Weverything\ @@ -18,19 +19,28 @@ CFLAGS += -Wall -Wextra -Werror -fno-strict-aliasing -DGMQCC_GITINFO=\"$(GITI -Wno-format-nonliteral\ -Wno-disabled-macro-expansion\ -Wno-conversion\ - -Wno-missing-prototypes\ -Wno-float-equal\ -Wno-unknown-warning-option\ -Wno-cast-align\ - -Wstrict-prototypes + -pedantic-errors .else -. if $(CC) == tcc - CFLAGS += -Wstrict-prototypes -pedantic-errors +. if $(CC) != g++ + CFLAGS += -Wmissing-prototypes -Wstrict-prototypes +. endif + +. if $(CC) != tcc + CFLAGS += -pedantic-errors . else CFLAGS += -Wno-pointer-sign -fno-common . endif .endif +.if !$(VALTEST) + CFLAGS += -DNVALGRIND +.endif + + +CFLAGS += -DGMQCC_GITINFO=\"$(GITINFO)\" $(OPTIONAL) DEPS != for i in $(OBJ_C) $(OBJ_P) $(OBJ_T) $(OBJ_X); do echo $$i; done | sort | uniq QCVM = qcvm @@ -40,10 +50,10 @@ PAK = gmqpak #standard rules c.o: ${.IMPSRC} - $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS) + $(CC) -c ${.IMPSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) exec-standalone.o: exec.c - $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CPPFLAGS) $(CFLAGS) -DQCVM_EXECUTOR=1 + $(CC) -c ${.ALLSRC} -o ${.TARGET} $(CFLAGS) $(CPPFLAGS) -DQCVM_EXECUTOR=1 $(QCVM): $(OBJ_X) $(CC) -o ${.TARGET} ${.IMPSRC} $(LDFLAGS) $(LIBS) $(OBJ_X) @@ -112,7 +122,7 @@ stat.o: gmqcc.h opts.def test.o: gmqcc.h opts.def main.o: gmqcc.h opts.def lexer.h lexer.o: gmqcc.h opts.def lexer.h -parser.o: parser.h gmqcc.h opts.def lexer.h ast.h ir.h intrin.h +parser.o: parser.h gmqcc.h opts.def lexer.h ast.h ir.h code.o: gmqcc.h opts.def ast.o: gmqcc.h opts.def ast.h ir.h parser.h lexer.h ir.o: gmqcc.h opts.def ir.h