-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
132 lines (103 loc) · 4.29 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
REPO_PATH := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
PATH := $(PATH)
DOCKER_IMAGE_NAME ?= p6doc
DOCKER_HOST_PORT ?= 3000
DOCKER_SELINUX_LABEL ?= 0
SELINUX_OPT := $(shell [ $(DOCKER_SELINUX_LABEL) -eq 1 ] && echo ':Z' || echo '' )
.PHONY: html init-highlights html-nohighlight sparse assets webdev-build \
bigpage test xtest ctest help run clean-html clean-examples clean-images \
clean-search clean test-links extract-examples push \
docker-image docker-htmlify docker-test docker-xtest docker-ctest docker-testall docker-run
html: bigpage htmlify
htmlify: init-highlights assets
perl6 htmlify.p6
init-highlights:
ATOMDIR="./highlights/atom-language-perl6"; \
if [ -d "$$ATOMDIR" ]; then (cd "$$ATOMDIR" && git pull); \
else git clone https://github.com/perl6/atom-language-perl6 "$$ATOMDIR"; \
fi; cd highlights; npm install .
html-nohighlight:
perl6 htmlify.p6 --no-highlight
sparse:
perl6 htmlify.p6 --no-highlight --sparse=10
assets:
./app.pl assets
webdev-build:
perl6 htmlify.p6 --no-highlight --sparse=200
bigpage:
pod2onepage --html -v --source-path=./doc --exclude=404.pod6,/.git > html/perl6.html
# Common tests that are run by travis with every commit
test:
if [ "${TEST_JOBS}" != "" ]; then prove -j ${TEST_JOBS} -e perl6 t; else prove -e perl6 t; fi
# Extended tests
xtest:
if [ "${TEST_JOBS}" != "" ]; then prove -j ${TEST_JOBS} -e perl6 xt t; else prove -e perl6 xt t; fi
# Content tests
ctest:
prove --exec perl6 -r t/tabs.t xt/perl-nbsp.t xt/trailing-whitespace.t
help:
@echo "Usage: make [html|html-nohighlight|test|xtest|ctest]"
@echo ""
@echo "Options:"
@echo " html: generate the HTML documentation"
@echo " html-nohighlight: generate HTML documentation without syntax highlighting"
@echo " assets: generate CSS/JS assets"
@echo " sparse: generate HTML documention, but only every 10th file"
@echo "webdev-build: generate only a few HTML files (useful for testing website changes)"
@echo "bigpage: generate HTML documentation in one large file (html/perl6.html)"
@echo "init-highlights: install prereqs for highlights (runs as part of 'make html')"
@echo " test: run the test suite"
@echo " xtest: run the test suite, including extra tests"
@echo " ctest: run the test suite, content tests only"
@echo " run: run the development webserver"
@echo "docker-image: build Docker image from Dockerfile"
@echo "docker-htmlify: generate the HTML documentation (in container)"
@echo "docker-test: run the test suite (in container)"
@echo "docker-xtest: run the test suite, including extra tests (in container)"
@echo "docker-ctest: run the test suite, content tests only (in container)"
@echo "docker-testall: run all tests (in container)"
@echo "docker-run: run the development webserver (in container)"
run:
@echo "Starting local server…"
morbo -w assets app.pl
docker-image:
docker build -t $(DOCKER_IMAGE_NAME) .
docker-htmlify: docker-image docker-test
docker run --rm -v $(REPO_PATH):/perl6/doc/$(SELINUX_OPT) $(DOCKER_IMAGE_NAME) \
/bin/bash -c 'make html'
docker-test: docker-image
docker run --rm -v $(REPO_PATH):/perl6/doc/$(SELINUX_OPT) $(DOCKER_IMAGE_NAME) \
/bin/bash -c 'make test'
docker-xtest: docker-image
docker run --rm -v $(REPO_PATH):/perl6/doc/$(SELINUX_OPT) $(DOCKER_IMAGE_NAME) \
/bin/bash -c 'make xtest'
docker-ctest: docker-image
docker run --rm -v $(REPO_PATH):/perl6/doc/$(SELINUX_OPT) $(DOCKER_IMAGE_NAME) \
/bin/bash -c 'make ctest'
docker-testall: docker-test docker-xtest docker-ctest
docker-run: docker-image
docker run --rm -p $(DOCKER_HOST_PORT):3000 -v $(REPO_PATH):/perl6/doc/$(SELINUX_OPT) \
$(DOCKER_IMAGE_NAME) /bin/bash -c './app-start' &
clean-html:
rm -rf html/*.html html/.*.html \
html/.html \
html/language/ \
html/op/ \
html/programs/ \
html/routine/ \
html/syntax/ \
html/type/ \
$(NULL)
clean-examples:
rm -fr examples/*
clean-images:
rm -f html/images/type-graph*
clean-search:
rm -f html/js/search.js
clean: clean-html clean-images clean-search clean-examples
test-links: links.txt
./util/test-links.sh
extract-examples:
./util/extract-examples.p6 --source-path=./doc/ --prefix=./examples/
push: test
git pull --rebase && git push