826866b4132b3789aa00e353241c5233ec4564c9
[coq-hetmet.git] / Makefile
1 coqc     := coqc -noglob
2 coqfiles := $(shell find src -name \*.v)
3 allfiles := $(coqfiles) $(shell find src -name \*.hs)
4
5 default: build/CoqPass.hs
6
7 build/CoqPass.hs: build/Makefile.coq $(allfiles)
8
9         # first we build with -dont-load-proofs, since that runs very quickly
10         cd build; make -f Makefile.coq OPT="-dont-load-proofs" Main.vo
11
12         # however the final extraction must be done without -dont-load-proofs
13         cd build; make -f Makefile.coq Extraction.vo
14         cat src/Extraction-prefix.hs build/Extraction.hs > build/CoqPass.hs
15
16 build/Makefile.coq: $(coqfiles)
17         mkdir -p build
18         rm -f build/*.v
19         rm -f build/*.d
20         cd build; ln -s ../src/*.v .
21         cd build; coq_makefile *.v > Makefile.coq
22
23 clean:
24         rm -rf build