diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..79e825b --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +CFLAGS=-std=c11 -g -fno-common -Wall -Wno-switch +CFLAGS+=-DDIETC_ROOT="\"$(PWD)\"" +# CFLAGS=$(CFLAGS) -fsanitize=address + +SRCS=$(wildcard *.c) +OBJS=$(addprefix build/,$(SRCS:.c=.o)) + +dietc: $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +build/%.o: %.c chibicc.h + @mkdir -p build + $(CC) $(CFLAGS) -c $(word 1,$^) -o $@ + +# Misc. + +clean: + rm -rf dietc build + +.PHONY: clean |