summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthew@masot.net>2024-09-02 16:15:03 -0700
committerMatthew Sotoudeh <matthew@masot.net>2024-09-02 16:15:03 -0700
commit6a1d9613fb6c036dc8d41bfdfeeb6e80ac4f17a8 (patch)
tree866c0722442c8cc934e1370c6fc060463934b174 /Makefile
parentc3035ba7d2c2f50c7ab815e88b08edd5c6e92008 (diff)
compile helper code in
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 79e825b..7f58e16 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,19 @@
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)
+ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
-build/%.o: %.c chibicc.h
+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:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback