]> de.git.xonotic.org Git - xonotic/gmqcc.git/blob - Makefile
importing initial ftepp.c; -E option now executes the preprocessor
[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           ftepp.o
29 OBJ_C = main.o lexer.o parser.o
30 OBJ_X = exec-standalone.o util.o con.o
31
32 #default is compiler only
33 default: gmqcc
34 %.o: %.c
35         $(CC) -c $< -o $@ $(CFLAGS)
36
37 exec-standalone.o: exec.c
38         $(CC) -c $< -o $@ $(CFLAGS) -DQCVM_EXECUTOR=1
39
40 qcvm:     $(OBJ_X)
41         $(CC) -o $@ $^ $(CFLAGS) -lm
42
43 # compiler target
44 gmqcc: $(OBJ_C) $(OBJ)
45         $(CC) -o $@ $^ $(CFLAGS)
46
47 all: gmqcc qcvm
48
49 clean:
50         rm -f *.o gmqcc qcvm
51         
52