blob: 7f58e16e18850446436fb8dd2da7d63ece01dc1a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
CFLAGS=-std=c11 -g -fno-common -Wall -Wno-switch
# CFLAGS=$(CFLAGS) -fsanitize=address
SRCS=$(wildcard *.c)
OBJS=$(addprefix build/,$(SRCS:.c=.o))
dietc: $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
build/%.o: %.c chibicc.h scripts/dietc_helpers.h.bytes
@mkdir -p build
$(CC) $(CFLAGS) -c $(word 1,$^) -o $@
scripts/%.bytes: scripts/%
python3 -c "print(', '.join([hex(ord(c)) for c in open('$^', 'r').read()]))" > $@
# Misc.
clean:
rm -rf dietc build
.PHONY: clean
|