-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (41 loc) · 1.16 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
# This Makefile mostly copy/pasted from:
# http://www.greghendershott.com/2014/06/does-your-racket-project-need-a-makefile.html
PACKAGENAME=lambda-vc
COLLECTS=lambda-vc
SCRBL=lambda-vc/scribblings/lambda-vc.scrbl
.DEFAULT_GOAL: default
.PHONY: default clean setup link unlink htmldocs pages publish
default: setup
clean:
find . -name compiled -type d | xargs rm -rf
rm -rf htmldocs
setup:
raco setup $(COLLECTS)
link:
raco pkg install --link -n $(PACKAGENAME) --auto "$(PACKAGENAME)"
unlink:
raco pkg remove $(PACKAGENAME)
htmldocs: $(SCRBL)
raco scribble \
--html \
--dest htmldocs \
--dest-name index \
++main-xref-in \
--redirect-main http://docs.racket-lang.org/ \
\
$(SCRBL)
pages:
@(git branch -v | grep -q gh-pages || (echo local gh-pages branch missing; false))
@echo
@git branch -av | grep gh-pages
@echo
@(echo 'Is the branch up to date? Press enter to continue.'; read dummy)
git clone -b gh-pages . pages
publish: htmldocs pages
rm -rf pages/*
cp -r htmldocs/. pages/.
(cd pages; git add -A)
-(cd pages; git commit -m "Update $$(date +%Y%m%d%H%M%S)")
(cd pages; git push origin gh-pages)
rm -rf pages
git push origin gh-pages