#
# Illustrate the use of a ocaml programs that calls the lutin interpreter
# via sockets



################################################################

CMXA_LIB = unix.cmxa
MAIN=call_foo_via_socket

ifndef OCAMLOPT
OCAMLOPT=ocamlopt.opt
endif

OCAMLC=ocamlc.opt

$(MAIN).opt:$(MAIN).ml
	$(OCAMLOPT) $(CMXA_LIB) $(MAIN).ml -o $(MAIN).opt

$(MAIN):$(MAIN).ml
	$(OCAMLC)  $(MAIN).ml -o $(MAIN)


################################################################


clean:
	rm -f *.top *.cmi *.cmo *.cmx *.o *.cma *.cmxa *.a *.cmi *.cmo *.cmi *.cmx *.o  *~ $(MAIN) $(MAIN).opt *~ *.pp_luc *.rif test.res


test: clean $(MAIN).opt
	./$(MAIN).opt
	rm -f test.res && diff -B -u -w -i $(MAIN).rif.exp $(MAIN).rif > test.res && \
	[ ! -s test.res ] && make clean

utest:
	cp $(MAIN).rif $(MAIN).rif.exp



