This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
91 lines (66 loc) · 2.35 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
bin = $(shell npm bin)
lsc = $(bin)/lsc
browserify = $(bin)/browserify
groc = $(bin)/groc
uglify = $(bin)/uglifyjs
VERSION = $(shell node -e 'console.log(require("./package.json").version)')
index.js: src/index.ls
$(lsc) -o . -c src/index.ls
building: src/building/*.ls
$(lsc) -o building -c src/building/*.ls
common: src/common/*.ls
$(lsc) -o common -c src/common/*.ls
folds: src/folds/*.ls
$(lsc) -o folds -c src/folds/*.ls
searching: src/searching/*.ls
$(lsc) -o searching -c src/searching/*.ls
sets: src/sets/*.ls
$(lsc) -o sets -c src/sets/*.ls
transformations: src/transformations/*.ls
$(lsc) -o transformations -c src/transformations/*.ls
zips: src/zips/*.ls
$(lsc) -o zips -c src/zips/*.ls
dist:
mkdir -p dist
dist/data.array.umd.js: compile dist
$(browserify) index.js --standalone data-array > $@
dist/data.array.umd.min.js: dist/data.array.umd.js
$(uglify) --mangle - < $^ > $@
# ----------------------------------------------------------------------
bundle: dist/data.array.umd.js
minify: dist/data.array.umd.min.js
compile: index.js building common folds searching sets transformations zips
documentation:
$(groc) --index "README.md" \
--out "docs/literate" \
src/*.ls test/*.ls test/specs/**.ls README.md
clean:
rm -rf dist build lib building transformations common searching zips folds sets
test:
$(lsc) test/tap.ls
package: compile documentation bundle minify
mkdir -p dist/data.array-$(VERSION)
cp -r docs/literate dist/data.array-$(VERSION)/docs
cp index.js dist/data.array-$(VERSION)
cp -r building dist/data.array-$(VERSION)
cp -r transformations dist/data.array-$(VERSION)
cp -r common dist/data.array-$(VERSION)
cp -r searching dist/data.array-$(VERSION)
cp -r zips dist/data.array-$(VERSION)
cp -r folds dist/data.array-$(VERSION)
cp -r sets dist/data.array-$(VERSION)
cp dist/*.js dist/data.array-$(VERSION)
cp package.json dist/data.array-$(VERSION)
cp README.md dist/data.array-$(VERSION)
cp LICENCE dist/data.array-$(VERSION)
cd dist && tar -czf data.array-$(VERSION).tar.gz data.array-$(VERSION)
publish: clean
npm install
npm publish
bump:
node tools/bump-version.js $$VERSION_BUMP
bump-feature:
VERSION_BUMP=FEATURE $(MAKE) bump
bump-major:
VERSION_BUMP=MAJOR $(MAKE) bump
.PHONY: test