-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
97 lines (78 loc) · 2.67 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
.PHONY: all
all: build
BUILD_DIR := build
APP_DIR := www
APP_FILES := \
index.html \
coplanar-gv.html \
production.js \
coplanar.css \
steal/steal.production.js \
# Include the dependencies if we have some
-include build/production.dep
build/production.js: www/coplanar-gv.js www/stealconfig.js Makefile
@mkdir -p $(@D) && cd $(<D) && \
steal/js steal/buildjs $(<F) -to "$(abspath $(@D))"
build/.rev: FORCE
@mkdir -p $(@D)
@git rev-parse HEAD > [email protected]
build/coplanar-gv.html: www/coplanar-gv.html build/.rev
@echo " Generate coplanar-gv.html"
@mkdir -p $(@D) && \
sed -e 's,steal/steal.js,steal/steal.production.js,' \
-e "s,steal\\.suffix = null,steal.suffix = 'rev=$$(cat build/.rev)'," \
$< > $@ || (rm $@ ; false)
build/index.html: build/coplanar-gv.html
@echo " Link index.html"
@mkdir -p $(@D) && rm -f $@ && ln -s $(<F) $@
JS_LIBS := jquery jquery-ui fullcalendar
jquery-ui_GRUNT_TARGET := release
jquery_FILES := \
jquery.js \
jquery.min.js \
jquery.min.map \
jquery-ui_FILES := \
jquery-ui.js \
jquery-ui.min.js \
jquery-ui.css \
jquery-ui.min.css \
i18n/jquery-ui-i18n.js \
i18n/jquery-ui-i18n.min.js \
images/animated-overlay.gif \
images/ui-bg_flat_0_aaaaaa_40x100.png \
images/ui-bg_flat_75_ffffff_40x100.png \
images/ui-bg_glass_55_fbf9ee_1x400.png \
images/ui-bg_glass_65_ffffff_1x400.png \
images/ui-bg_glass_75_dadada_1x400.png \
images/ui-bg_glass_75_e6e6e6_1x400.png \
images/ui-bg_glass_95_fef1ec_1x400.png \
images/ui-bg_highlight-soft_75_cccccc_1x100.png \
images/ui-icons_222222_256x240.png \
images/ui-icons_2e83ff_256x240.png \
images/ui-icons_454545_256x240.png \
images/ui-icons_888888_256x240.png \
images/ui-icons_cd0a0a_256x240.png \
fullcalendar_FILES := \
fullcalendar.js \
fullcalendar.min.js \
fullcalendar.css \
build/%: www/%
@echo " Install $(@:www/%=%)"
@mkdir -p $(@D) && rm -f $@ && ln $< $@
.PHONY: build
build: $(addprefix build/,$(APP_FILES)) \
$(foreach lib,$(JS_LIBS), \
$(addprefix build/$(lib)/,$($(lib)_FILES)))
.PHONY: www
JS_LIB_FILES := package.json node_modules
.SECONDARY: $(foreach lib,$(JS_LIBS), \
$(foreach file,$(JS_LIB_FILES),lib/$(lib)/$(file)))
www: | $(foreach lib,$(JS_LIBS),lib/$(lib)/dist)
lib/%/node_modules: | lib/%/package.json
cd $(@D) && npm install
lib/%/dist: | lib/%/node_modules lib/%/Gruntfile.js
cd $(@D) && grunt $($(*)_GRUNT_TARGET)
lib/%/package.json lib/%/Gruntfile.js:
git submodule update --init -f $(@D)
.PHONY: FORCE