blob: 2b2a7cae30417a911217865eb581f68734027472 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
SRC=main.c io.c mem.c c.c lex.c type.c targ.c eval.c ir.c irdump.c ssa.c cfg.c \
intrin.c abi0.c optmem.c regalloc.c amd64/sysv.c amd64/isel.c amd64/emit.c obj.c elf.c
CFLAGS=-Wall -std=c11 -pedantic
OBJ=$(patsubst %.c,obj/%.o,$(SRC))
DEP=$(OBJ:.o=.d)
OUT=antcc
all: CFLAGS += -g
all: $(OUT)
opt: CFLAGS += -O2
opt: $(OUT)
dbg: CFLAGS += -g -fsanitize=address -fsanitize=undefined
dbg: $(OUT)
$(OUT): $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ)
obj/%.o: %.c common.h
@mkdir -p `dirname $@`
$(CC) $(CFLAGS) -MMD -MP -MT $@ -MF obj/$*.d -c -o $@ $<
clean:
$(RM) -r obj/ $(OUT) *.o a.out
.PHONY: clean
-include $(DEP)
|