diff options
author | Matthew Sotoudeh <matthew@masot.net> | 2023-07-25 14:58:33 -0700 |
---|---|---|
committer | Matthew Sotoudeh <matthew@masot.net> | 2023-07-25 14:58:33 -0700 |
commit | 1d943da0cf9154e7ce78ce867cdbb91531c5d78e (patch) | |
tree | 40c5c6c3ba7fafa6567aa5b5aa216caecf3935fc /Makefile |
initial dietc commit
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 |