forked from flowplayer/flowplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (80 loc) · 2.89 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
export PATH := ./node_modules/.bin/:$(PATH)
# flash compile
MXMLC_VERSION := $(shell mxmlc --version 2>/dev/null)
ifdef MXMLC_VERSION
FLASH = $(shell which mxmlc)
else
FLASH="/opt/flowplayer/flex3sdk/bin/mxmlc"
endif
FLASH_COMPILE=$(FLASH) -default-frame-rate=50 -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
@ node -e "var fs = require('fs'), js=fs.readFileSync('$(JS)', 'utf8'); process.stdout.write(js.replace('//BRANDING', fs.readFileSync('deps/branding.min.js', 'utf8')));" > $(JS).tmp
@ mv $(JS).tmp $(JS)
# the raw / non-working player without branding
raw:
# raw player
@ mkdir -p $(DIST)
@ cat LICENSE.js | $(SET_VERSION) | $(SET_DATE) > $(JS)
@ cat node_modules/ie8/build/ie8.js >> $(JS)
@ echo >> $(JS)
@ uglifyjs lib/ext/support/embedcode.js --compress >> lib/ext/support/embedcode.min.js
@ browserify -p browserify-derequire -s flowplayer -t brfs lib/index.js | $(SET_VERSION) | sed "s|@EMBED|$(EMBED)|" | sed "s/@CDN/$(CDN)/" | sed "s/@CDN_PATH/$(CDN_PATH)/" >> $(JS)
@ rm lib/ext/support/embedcode.min.js
min: concat
# flowplayer.min.js
@ uglifyjs $(JS) --comments '/flowplayer.org\/license/' --mangle -c >> $(DIST)/flowplayer.min.js
# make all skins
skins:
# skins
@ mkdir -p $(SKIN)
@ stylus --include-css -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)
@ cp -r skin/icons/fonts $(SKIN)
# work on a single skin (watches changes and processes on the background)
skin:
stylus --include-css -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)
@ cp lib/as/*.as $(DIST)
@ cd $(DIST) && $(FLASH_COMPILE) -define=CONFIG::HLS,false -output flowplayer.swf Flowplayer.as -source-path ./
@ cp deps/flashls.swc $(DIST)
@ cd $(DIST) && $(FLASH_COMPILE) -define=CONFIG::HLS,true -output flowplayerhls.swf Flowplayer.as -source-path ./
@ cd $(DIST) && rm *.as *.swc
zip: min concat skins flash
@ cp index.html $(DIST)
@ cp LICENSE.md $(DIST)
@ cp deps/embed.min.js $(DIST)
@ rm -f $(DIST)/flowplayer.zip
cd $(DIST) && zip -r flowplayer-$(VERSION).zip * -x \*DS_Store
clean:
# cleaning
@ rm -rf $(DIST)
deps:
@ npm install
all: clean zip
# shortcuts
as: flash
js: concat
.PHONY: dist skin deps