2 CFLAGS += -Wall -I. -pedantic-errors -std=c90
4 #turn on tons of warnings if clang is present
8 -Wno-missing-prototypes \
9 -Wno-unused-parameter \
11 -Wno-implicit-fallthrough \
12 -Wno-sign-conversion \
14 -Wno-disabled-macro-expansion \
16 -Wno-format-nonliteral
24 OBJ_A = test/ast-test.o
25 OBJ_I = test/ir-test.o
26 OBJ_C = main.o lexer.o parser.o
28 #default is compiler only
31 $(CC) -c $< -o $@ $(CFLAGS)
34 test_ast: $(OBJ_A) $(OBJ)
35 $(CC) -o $@ $^ $(CFLAGS)
36 test_ir: $(OBJ_I) $(OBJ)
37 $(CC) -o $@ $^ $(CFLAGS)
38 test: test_ast test_ir
41 gmqcc: $(OBJ_C) $(OBJ)
42 $(CC) -o $@ $^ $(CFLAGS)
44 #all target is test and all
48 rm -f *.o gmqcc test_ast test_ir test/*.o