aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-23 21:54:40 +0100
committerlemon <lsof@mailbox.org>2025-11-23 21:57:01 +0100
commit6464ec389e2da17b1674858858406e211b16e5f6 (patch)
tree1b82b733851b88a0868635c6ab5afe1ea2298b7c /Makefile
parentd79251d487b57ea0e3b10640747eed723a06365c (diff)
ir: implement cvtu64f. and other bug fixes
compiler is bootstrapping?! however, stage1 and stage2+ executables aren't bit-identical.. small differences in the codegen.. need to look into that
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index be28de4..eb69747 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,8 @@ SRC=main.c io.c mem.c c/c.c c/lex.c c/eval.c c/builtin.c type.c targ.c \
CFLAGS=-Wall -std=c11 -pedantic
OBJ=$(patsubst %.c,build/%.o,$(SRC))
DEP=$(OBJ:.o=.d)
-OUT=antcc
+BUILDDIR?=build
+OUT?=antcc
all: CFLAGS += -g
all: $(OUT)
@@ -13,18 +14,19 @@ all: $(OUT)
opt: CFLAGS += -g -O2
opt: $(OUT)
-dbg: CFLAGS += -g -fsanitize=address -fsanitize=undefined
+dbg: CFLAGS += -g -fsanitize=address,undefined
+dbg: CC:=clang
dbg: $(OUT)
$(OUT): $(OBJ)
$(CC) $(CFLAGS) -o $@ $(OBJ)
-build/%.o: %.c common.h
+$(BUILDDIR)/%.o: %.c common.h
@mkdir -p `dirname $@`
- $(CC) $(CFLAGS) -MMD -MP -MT $@ -MF build/$*.d -c -o $@ $<
+ $(CC) $(CFLAGS) -MMD -MP -MT $@ -MF $(BUILDDIR)/$*.d -c -o $@ $<
clean:
- $(RM) -r build/ test/build/ $(OUT) *.o a.out
+ $(RM) -r $(BUILDDIR)/ test/build/ $(OUT) *.o a.out
.PHONY: clean