forked from jcubic/jquery.terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (93 loc) · 5.06 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
VERSION=2.4.1
SED=sed
CD=cd
NPM=npm
CP=cp
RM=rm
CAT=cat
DATE=`date -uR`
GIT=git
BRANCH=`git branch | grep '^*' | sed 's/* //'`
UGLIFY=./node_modules/.bin/uglifyjs
JSONLINT=./node_modules/.bin/jsonlint
JEST=./node_modules/.bin/jest
CSSNANO=node ./scripts/cssnano.js
ESLINT=./node_modules/.bin/eslint
TSC=./node_modules/.bin/tsc
SPEC_CHECKSUM=`md5sum __tests__/terminal.spec.js | cut -d' ' -f 1`
COMMIT=`git log -n 1 | grep '^commit' | sed 's/commit //'`
URL=`git config --get remote.origin.url`
skip_re="[xfi]it\\(|[fdx]describe\\("
.PHONY: coverage test coveralls lint.src eslint skipped_tests jsonlint publish lint tscheck emoji
ALL: Makefile .$(VERSION) terminal.jquery.json bower.json package.json js/jquery.terminal-$(VERSION).js js/jquery.terminal.js js/jquery.terminal-$(VERSION).min.js js/jquery.terminal.min.js js/jquery.terminal.min.js.map css/jquery.terminal-$(VERSION).css css/jquery.terminal-$(VERSION).min.css css/jquery.terminal.min.css css/jquery.terminal.min.css.map css/jquery.terminal.css README.md import.html js/terminal.widget.js www/Makefile css/emoji.css
bower.json: templates/bower.in .$(VERSION)
$(SED) -e "s/{{VER}}/$(VERSION)/g" templates/bower.in > bower.json
package.json: templates/package.in .$(VERSION)
$(SED) -e "s/{{VER}}/$(VERSION)/g" templates/package.in > package.json
js/jquery.terminal-$(VERSION).js: js/jquery.terminal-src.js .$(VERSION)
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e "s/{{DATE}}/$(DATE)/g" js/jquery.terminal-src.js > js/jquery.terminal-$(VERSION).js || $(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s/{{DATE}}/$(DATE)/g" js/jquery.terminal-src.js > js/jquery.terminal-$(VERSION).js
js/jquery.terminal.js: js/jquery.terminal-$(VERSION).js
$(CP) js/jquery.terminal-$(VERSION).js js/jquery.terminal.js
js/jquery.terminal-$(VERSION).min.js: js/jquery.terminal.min.js
$(CP) js/jquery.terminal.min.js js/jquery.terminal-$(VERSION).min.js
js/jquery.terminal.min.js js/jquery.terminal.min.js.map: js/jquery.terminal-$(VERSION).js
$(UGLIFY) -o js/jquery.terminal.min.js --comments --mangle --source-map "includeSources,url='jquery.terminal.min.js.map'" -- js/jquery.terminal.js
css/jquery.terminal-$(VERSION).css: css/jquery.terminal-src.css .$(VERSION)
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e "s/{{DATE}}/$(DATE)/g" css/jquery.terminal-src.css > css/jquery.terminal-$(VERSION).css || $(SED) -e "s/{{VER}}/$(VERSION)/g" -e "s/{{DATE}}/$(DATE)/g" css/jquery.terminal-src.css > css/jquery.terminal-$(VERSION).css
css/jquery.terminal.css: css/jquery.terminal-$(VERSION).css .$(VERSION)
$(CP) css/jquery.terminal-$(VERSION).css css/jquery.terminal.css
css/jquery.terminal.min.css css/jquery.terminal.min.css.map: css/jquery.terminal.css
$(CSSNANO) css/jquery.terminal.css css/jquery.terminal.min.css
css/jquery.terminal-$(VERSION).min.css: css/jquery.terminal.min.css
$(CP) css/jquery.terminal.min.css css/jquery.terminal-$(VERSION).min.css
README.md: templates/README.in .$(VERSION) __tests__/terminal.spec.js
$(GIT) branch | grep '* devel' > /dev/null && $(SED) -e "s/{{VER}}/DEV/g" -e \
"s/{{BRANCH}}/$(BRANCH)/g" -e "s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" \
-e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md || $(SED) -e \
"s/{{VER}}/$(VERSION)/g" -e "s/{{BRANCH}}/$(BRANCH)/g" -e \
"s/{{CHECKSUM}}/$(SPEC_CHECKSUM)/" -e "s/{{COMMIT}}/$(COMMIT)/g" < templates/README.in > README.md
.$(VERSION): Makefile
touch .$(VERSION)
Makefile: templates/Makefile.in
$(SED) -e "s/{{VER""SION}}/"$(VERSION)"/" templates/Makefile.in > Makefile
import.html: templates/import.in
$(SED) -e "s/{{BRANCH}}/$(BRANCH)/g" templates/import.in > import.html
js/terminal.widget.js: js/terminal.widget.in
$(GIT) branch | grep '* devel' > /dev/null || $(SED) -e "s/{{VER}}/$(VERSION)/g" js/terminal.widget.in > js/terminal.widget.js
terminal.jquery.json: manifest .$(VERSION)
$(SED) -e "s/{{VER}}/$(VERSION)/g" manifest > terminal.jquery.json
www/Makefile: $(wildcard www/Makefile.in) Makefile .$(VERSION)
@test "$(BRANCH)" = "master" -a -d www && $(SED) -e "s/{{VER""SION}}/$(VERSION)/g" www/Makefile.in > www/Makefile || true
css/emoji.css: mkemoji
./mkemoji $(VERSION) > css/emoji.css
emoji:
./mkemoji $(VERSION) > css/emoji.css
test:
$(JEST) --coverage --testMatch '**/__tests__/*.spec.js'
coveralls:
$(CAT) ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
lint.src:
$(ESLINT) js/jquery.terminal-src.js
eslint:
$(ESLINT) js/jquery.terminal-src.js
$(ESLINT) js/dterm.js
$(ESLINT) js/xml_formatting.js
$(ESLINT) js/unix_formatting.js
$(ESLINT) js/prism.js
$(ESLINT) js/less.js
$(ESLINT) js/emoji.js
$(ESLINT) js/pipe.js
skipped_tests:
@! grep -E $(skip_re) __tests__/terminal.spec.js
tscheck:
$(TSC) --noEmit --project tsconfig.json
jsonlint: package.json bower.json
$(JSONLINT) -cq package.json
$(JSONLINT) -cq bower.json
publish:
$(GIT) clone $(URL) --depth 1 npm
$(CD) npm && $(NPM) publish
$(RM) -rf npm
lint: eslint jsonlint
checkout:
@git status | sed "1,/not staged/d" | grep modified | sed "s/.*modified:\s*\(.*\)/\1/" | tr '\n' ' ' | sed -e "s/.*/git checkout &; touch &/" | bash