blob: eccc117ad04dffa6d85191e7a2d35e4ca39ee8d1 (
plain)
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
|
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
#ERROR_COLOR=\033[31;01m
#WARN_COLOR=\033[33;01m
OK_STRING=$(OK_COLOR)[OK]$(NO_COLOR)
#ERROR_STRING=$(ERROR_COLOR)[ERRORS]$(NO_COLOR)
#WARN_STRING=$(WARN_COLOR)[WARNINGS]$(NO_COLOR)
AWK_CMD = awk '{ printf "%-30s %-10s\n",$$1, $$2; }'
#PRINT_ERROR = printf "$@ $(ERROR_STRING)\n" | $(AWK_CMD) && printf "$(CMD)\n$$LOG\n" && false
#PRINT_WARNING = printf "$@ $(WARN_STRING)\n" | $(AWK_CMD) && printf "$(CMD)\n$$LOG\n"
PRINT_OK = printf "$@ $(OK_STRING)\n" | $(AWK_CMD)
#BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -eq 1 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi;
build: clean dist/scripts.js dist/css/style.css dist/index.html dist/fonts dist/images dist/images/logos dist/css/images dist/data.json
@$(PRINT_OK)
release: clean build uglify cssmin
@$(PRINT_OK)
clean:
@rm -fr dist
@mkdir dist
@rm -f libraries/jquery/dist/jquery.js
@rm -f libraries/leaflet-soton/resources/leaflet/dist/leaflet.js
@$(PRINT_OK)
stats:
ls -lh dist
.PHONY: all clean stats release debug
SYSTEM_JQUERY=/usr/share/javascript/jquery/jquery.js
libraries/jquery/dist/jquery.js:
ifneq ("$(wildcard $(SYSTEM_JQUERY))","")
@echo "Using system version of jquery"
cp $(SYSTEM_JQUERY) libraries/jquery/dist/jquery.js;
@$(PRINT_OK)
else
@echo "System version of jquery does not exist, downloading...\n"
@mkdir -p libraries/jquery/dist/
wget https://code.jquery.com/jquery-1.7.2.js -O libraries/jquery/dist/jquery.js
@$(PRINT_OK)
endif
SYSTEM_LEAFLET=/usr/share/javascript/leaflet/leaflet-src.js
libraries/leaflet-soton/resources/leaflet/dist/leaflet.js:
ifneq ("$(wildcard $(SYSTEM_LEAFLET))","")
@echo "Using system version of leaflet"
cp $(SYSTEM_LEAFLET) libraries/leaflet-soton/resources/leaflet/dist/leaflet.js;
else
@echo "System version of leaflet does not exist, downloading...\n"
wget http://leaflet-cdn.s3.amazonaws.com/build/leaflet-0.7.3.zip -O libraries/leaflet-0.7.3.zip
unzip -o libraries/leaflet-0.7.3.zip -d libraries/leaflet-soton/resources/leaflet/dist
@$(PRINT_OK)
endif
dist/scripts.js: libraries/jquery/dist/jquery.js libraries/leaflet-soton/resources/leaflet/dist/leaflet.js
@cat libraries/jquery/dist/jquery.js \
libraries/bootstrap/dist/js/bootstrap.js \
libraries/typeahead.js/dist/typeahead.bundle.js libraries/list.js/dist/list.js \
libraries/leaflet-soton/resources/leaflet/dist/leaflet.js \
libraries/leaflet-soton/resources/leaflet-markercluster/dist/leaflet.markercluster.js \
libraries/leaflet-soton/resources/leaflet-locatecontrol/src/L.Control.Locate.js \
libraries/leaflet-soton/resources/leaflet-hash/leaflet-hash.js \
libraries/leaflet-soton/resources/leaflet-indoor/leaflet-indoor.js \
libraries/leaflet-soton/resources/leaflet-route/leaflet-route.js \
libraries/leaflet-soton/resources/leaflet-textpath/leaflet.textpath.js \
libraries/leaflet-soton/resources/uos-live.js/uos-live.js \
libraries/leaflet-soton/resources/uos-live.js/libraries/pollymer/pollymer.js \
libraries/leaflet-soton/src/leaflet-soton.js \
scripts.js > dist/scripts.js
@$(PRINT_OK)
uglify: dist/scripts.js
@uglifyjs dist/scripts.js --mangle toplevel --compress > dist/scripts.min.js
@mv dist/scripts.min.js dist/scripts.js
@$(PRINT_OK)
cssmin: dist/css/style.css
@cssmin --wrap 1000 < dist/css/style.css > dist/css/style.min.css
@mv dist/css/style.min.css dist/css/style.css
@$(PRINT_OK)
dist/css/style.css:
@mkdir dist/css
@cat libraries/bootstrap/dist/css/bootstrap.css \
libraries/leaflet-soton/resources/leaflet/dist/leaflet.css \
libraries/leaflet-soton/resources/leaflet-markercluster/dist/MarkerCluster.css \
libraries/leaflet-soton/resources/leaflet-locatecontrol/src/L.Control.Locate.css \
libraries/leaflet-soton/src/leaflet-soton.css \
style.css > dist/css/style.css
@$(PRINT_OK)
dist/index.html:
@cp index.html dist/index.html
@$(PRINT_OK)
dist/fonts:
@cp -r libraries/bootstrap/dist/fonts dist/fonts
@$(PRINT_OK)
dist/images:
@cp -r libraries/leaflet-soton/resources/images dist/images
@$(PRINT_OK)
dist/images/logos:
@cp -r libraries/leaflet-soton/resources/images/logos dist/images/logos
@$(PRINT_OK)
dist/css/images:
@cp -r libraries/leaflet-soton/resources/leaflet-locatecontrol/src/images dist/css/images
@$(PRINT_OK)
dist/data.json:
@cp libraries/leaflet-soton/data.json dist/data.json
@$(PRINT_OK)
|