X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=Makefile;h=6b28f87ed593ca23e453ac57cee9232382fe1d68;hb=5d23fc5f5f196ba6669497f0411b324dbd4b6808;hp=9101d2b12a3600ae8e410e3b8ea8d31decdcd8de;hpb=09fa41318de29930b9c0f909d76d66a7317414fe;p=xonotic%2Fgmqcc.git diff --git a/Makefile b/Makefile index 9101d2b..6b28f87 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC ?= clang -CFLAGS += -Wall -I. -pedantic-errors -std=c90 +CFLAGS += -Wall -I. -pedantic-errors #turn on tons of warnings if clang is present ifeq ($(CC), clang) @@ -16,25 +16,38 @@ ifeq ($(CC), clang) -Wno-format-nonliteral endif +ifeq ($(track), no) + CFLAGS += -DNOTRACK +endif + OBJ = \ util.o \ code.o \ ast.o \ - ir.o + ir.o \ + error.o OBJ_A = test/ast-test.o OBJ_I = test/ir-test.o OBJ_C = main.o lexer.o parser.o +OBJ_X = exec-standalone.o util.o #default is compiler only default: gmqcc %.o: %.c $(CC) -c $< -o $@ $(CFLAGS) +exec-standalone.o: exec.c + $(CC) -c $< -o $@ $(CFLAGS) -DQCVM_EXECUTOR=1 + # test targets test_ast: $(OBJ_A) $(OBJ) $(CC) -o $@ $^ $(CFLAGS) test_ir: $(OBJ_I) $(OBJ) $(CC) -o $@ $^ $(CFLAGS) +qcvm: $(OBJ_X) + $(CC) -o $@ $^ $(CFLAGS) -lm +exec.o: execloop.h +exec-standalone.o: execloop.h test: test_ast test_ir # compiler target @@ -45,6 +58,6 @@ gmqcc: $(OBJ_C) $(OBJ) all: test gmqcc clean: - rm -f *.o gmqcc test_ast test_ir test/*.o + rm -f *.o gmqcc qcvm test_ast test_ir test/*.o