-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (42 loc) · 1.83 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
ifeq ("$(ELM)","")
ELM=elm
endif
ifeq ("$(ELMLIVE)", "")
ELMLIVE=elm-live
endif
ifeq ("$(UGLIFYJS)", "")
UGLIFYJS=uglifyjs
endif
BUILD_DIR=js
release: dist/polymny-video-elm.min.js dist/polymny-video-full.min.js
dev: dist/polymny-video-elm.js dist/polymny-video-full.js
js/main.js: src/**
$(ELM) make src/Main/*.elm --output $(BUILD_DIR)/main.js
js/main.min.js: js/main.tmp.js
@$(UGLIFYJS) $(BUILD_DIR)/main.tmp.js --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' | $(UGLIFYJS) --mangle > $(BUILD_DIR)/main.min.js
js/main.tmp.js: src/**
@$(ELM) make src/Main/*.elm --optimize --output $(BUILD_DIR)/main.tmp.js
clean:
@rm -rf $(BUILD_DIR)/{main.js,main.min.js}
dist/polymny-video-full.min.js: js/main.min.js js/ports.js
@mkdir -p dist
@curl https://cdn.jsdelivr.net/npm/hls.js@latest > dist/polymny-video-full.min.js 2>/dev/null
@echo >> dist/polymny-video-full.min.js
@cat js/main.min.js >> dist/polymny-video-full.min.js
@uglifyjs js/ports.js >> dist/polymny-video-full.min.js
dist/polymny-video-elm.min.js: js/main.min.js js/ports.js
@ mkdir -p dist
@curl https://cdn.jsdelivr.net/npm/hls.js@latest > dist/polymny-video-elm.min.js 2>/dev/null
@echo >> dist/polymny-video-elm.min.js
@uglifyjs js/ports.js >> dist/polymny-video-elm.min.js
dist/polymny-video-full.js: js/main.js js/ports.js
@mkdir -p dist
@curl https://cdn.jsdelivr.net/npm/hls.js@latest > dist/polymny-video-full.js 2>/dev/null
@echo >> dist/polymny-video-full.js
@cat js/main.js >> dist/polymny-video-full.js
@cat js/ports.js >> dist/polymny-video-full.js
dist/polymny-video-elm.js: js/main.js js/ports.js
@mkdir -p dist
@curl https://cdn.jsdelivr.net/npm/hls.js@latest > dist/polymny-video-elm.js 2>/dev/null
@echo >> dist/polymny-video-elm.js
@cat js/ports.js >> dist/polymny-video-elm.js