forked from plfa/plfa.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (77 loc) · 2.71 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
agda := $(wildcard src/*.lagda) $(wildcard src/**/*.lagda)
agdai := $(wildcard src/*.agdai) $(wildcard src/**/*.agdai)
markdown := $(subst src/,out/,$(subst .lagda,.md,$(agda)))
all: $(markdown)
test: build
ruby -S bundle exec htmlproofer _site --disable-external
statistics:
hs/agda-count
out/:
mkdir -p out/
out/%.md: src/%.lagda | out/
agda2html --verbose --link-to-agda-stdlib --link-to-local-agda-names --use-jekyll=out/ -i $< -o $@ 2>&1 \
| sed '/^Generating.*/d; /^Warning\: HTML.*/d; /^reached from the.*/d; /^\s*$$/d'
@sed -i '1 s|---|---\nsrc : $(<)|' $@
serve:
ruby -S bundle exec jekyll serve
# start server
server-start:
ruby -S bundle exec jekyll serve --no-watch --detach
# stop server
server-stop:
pkill -f jekyll
# build website using jekyll
build: $(markdown)
ruby -S bundle exec jekyll build
# build website using jekyll incrementally
build-incremental:
ruby -S bundle exec jekyll build --incremental
# remove all auxiliary files
clean:
ifneq ($(strip $(agdai)),)
rm $(agdai)
endif
# remove all generated files
clobber: clean
ruby -S bundle exec jekyll clean
rm -rf out/
# install bundler, and gem dependencies
macos-setup:
brew install libxml2
ruby -S gem install bundler --no-ri --no-rdoc
ruby -S gem install pkg-config --no-ri --no-rdoc -v "~> 1.1"
ruby -S bundle config build.nokogiri --use-system-libraries
ruby -S bundle install
# install agda, agda-stdlib, and agda2html
travis-setup:\
$(HOME)/agda-master/\
$(HOME)/agda-stdlib-master/\
$(HOME)/agda2html-master/\
$(HOME)/acknowledgements-master/
$(HOME)/agda-master/:
curl -L https://github.com/agda/agda/archive/master.zip -o $(HOME)/agda-master.zip
unzip -qq $(HOME)/agda-master.zip -d $(HOME)
cd $(HOME)/agda-master;\
stack install --stack-yaml=stack-8.2.2.yaml
$(HOME)/agda-stdlib-master/:
curl -L https://github.com/agda/agda-stdlib/archive/master.zip -o $(HOME)/agda-stdlib-master.zip
unzip -qq $(HOME)/agda-stdlib-master.zip -d $(HOME)
mkdir -p $(HOME)/.agda
echo "standard-library" > $(HOME)/.agda/defaults
echo "$(HOME)/agda-stdlib-master/standard-library.agda-lib" > $(HOME)/.agda/libraries
$(HOME)/agda2html-master/:
curl -L https://github.com/wenkokke/agda2html/archive/master.zip -o $(HOME)/agda2html-master.zip
unzip -qq $(HOME)/agda2html-master.zip -d $(HOME)
cd $(HOME)/agda2html-master;\
stack install
$(HOME)/acknowledgements-master/:
curl -L https://github.com/plfa/acknowledgements/archive/master.zip -o $(HOME)/acknowledgements-master.zip
unzip -qq $(HOME)/acknowledgements-master.zip -d $(HOME)
cd $(HOME)/acknowledgements-master;\
stack install
.phony: serve build test clean clobber macos-setup travis-setup
# workaround for a bug in agda2html
bugfix:
@mkdir -p out
@touch out/Nat.md
.phony: bugfix