forked from olivernn/lunr.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 999 Bytes
/
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
SRC = lib/lunr.js \
lib/utils.js \
lib/event_emitter.js \
lib/tokenizer.js \
lib/pipeline.js \
lib/vector.js \
lib/sorted_set.js \
lib/index.js \
lib/document_store.js \
lib/stemmer.js \
lib/stop_word_filter.js \
lib/token_store.js
YEAR = $(shell date +%Y)
VERSION = $(shell cat VERSION)
all: lunr.js lunr.min.js docs bower.json package.json
lunr.js: $(SRC)
cat $^ | \
sed "s/@YEAR/${YEAR}/" | \
sed "s/@VERSION/${VERSION}/" > $@
lunr.min.js: lunr.js
uglifyjs --compress --mangle --comments < $< > $@
bower.json:
cat build/bower.json.template | sed "s/@VERSION/${VERSION}/" > $@
package.json:
cat build/package.json.template | sed "s/@VERSION/${VERSION}/" > $@
size: lunr.min.js
gzip -c lunr.min.js | wc -c
test_server:
node server.js 3000
test:
phantomjs test/env/runner.js http://localhost:3000/test
docs:
dox < lunr.js | dox-template -n lunr.js -r ${VERSION} > docs/index.html
clean:
rm -f lunr{.min,}.js
rm bower.json
rm package.json
.PHONY: test clean docs