forked from coq/opam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 1.33 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
COQWEB=~/COQ/www/
SUITES= core-dev extra-dev released stable-8.5
pp = cd $(COQWEB); yamlpp-0.3/yamlpp $(abspath $(1)) -o $(abspath $(2))
ifeq "$(shell test ! -z '$(COQWEB)' -a -d $(COQWEB) || echo false)" "false"
$(error "Please use 'make COQWEB=path/to/coq/www'")
endif
# refresh opam indexes + generate website
all: check-deps
@./scripts/refresh-opam-indexes $(SUITES)
@./scripts/archive2web templates/archive.html.in $(SUITES)
@$(call pp,templates/archive.html,www/archive.html)
@(echo '<#def TITLE>Archive Policy</#def>';\
echo '<#include "incl/header.html">';\
markdown POLICY.md;\
echo '<#include "incl/footer.html">') > templates/policy.html
@$(call pp,templates/policy.html,www/policy.html)
@ln -sf $(COQWEB)/styles www/styles
@ln -sf $(COQWEB)/files www/files
run: all
@echo "Starting a local web server for test"
@echo "It is accessible at: http://localhost:8000"
@cd www && python -m SimpleHTTPServer 8000
check-deps: \
which-opam which-lua5.1 opam-config which-markdown yamlpp
yamlpp:
cd $(COQWEB); make yamlpp-0.3/yamlpp incl/news/recent.html
which-%:
@which $* > /dev/null || (echo "Please install $*"; false)
pkg-%:
@dpkg -l $* > /dev/null 2>&1 || (echo "Please install $*"; false)
# opam admin fails if there is no ~/.opam/config
opam-config:
@[ -e $$HOME/.opam/config ] || (echo "Please run 'opam init'"; false)