Subset of C language with tree interpreter and bytecode compiler + VM.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
657 B

CFLAGS = -std=c99 -Werror -Wall -Wno-unused -g
OFLAGS = -std=c99 -Wno-unused -DNDEBUG -O2
CPPFLAGS = -I/opt/local/include
LDFLAGS = -L/opt/local/lib
LDLIBS = -lgc -lm
all : main
%.c : %.leg
leg -o $@ $<
% : %.c
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
opt : main.c
$(CC) $(OFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
test : main
./main -vv test.txt
demo : main
for i in demofiles/*.c; do echo "--------- $$i"; ./main $$i; done
demov : main
for i in demofiles/*.c; do echo $$i; ./main -vv $$i; done
bench : opt
time ./opt bench.c 28
spotless : clean
rm -rf *~ *.dSYM
clean : .FORCE
rm -f main opt
.FORCE :