TOP=../..

LAUNCH=env TOP=$(TOP) ocamlfind camlp5-buildscripts/LAUNCH --
OCAMLFIND=$(LAUNCH) ocamlfind
PACKAGES=camlp5,fmt

all: streams streams.opt

streams: streams.ml
	$(OCAMLFIND) ocamlc -package $(PACKAGES) -linkpkg -syntax camlp5o streams.ml -o $@

streams.opt: streams.ml
	$(OCAMLFIND) ocamlopt -package $(PACKAGES) -linkpkg -syntax camlp5o streams.ml -o $@

test:: all
	./streams '1+1' '1 - 1' '1 + (2 * 3)'

clean:
	rm -f streams streams.opt *.cm* *.o

