forked from flowplayer/flowplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (77 loc) · 2.34 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
# flash compile
FLASH="/opt/flowplayer/flex3sdk/bin/mxmlc"
FLASH_COMPILE=$(FLASH) -static-link-runtime-shared-libraries=true -library-path=.
# version and date
VERSION=$(shell cat VERSION)
SET_VERSION=sed "s/@VERSION/${VERSION}/g"
DATE=$(shell git log -1 --pretty=format:%ad --date=short)
SET_DATE=sed "s/@DATE/${DATE}/"
# paths
DIST=dist
JS=$(DIST)/flowplayer.js
SKIN=$(DIST)/skin
CDN=releases.flowplayer.org
EMBED=embed.flowplayer.org
CDN_PATH=""
# http://flowplayer.org/license
concat: raw
# flowplayer.js
@ cat deps/branding.min.js >> $(JS)
# the raw / non-working player without branding
raw:
# raw player
@ mkdir -p $(DIST)
@ cat LICENSE.js | $(SET_VERSION) | $(SET_DATE) > $(JS)
@ echo "!function($$) { " >> $(JS)
@ cat lib/flowplayer.js\
lib/ext/support.js\
lib/engine/*.js\
lib/ext/resolve.js\
lib/ext/slider.js\
lib/ext/ui.js\
lib/ext/keyboard.js\
lib/ext/fullscreen.js\
lib/ext/playlist.js\
lib/ext/cuepoint.js\
lib/ext/subtitle.js\
lib/ext/analytics.js\
lib/ext/mobile.js\
lib/ext/embed.js | $(SET_VERSION) | sed "s/@EMBED/$(EMBED)/" | sed "s/@CDN/$(CDN)/" | sed "s/@CDN_PATH/$(CDN_PATH)/" >> $(JS)
@ echo "}(jQuery);" >> $(JS)
min: raw
# flowplayer.min.js
@ uglifyjs $(JS) > $(DIST)/flowplayer.min.js
@ cat deps/branding.min.js >> $(DIST)/flowplayer.min.js
# make all skins
skins:
# skins
@ mkdir -p $(SKIN)
@ stylus -c -o $(SKIN) skin/styl/*.styl
@ sed 's/\.flowplayer/\.minimalist/g' $(SKIN)/minimalist.css > $(SKIN)/all-skins.css
@ sed 's/\.flowplayer/\.functional/g' $(SKIN)/functional.css >> $(SKIN)/all-skins.css
@ sed 's/\.flowplayer/\.playful/g' $(SKIN)/playful.css >> $(SKIN)/all-skins.css
@ cp -r skin/img $(SKIN)
# work on a single skin (watches changes and processes on the background)
skin:
stylus -c -w -o $(SKIN) skin/styl/$(MAKECMDGOALS).styl
minimalist: skin
functional: skin
playful: skin
flash:
# compile flash
@ $(SET_VERSION) lib/as/Flowplayer.as > $(DIST)/Flowplayer.as
@ cp lib/logo/logo.swc $(DIST)
@ cd $(DIST) && $(FLASH_COMPILE) -output flowplayer.swf Flowplayer.as && rm Flowplayer.as logo.*
zip: concat min skins flash
@ cp index.html $(DIST)
@ cp LICENSE.md $(DIST)
@ rm -f $(DIST)/flowplayer.zip
cd $(DIST) && zip -r flowplayer-$(VERSION).zip * -x \*DS_Store
clean:
# cleaning
@ rm -rf $(DIST)
all: clean zip
# shortcuts
as: flash
js: concat
.PHONY: dist skin