add coq-categories as a submodule
[coq-hetmet.git] / Makefile
1 coqc     := coqc -noglob
2 coqfiles := $(shell find src -name \*.v  | grep -v \\\#)
3 allfiles := $(coqfiles) $(shell find src -name \*.hs | grep -v \\\#)
4
5 default: build/CoqPass.hs
6
7 build/CoqPass.hs: $(allfiles)
8         make build/Makefile.coq
9         cd build; make -f Makefile.coq Extraction.vo
10         cat src/Extraction-prefix.hs                                     > build/CoqPass.hs
11         cat build/Extraction.hs | grep -v '^module' | grep -v '^import' >> build/CoqPass.hs
12
13 build/Makefile.coq: $(coqfiles) src/categories/src
14         mkdir -p build
15         rm -f build/*.v
16         rm -f build/*.d
17         cd build; ln -fs `find ../src -name \*.v` .
18         cd build; coq_makefile *.v > Makefile.coq
19
20 src/categories/src:
21         git submodule update --init src/categories
22         cd compiler/categories; git checkout master
23
24 clean:
25         rm -rf build
26
27
28
29 # this is for Adam's use only!
30 push: build/CoqPass.hs
31         git push http://git.megacz.com/coq-hetmet.git master
32         git add -f build/CoqPass.hs; \
33           git commit -m 'update baked-in CoqPass.hs' && \
34           (git push -f http://git.megacz.com/coq-hetmet.git master:coq-extraction-baked-in; \
35            git reset HEAD^)
36         rm -rf .temp
37         mkdir .temp
38         cd .temp; ln -s ../src/*.v .
39         cd .temp; for A in *.v; do \
40           echo Latexing $$A ... ;\
41           echo '\\documentclass[9pt,landscape]{article}' > $$A.tex; \
42           echo '\\usepackage[landscape]{geometry}'       >> $$A.tex; \
43           echo '\\usepackage[cm]{fullpage}'       >> $$A.tex; \
44           echo '\\usepackage{amsmath}'        >> $$A.tex; \
45           echo '\\usepackage{amssymb}'        >> $$A.tex; \
46           echo '\\usepackage{stmaryrd}'       >> $$A.tex; \
47           echo '\\usepackage{upgreek}'        >> $$A.tex; \
48           echo '\\usepackage{parskip}'        >> $$A.tex; \
49           echo '\\begin{document}'            >> $$A.tex; \
50           echo '{{\\tt{'           >> $$A.tex; \
51           echo ''           >> $$A.tex; \
52           java -jar ~/bin/unicode2tex.jar < ../src/$$A >> $$A.tex;\
53           echo '}}}'                           >> $$A.tex; \
54           echo '\\end{document}'              >> $$A.tex; \
55           pdflatex $$A.tex < /dev/null; done
56         ssh login.eecs.berkeley.edu -- 'rm public_html/coq-in-ghc/pdfs/*.pdf' ; true
57         scp .temp/*.pdf login.eecs.berkeley.edu:public_html/coq-in-ghc/pdfs/
58         rm -rf .temp