OCBFLAGS := -lib nums
OCB := ocamlbuild $(OCBFLAGS)

.PHONY: all debug clean top profile

all: code/main.exe
debug: all main.cma

code/main.exe: .FORCE
	cd code && dune build

test.s: code/main.exe
	./code/main.exe > test.s

test: test.s runtime.c
	gcc -o test -arch x86_64 test.s runtime.c

run:
	./test

.FORCE:

clean:
	dune clean
	rm -rf test.s test code/main.exe main.native code/*.cm* code/*.native
