]> git.xonotic.org Git - xonotic/gmqcc.git/blob - Makefile
New test-suite initial implementation. Just need to write some tests.
[xonotic/gmqcc.git] / Makefile
1 CC     ?= clang
2 CFLAGS += -Wall -I. -fomit-frame-pointer -fno-stack-protector -fno-common
3 #turn on tons of warnings if clang is present
4 ifeq ($(CC), clang)
5         CFLAGS +=                  \
6                 -Weverything                  \
7                 -Wno-missing-prototypes       \
8                 -Wno-unused-parameter         \
9                 -Wno-sign-compare             \
10                 -Wno-implicit-fallthrough     \
11                 -Wno-sign-conversion          \
12                 -Wno-conversion               \
13                 -Wno-disabled-macro-expansion \
14                 -Wno-padded                   \
15                 -Wno-format-nonliteral
16
17 endif
18 ifeq ($(track), no)
19     CFLAGS += -DNOTRACK
20 endif
21
22 OBJ     = \
23           util.o      \
24           code.o      \
25           ast.o       \
26           ir.o        \
27           con.o
28           
29 OBJ_T = test.o util.o con.o
30 OBJ_C = main.o lexer.o parser.o
31 OBJ_X = exec-standalone.o util.o con.o
32
33 #default is compiler only
34 default: gmqcc
35 %.o: %.c
36         $(CC) -c $< -o $@ $(CFLAGS)
37
38 exec-standalone.o: exec.c
39         $(CC) -c $< -o $@ $(CFLAGS) -DQCVM_EXECUTOR=1
40
41 qcvm: $(OBJ_X)
42         $(CC) -o $@ $^ $(CFLAGS) -lm
43
44 gmqcc: $(OBJ_C) $(OBJ)
45         $(CC) -o $@ $^ $(CFLAGS)
46
47 test: $(OBJ_T)
48         $(CC) -o $@ $^ $(CFLAGS)
49         
50 runtests:
51         ./test
52
53 #all target is test and all
54 all: gmqcc qcvm test
55
56 clean:
57         rm -f *.o gmqcc qcvm test *.dat
58         
59