Makefile 492 Bytes
Newer Older
1 2
.PHONY: all clean test

3
MENHIR          := menhir
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

MENHIRFLAGS     := --infer

OCAMLBUILD      := ocamlbuild -use-ocamlfind -use-menhir -menhir "$(MENHIR) $(MENHIRFLAGS)"

MAIN            := calc

all:
	$(OCAMLBUILD) $(MAIN).native

clean:
	rm -f *~ .*~
	$(OCAMLBUILD) -clean

test: all
	@echo "The following command should print 42:"
20 21 22
	echo "(1 + 2 * 10) * 2" | ./$(MAIN).native --algebraic
	@echo "The following command should print 42:"
	echo " 1 2 10 * + 2 *" | ./$(MAIN).native --reverse