Commit d9513ff7 authored by POTTIER Francois's avatar POTTIER Francois

Build all demos by default.

parent 42b60c4f
......@@ -5,6 +5,10 @@
# The following demos require menhirSdk:
# generate-printers
# The demos whose name ends in -dune require dune 1.4.
# If dune is absent, attempting to build these demos
# succeeds without actually doing anything.
DEMOS := \
calc \
calc-alias \
......@@ -13,6 +17,12 @@ DEMOS := \
calc-incremental \
calc-inspection \
generate-printers \
calc-dune \
calc-param-dune \
calc-two-dune \
calc-incremental-dune \
calc-inspection-dune \
generate-printers-dune \
.PHONY: all clean
......@@ -23,21 +33,3 @@ all clean::
clean::
/bin/rm -f *~ .*~
# The demos whose name ends in -dune require dune
# and assume that Menhir is installed. For now,
# they are not built by default. (TODO)
EXTRA := \
calc-dune \
calc-param-dune \
calc-two-dune \
calc-incremental-dune \
generate-printers-dune \
# calc-inspection-dune \
.PHONY: extra
extra::
@ for i in $(EXTRA) ; do \
$(MAKE) --no-print-directory -C $$i all ; \
done
.PHONY: all clean test
DUNE := jbuilder
DUNE := dune
EXECUTABLE := calc.exe
all:
......
open Lexing
open MenhirLib.General
open Parser.MenhirInterpreter
(* Instantiate [MenhirLib.Printers] for our parser. This requires providing a
few printing functions -- see [CalcPrinters]. *)
......
(jbuild_version 1)
(ocamllex
(modules lexer)
)
(ocamllex (lexer))
(menhir (
(modules (parser))
(menhir
(modules parser)
(flags ("--table" "--inspection" "-v" "-la" "2"))
))
)
(executable (
(executable
(name calc)
(libraries (menhirLib))
))
(libraries menhirLib)
)
(lang dune 1.4)
(using menhir 2.0)
open Lexing
open MenhirLib.General
open Parser.MenhirInterpreter
(* Instantiate [MenhirLib.Printers] for our parser. This requires providing a
few printing functions -- see [CalcPrinters]. *)
......
.merlin
_build
menhir-generate-printers
*.cmly
......@@ -9,8 +9,12 @@ MAIN := generate
EXECUTABLE := menhir-generate-printers
all:
$(DUNE) build $(MAIN).exe
cp -f _build/default/$(MAIN).exe $(EXECUTABLE)
@ if command -v $(DUNE) > /dev/null ; then \
$(DUNE) build $(MAIN).exe && \
cp -f _build/default/$(MAIN).exe $(EXECUTABLE) ; \
else \
echo "Error: $(DUNE) is required." ; \
fi
TEST := ../../test/good/parser_raw
......@@ -20,6 +24,6 @@ test: all
./$(EXECUTABLE) $(TEST).cmly
clean:
rm -f *~ .*~
$(DUNE) clean
rm -f $(EXECUTABLE)
@ rm -f $(EXECUTABLE)
@ rm -rf `cat .gitignore`
@ rm -f *~
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment