all: lumbda lumbda-gc lumbda-full

lumbda: lumbda.s
	as --64 -o lumbda.o lumbda.s
	ld -o lumbda lumbda.o

lumbda-gc: lumbda.s
	as --64 --defsym GC_NAIVE=1 -o lumbda-gc.o lumbda.s
	ld -o lumbda-gc lumbda-gc.o

# lumbda-full — GC + quasiquote + define-macro + case + prelude (ticket 0005).
# CL_FULL is additive; the default and -gc binaries keep their current size.
lumbda-full: lumbda.s
	as --64 --defsym GC_NAIVE=1 --defsym CL_FULL=1 -o lumbda-full.o lumbda.s
	ld -o lumbda-full lumbda-full.o

test: lumbda
	@bash test.sh

test-gc: lumbda-gc
	@LUMBDA_BIN=./lumbda-gc bash test.sh

test-full: lumbda-full
	@LUMBDA_BIN=./lumbda-full bash test.sh

clean:
	rm -f lumbda.o lumbda lumbda-gc.o lumbda-gc lumbda-full.o lumbda-full

.PHONY: all test test-gc test-full clean
