Full continuations: FullCont captures frames/stack/env with deep copy. VM trampoline via setjmp/longjmp. Multi-shot safe via deep_copy_env. Portal (new c/portal.c): serialize env + continuation to JSON, resume on another machine. portal-checkpoint! triggers mid-VM save. 83/83 C unit tests + 181/181 functional tests pass.
39 lines
889 B
Makefile
39 lines
889 B
Makefile
# Makefile for uncommonlisp C interpreter
|
|
# Targets: all, test, bench, clean
|
|
|
|
CC = gcc
|
|
CFLAGS = -O2 -Wall -Wextra -Wno-unused-parameter -std=c11 -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE
|
|
LDFLAGS = -lm
|
|
|
|
# Optional: Boehm GC support
|
|
# Uncomment the next two lines if libgc-dev is installed
|
|
# CFLAGS += -DUSE_BOEHM_GC
|
|
# LDFLAGS += -lgc
|
|
|
|
SRCS = types.c reader.c printer.c eval.c builtins.c vm.c jit.c portal.c
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
.PHONY: all clean test bench
|
|
|
|
all: uncommonlisp
|
|
|
|
uncommonlisp: main.o $(OBJS)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
test: test_runner
|
|
./test_runner
|
|
|
|
test_runner: test.c $(OBJS)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
bench: bench_runner uncommonlisp
|
|
ulimit -s 65536 && ./bench_runner
|
|
|
|
bench_runner: bench.c $(OBJS)
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
%.o: %.c uncommonlisp.h
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
clean:
|
|
rm -f *.o uncommonlisp test_runner bench_runner
|