forked from jabbany/CommentCoreLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
60 lines (46 loc) · 1.62 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
BUILD_MINIFY = build/Parsers.js build/CommentCore.js
SRC_CORE = src/CommentFilter.js src/CommentSpaceAllocator.js src/CommentCoreLibrary.js
SRC_TRANSITION = src/CCLComment.js src/CommentFilter.js src/CommentTransitionSpaceAllocator.js src/CommentTransitionLibrary.js
ACSRC ?= parsers/AcfunFormat.js
BILISRC ?= parsers/BilibiliFormat.js
DIR = src/
all-uglify: all uglify
all-concat-only: all concat-only
all: clean core parsers css
core: $(SRC_CORE)
cat $^ > build/CommentCore.js
core-transition: $(SRC_TRANSITION)
cat $^ > build/CommentCoreT.js
parsers: parserbili parserac
cat build/AParser.js build/BParser.js > build/Parsers.js
rm build/AParser.js
rm build/BParser.js
parserbili:
ifneq ($(BILISRC),)
cat $(DIR)$(BILISRC) > build/BParser.js
endif
parserac:
ifneq ($(ACSRC),)
cat $(DIR)$(ACSRC) > build/AParser.js
endif
css:
cp src/base.css build/base.css
cp src/fontalias.css build/fontalias.css
cat build/base.css build/fontalias.css > build/style.css
rm -f build/base.css
rm -f build/fontalias.css
concat-only: $(BUILD_MINIFY)
cat $^ > build/CommentCoreLibrary.tmp
rm build/*.js
mv build/CommentCoreLibrary.tmp build/CommentCoreLibrary.js
uglify: $(BUILD_MINIFY)
node ./node_modules/uglify-js/bin/uglifyjs $^ -c -m -o build/CommentCoreLibrary.tmp --preamble "/* CommentCoreLibrary (//github.com/jabbany/CommentCoreLibrary) - Licensed under the MIT License */"
rm build/*.js
mv build/CommentCoreLibrary.tmp build/CommentCoreLibrary.js
extensions: extensions-scripting
extensions-scripting:
cp experimental/bscript.js build/CCLScripting.js
cp experimental/api.worker.js build/api.worker.js
clean:
rm -rf build/
mkdir build