-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
76 lines (64 loc) · 1.97 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
# See LICENSE for licensing details.
DUNE := dune
# run with `make BYTECODE=true` to produce bytecode
EXTN := $(if $(strip $(BYTECODE)),bc,exe)
BINS := $(patsubst %,%.$(EXTN),src/abella src/abella_doc src/abella_dep)
.PHONY: all
all: support/.stamp
$(DUNE) build $(BINS)
.PHONY: all-release
all-release: # support/.stamp
$(DUNE) build --release $(BINS)
support/.stamp: $(wildcard support/ts/*.ts support/css/*.css)
( cd support && \
npm install --no-save && \
npm run build && \
touch .stamp )
AIN := abella.install
.PHONY: $(AIN)
$(AIN):
$(RM) $(AIN)
echo 'bin: [' >> $(AIN)
echo '"_build/default/src/abella.$(EXTN)" {"abella"}' >> $(AIN)
echo '"_build/default/src/abella_doc.$(EXTN)" {"abella_doc"}' >> $(AIN)
echo '"_build/default/src/abella_dep.$(EXTN)" {"abella_dep"}' >> $(AIN)
echo ']' >> $(AIN)
echo 'man: [' >> $(AIN)
for pr in _build/default/src/*.$(EXTN) ; do \
$$pr --help=groff > $${pr%%.$(EXTN)}.1 ; \
echo '"'$${pr%%.$(EXTN)}.1'"' >> $(AIN) ; \
done
echo ']' >> $(AIN)
echo 'share: [' >> $(AIN)
for f in emacs/* `find examples -type f | grep -E '(sig|mod|thm)$$'` ; do \
echo '"'$$f'"' '{"'$$f'"}' >> $(AIN) ; \
done
echo ']' >> $(AIN)
.PHONY: clean
clean:
$(DUNE) clean
$(RM) abella $(BINS) $(AIN)
.PHONY: test
test:
$(DUNE) runtest --release
.PHONY: publish-doc
publish-doc: examples/make.stamp
rsync -aviz \
--exclude '*.thc' \
--exclude '*.out' \
--exclude '*.json' \
--exclude '*.stamp' \
--exclude '.gitignore' \
examples abellaweb@abella-prover.org:abella-prover.org/
examples/make.stamp: $(wildcard examples/**/*.{sig,mod,thm})
examples/make.stamp: $(wildcard _build/default/src/abella*.$(EXTN))
examples/make.stamp: $(wildcard $(patsubst %.thm,%.thc,$(wildcard examples/**/*.thm)))
examples/make.stamp:
git clean -fxd examples
$(DUNE) exec src/abella_doc.$(EXTN) -- -r examples
touch examples/make.stamp
.PHONY: makefile_debug
makefile_debug:
@echo "BYTECODE='$(BYTECODE)'"
@echo "EXTN='$(EXTN)'"
@echo "BINS='$(BINS)'"