-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
176 lines (147 loc) · 6.07 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
GDOC := doc/
DOC := doc-all/
CONTAINERSDOC := doc-cont/
DOCIND := doc-ind/
DOCSPILL := doc-spill/
PKGIND := pkg-lvc-ind/
PKGSPILL := pkg-lvc-spill/
EXTRA_DIR := extra
HEADER := $(EXTRA_DIR)/header.html
FOOTER := $(EXTRA_DIR)/footer.html
COQDOCFLAGSX := \
--external 'https://sigurdschneider.github.com/lvc/containers' Containers \
--toc --utf8 --toc-depth 3 --html --interpolate \
--index indexpage --no-lib-name --parse-comments \
--with-header $(HEADER) --with-footer $(FOOTER)
COQMAKEFILE := Makefile.coq
COQMAKE := +$(MAKE) -f $(COQMAKEFILE)
CORES=$(shell cat /proc/cpuinfo | grep cpu\ cores | sed 's/.*:\ //' | head -n 1)
VS=$(shell find theories/ -iname '*.v' | grep -v '/\.')
VSIND=$(shell find theories/ -iname '*vo' | sed 's/\.vo/.v/' | grep -v 'Spilling' | grep -v 'ValueOpts' | grep -v 'TransVal')
VSSPILL=$(shell find theories/ -iname '*vo' | sed 's/\.vo/.v/' | grep -v 'ValueOpts' | grep -v 'TransVal')
DOCS=$(shell find extra/ )
COMPCERTCFG=ppc-linux
ifeq ($(wildcard time.rb)$(wildcard .timing),time.rb.timing)
export TIMECMD=@./time.rb $(if $(findstring j,$(MAKEFLAGS)),--parallel,)
endif
export COQDOCFLAGS=--interpolate --utf8 --toc --toc-depth 3 --index indexpage --no-lib-name
export VERBOSE=false
#if [[ -z "$VANILLA" && -e "time.rb" ]]; then \
# echo "Patching ${MAKEFILE} to use ruby-based timing scripts (use --vanilla if undesired)."
ifneq "$(COQBIN)" ""
COQBIN := $(COQBIN)/
endif
all: $(COQMAKEFILE) dep
+$(MAKE) -f $(COQMAKEFILE) $@
depmakefiles:
+$(MAKE) -C paco Makefile.coq
+$(MAKE) -C ContainersPlugin Makefile.coq
CompCert/Makefile.config:
-cd CompCert && ./configure $(COMPCERTCFG) -ignore-coq-version
compcert: CompCert/Makefile.config
+$(MAKE) -C CompCert depend
+$(MAKE) -C CompCert proof driver/Version.ml
-rm CompCert/tools/*.o
-rm CompCert/tools/*.cm*
dep: compcert
+$(MAKE) -C paco all TIMECMD=
+$(MAKE) -C ContainersPlugin all TIMECMD=
+$(MAKE) -C smpl all TIMECMD=
depclean: clean
+$(MAKE) -C paco clean
+$(MAKE) -C ContainersPlugin clean
+$(MAKE) -C compiler clean
+$(MAKE) -C smpl clean
+$(MAKE) -C CompCert clean distclean
rm -rf compiler/extraction/*
distclean: clean depclean
find $(PKGIND)/ -type f -iname '*.vo' -o -iname '*.glob' -o -iname '*.v.d' | xargs rm -rf
doc-cont:
- rm -rf ContainersPlugin/html
make -C ContainersPlugin html
doc: clean-doc $(DOCS) dep $(COQMAKEFILE) doc-cont
- mkdir -p $(DOC)
make -f $(COQMAKEFILE) -j$(CORES) -k
coqdoc $(COQDOCFLAGSX) -d $(DOC) $(shell cat _CoqProject | grep -v ^-I | grep -v mlpack | grep -v ml4)
cp $(EXTRA_DIR)/resources/* $(DOC)
cp $(EXTRA_DIR)/index-all.html $(DOC)/index.html
cp $(EXTRA_DIR)/search-toc.html $(DOC)/search-toc.html
doc-publish: doc
scp -r $(DOC)/* ps:public_html/LVC/doc-all/
make -C ContainersPlugin doc
scp -r ContainersPlugin/html/* ps:public_html/LVC/doc-cont/
update-docs: doc
- rm -rf docs/
- mkdir -p docs
cp -r $(DOC)/* docs/
- mkdir -p docs/containers
cp -r ContainersPlugin/html/* docs/containers/
doc-quick:
scp -r $(DOC)/* ps:public_html/LVC/doc-all/
doc-ind: clean-doc $(DOCS)
- mkdir -p $(DOCIND)
make -f $(COQMAKEFILE) $(VSIND:.v=.vo) -j$(CORES)
coqdoc $(COQDOCFLAGS) -d $(DOCIND) $(shell cat _CoqProject | grep -v ^-I) $(VSIND)
cp $(EXTRA_DIR)/resources/* $(DOCIND)
cp $(EXTRA_DIR)/index-ind.html $(DOCIND)/index.html
cp $(EXTRA_DIR)/search-toc.html $(DOCIND)/search-toc.html
doc-ind-publish: doc-ind ind-package
scp -r $(DOCIND)/* ps:public_html/lvc-ind/
#scp -r lvc-ind.tgz ps:public_html/lvc-ind/
ind-package:
rm -rf $(PKGIND)
mkdir $(PKGIND)
cp -r _CoqProject compiler ContainersPlugin extra Makefile configure.sh paco src theories README.md $(PKGIND)
find $(PKGIND)/ -type f -iname '*.vo' -o -iname '*.glob' -o -iname '*.v.d' -o -iname '*.time' -o -iname '*.aux' | xargs rm -rf
rm -rf $(PKGIND)/theories/Spilling $(PKGIND)/theories/TransVal $(PKGIND)/theories/ValueOpts $(PKGIND)/theories/Test*
$(MAKE) -C $(PKGIND) clean depclean
cp Make Makefile.coq $(PKGIND)
rm -rf $(PKGIND)/src/*.cm* $(PKGIND)/src/*.o $(PKGIND)/src/*.ml4.d
rm -rf $(PKGIND)/compiler/lvcc.native
tar cvzf lvc-ind.tgz $(PKGIND)
spill-package:
rm -rf $(PKGSPILL)
mkdir $(PKGSPILL)
cp -r _CoqProject compiler ContainersPlugin smpl extra Makefile configure.sh paco src theories README.md CompCert $(PKGSPILL)
touch $(PKGSPILL)/_blacklist
find $(PKGSPILL)/ -type f -iname '*.vo' -o -iname '*.glob' -o -iname '*.v.d' -o -iname '*.time' -o -iname '*.aux' | xargs rm -rf
rm -rf $(PKGSPILL)/theories/TransVal $(PKGSPILL)/theories/ValueOpts $(PKGSPILL)/theories/Test* $(PKGSPILL)/theories/Lowering/ToMach.v $(PKGSPILL)/theories/DCE.v
$(MAKE) -C $(PKGSPILL) clean depclean
cp Makefile.coq $(PKGSPILL)
rm -rf $(PKGSPILL)/src/*.cm* $(PKGSPILL)/src/*.o $(PKGSPILL)/src/*.ml4.d
rm -rf $(PKGSPILL)/compiler/lvcc.native
cd $(PKGSPILL); ./configure.sh
tar cvzf lvc-spill.tgz $(PKGSPILL)
doc-spill: clean-doc $(DOCS)
- mkdir -p $(DOCSPILL)
make -f $(COQMAKEFILE) $(VSSPILL:.v=.vo) -j$(CORES)
coqdoc $(COQDOCFLAGS) -d $(DOCSPILL) $(shell cat _CoqProject | grep -v ^-I) $(VSSPILL)
cp $(EXTRA_DIR)/resources/* $(DOCSPILL)
cp $(EXTRA_DIR)/index-spill.html $(DOCSPILL)/index.html
cp $(EXTRA_DIR)/search-toc.html $(DOCSPILL)/search-toc.html
doc-spill-publish: doc-spill spill-package
cp lvc-spill.tgz $(DOCSPILL)/
-ssh ps rm public_html/lvc-spill/*
scp -r $(DOCSPILL)/* ps:public_html/lvc-spill/
ssh ps chmod -R g+w public_html/lvc-spill
ssh ps chown -R :gosarights public_html/lvc-spill
clean-doc:
rm -rf $(DOC)
clean: clean-doc
-$(COQMAKE) clean
rm -f $(COQMAKEFILE)
$(COQMAKEFILE): Makefile depmakefiles $(VS)
$(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq
# ./configure.sh
# coq_makefile -f _CoqProject $(VS) -o $(COQMAKEFILE)
Make: ;
extraction: compiler/STAMP
+$(MAKE) -C compiler all
compiler/STAMP: theories/Compiler.vo compiler/extraction.v theories/Lowering/ToLinear.vo theories/Lowering/LinearToAsm.vo theories/Lowering/IsLinearizable.vo
mkdir -p compiler/extraction
rm -f compiler/extraction/*
coqtop $(shell cat Make) -batch -load-vernac-source compiler/extraction.v
touch compiler/STAMP
%.vo:: $(COQMAKEFILE)
make -f $(COQMAKEFILE) -j$(CORES) $@
.PHONY: all clean clean-doc doc