This repository was archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (36 loc) · 1.25 KB
/
Makefile
File metadata and controls
50 lines (36 loc) · 1.25 KB
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
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)')
lib: src/*.ls
$(lsc) -o lib -c src/*.ls
dist:
mkdir -p dist
dist/folktale.laws.umd.js: compile dist
$(browserify) lib/index.js --standalone Laws > $@
dist/folktale.laws.umd.min.js: dist/folktale.laws.umd.js
$(uglify) --mangle - < $^ > $@
# ----------------------------------------------------------------------
bundle: dist/folktale.laws.umd.js
minify: dist/folktale.laws.umd.min.js
compile: lib
documentation:
$(groc) --index "README.md" \
--out "docs/literate" \
src/*.ls test/*.ls test/**/*.ls README.md
clean:
rm -rf dist build lib
test:
$(lsc) test/node.ls
package: compile documentation bundle minify
mkdir -p dist/laws-$(VERSION)
cp -r docs/literate dist/laws-$(VERSION)/docs
cp -r lib dist/laws-$(VERSION)
cp dist/*.js dist/laws-$(VERSION)
cp package.json dist/laws-$(VERSION)
cp README.md dist/laws-$(VERSION)
cp LICENCE dist/laws-$(VERSION)
cd dist && tar -czf laws-$(VERSION).tar.gz laws-$(VERSION)
.PHONY: test