forked from solvespace/solvespace-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (33 loc) · 999 Bytes
/
Makefile
File metadata and controls
41 lines (33 loc) · 999 Bytes
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
REMOTE ?= git@github.com:solvespace/solvespace-web
PAGES := \
index examples tutorial bracket box constraints linkage 2d \
features download ref tech library contact
ASSETS := \
$(wildcard pics/*) $(wildcard vids/*) $(wildcard dl/*) \
style.css support.js
OUTPUT := \
$(patsubst %,html/%.html,$(PAGES)) \
$(patsubst %,html/%,$(ASSETS))
html/%.html: %.pl TEMPL.pm
HTML=1 perl -I. $< >$@
html/%: %
@mkdir -p $(dir $@)
cp $< $@
all: $(OUTPUT)
check: all
# requires w3c-linkchecker
checklink -qr html/index.html -X 'html/forum.html$$' | tee checklink.txt
if grep "Code:\ 404" checklink.txt >/dev/null; then exit 1; else rm checklink.txt; fi
clean:
@rm -rf html/*
gh-pages: all
mkdir .gh-pages
cp .gitattributes .gh-pages/
git -C .gh-pages init -q
git -C .gh-pages checkout -q -b gh-pages
cp -rLT html .gh-pages
git -C .gh-pages add .
git -C .gh-pages commit -q -m "Generate documentation."
git -C .gh-pages push -f -q $(REMOTE) gh-pages
rm -rf .gh-pages
.PHONY: all clean