Debian Codegraph @

TacticTrace/Makefile

raw
1 OCAMLC = ocamlc
2 OCAMLFIND = ocamlfind
3 OCAMLLEX = ocamllex
4 OCAMLYACC = ocamlyacc
5 OCAMLCPARAM = -g
6
7 TYPES_SOURCES = ocamlTypes.ml types_parser.ml types_lexer.ml
8 TYPES_OBJECTS = $(TYPES_SOURCES:.ml=.cmo)
9
10 # Set the HOLLIGHT_DIR to <this Makefile>/..
11 HOLLIGHT_DIR?=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))/..
12
13 TESTS =\
14 examples/tactic.ml \
15 examples/conv.ml
16
17 TEST_OUTPUTS = $(TESTS:.ml=.outdir)
18
19
20 all: types_test tracer
21
22 tracer: $(TYPES_OBJECTS) tracer.ml
23 $(OCAMLFIND) $(OCAMLC) -package compiler-libs.common $(OCAMLCPARAM) -linkpkg -o tracer $^
24
25 types_test: $(TYPES_OBJECTS) types_test.ml
26 $(OCAMLC) $(OCAMLCPARAM) -o $@ $^
27
28 types_parser.ml types_parser.mli: types_parser.mly
29 $(OCAMLYACC) types_parser.mly
30
31 types_lexer.ml: types_lexer.mll
32 $(OCAMLLEX) types_lexer.mll
33
34 %.cmo: %.ml
35 $(OCAMLFIND) $(OCAMLC) -package compiler-libs.common $(OCAMLCPARAM) -c $<
36
37 %.cmi: %.mli
38 $(OCAMLFIND) $(OCAMLC) -package compiler-libs.common $(OCAMLCPARAM) -c $<
39
40 # Dependencies
41 types_test.cmo: ocamlTypes.cmo types_parser.cmo types_lexer.cmo
42 types_parser.cmo: types_parser.ml types_parser.cmi ocamlTypes.cmo ocamlTypes.cmi
43 types_lexer.cmo: types_lexer.ml types_parser.cmo
44 ocamlTypes.cmo: ocamlTypes.ml
45
46 test: $(TEST_OUTPUTS)
47
48 examples/%.outdir: examples/%.ml tracer
49 if [ `$(HOLLIGHT_DIR)/hol.sh -use-module` -eq 0 ]; then echo "HOLLIGHT_USE_MODULE unset"; exit 0; fi
50 $(HOLLIGHT_DIR)/hol.sh inline-load $< $(basename $<)_inlined.ml
51 HOLLIGHT_DIR=$(HOLLIGHT_DIR) $(HOLLIGHT_DIR)/TacticTrace/modify-proof.sh $(basename $<)_inlined.ml $(basename $<)_inlined_wrapped.ml $(basename $<).outdir
52 $(HOLLIGHT_DIR)/hol.sh compile $(basename $<)_inlined_wrapped.ml -o $(basename $<).cmx
53 $(HOLLIGHT_DIR)/hol.sh link $(basename $<).cmx -o $(basename $<).native
54 $(basename $<).native > $(basename $<).hollog # Use cat to strip ANSI color codes
55
56
57 clean:
58 rm -f *.cmo *.cmi tracer types_test types_parser.ml types_parser.mli types_lexer.ml kernel_wrapper.ml
59 rm -rf $(TEST_OUTPUTS) examples/*.cm* examples/*_inlined* examples/*.o examples/*.hollog examples/*.native
60
61 .PHONY: all clean