X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=Makefile;h=b2d65805d0a3ca7c0b67877b8fca386d90fc3f9d;hb=dcacaca2e84dfa914f0f1d16eea99fdaba5b372e;hp=4090ab4315f49b7861bcdaa1fd658943ed1a20f6;hpb=ce941066db29fa369384725bb6d388b98d035eac;p=xonotic%2Fgmqcc.git diff --git a/Makefile b/Makefile index 4090ab4..b2d6580 100644 --- a/Makefile +++ b/Makefile @@ -1,48 +1,50 @@ CC ?= clang -CFLAGS += -Wall -I. -pedantic-errors -std=c90 - +CFLAGS += -Wall -I. -fomit-frame-pointer -fno-stack-protector #turn on tons of warnings if clang is present ifeq ($(CC), clang) - CFLAGS += \ - -Weverything \ - -Wno-missing-prototypes \ - -Wno-unused-parameter \ - -Wno-sign-compare \ - -Wno-implicit-fallthrough \ - -Wno-sign-conversion \ - -Wno-conversion \ + CFLAGS += \ + -Weverything \ + -Wno-missing-prototypes \ + -Wno-unused-parameter \ + -Wno-sign-compare \ + -Wno-implicit-fallthrough \ + -Wno-sign-conversion \ + -Wno-conversion \ -Wno-disabled-macro-expansion \ - -Wno-padded \ - -Wno-undef \ - -Wno-conditional-uninitialized \ - -Wno-missing-noreturn \ - -Wno-ignored-qualifiers \ + -Wno-padded \ -Wno-format-nonliteral endif -OBJ = lex.o \ - error.o \ - parse.o \ - typedef.o \ +ifeq ($(track), no) + CFLAGS += -DNOTRACK +endif + +OBJ = \ util.o \ code.o \ - asm.o \ ast.o \ - ir.o + ir.o \ + con.o OBJ_A = test/ast-test.o OBJ_I = test/ir-test.o -OBJ_C = main.o +OBJ_C = main.o lexer.o parser.o +OBJ_X = exec-standalone.o util.o con.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 test: test_ast test_ir # compiler target @@ -53,6 +55,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