From 6a1d9613fb6c036dc8d41bfdfeeb6e80ac4f17a8 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Mon, 2 Sep 2024 16:15:03 -0700 Subject: compile helper code in --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile') 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: -- cgit v1.2.3