Makefile 436 Bytes
Newer Older
1 2 3 4 5 6 7
.PHONY: all clean test

# Find Menhir.
ifndef MENHIR
  MENHIR := $(shell ../find-menhir.sh)
endif

Frédéric Bour's avatar
Frédéric Bour committed
8
MENHIRFLAGS     := --infer --table
9 10 11 12 13 14 15 16 17

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

MAIN            := calc

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

clean:
18
	rm -f *~ .*~
19 20 21 22 23 24
	$(OCAMLBUILD) -clean

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