forked from OpenRailwayMap/OpenRailwayMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (48 loc) · 2.23 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
SHELL = /bin/sh -e
DEP_LEAFLET_VERSION = 0.7.7
DEP_LEAFLET_EDITOR_FILES = download/Leaflet.EditInOSM.js download/Leaflet.EditInOSM.css download/edit-in-osm.png
DEP_LEAFLET_GRAYSCALE_VERSION = 8675605f71f856299ebdd05a635ba1494817f5ff
.PHONY: check all
PHP := php
all:
$(MAKE) -C josm-presets $@
$(MAKE) -C styles $@
$(MAKE) -C locales $@
clean:
$(MAKE) -C josm-presets $@
$(MAKE) -C styles $@
$(MAKE) -C locales $@
check-php: *.php api/*.php
check:
@for pf in $$(find . -name '*.php'); do \
$(PHP) -l $${pf}; \
done
$(MAKE) -C josm-presets $@
$(MAKE) -C styles $@
distclean: clean
rm -rf download css/leaflet.css
download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz:
mkdir -p download
# do this in 2 steps to make sure only a completely downloaded file is used
wget -O download/leaflet.tar.gz https://github.com/Leaflet/Leaflet/archive/v$(DEP_LEAFLET_VERSION).tar.gz
mv download/leaflet.tar.gz download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz
$(DEP_LEAFLET_EDITOR_FILES):
wget -O $@.tmp https://raw.githubusercontent.com/yohanboniface/Leaflet.EditInOSM/master/$(notdir $@)
mv $@.tmp $@
download/TileLayer.Grayscale.js:
mkdir -p download
wget -O $@.tmp https://raw.githubusercontent.com/Zverik/leaflet-grayscale/$(DEP_LEAFLET_GRAYSCALE_VERSION)/$(notdir $@)
mv $@.tmp $@
download-deps: download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz \
$(DEP_LEAFLET_EDITOR_FILES)
css/leaflet.css: download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz
tar -C js --strip-components=2 -xvzf download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz Leaflet-$(DEP_LEAFLET_VERSION)/dist/leaflet.js Leaflet-$(DEP_LEAFLET_VERSION)/dist/images
tar --to-stdout -xvzf download/leaflet-$(DEP_LEAFLET_VERSION).tar.gz Leaflet-$(DEP_LEAFLET_VERSION)/dist/leaflet.css | sed s,images/,../js/images/, > css/leaflet.css
css/Leaflet.EditInOSM.css: $(DEP_LEAFLET_EDITOR_FILES)
cp download/Leaflet.EditInOSM.js js/
cp download/edit-in-osm.png img/
sed 's#"./edit-in-osm#"../img/edit-in-osm#' download/Leaflet.EditInOSM.css > download/Leaflet.EditInOSM.css_
mv download/Leaflet.EditInOSM.css_ $@
js/L.TileLayer.Grayscale.js: download/TileLayer.Grayscale.js
cp download/TileLayer.Grayscale.js js/L.TileLayer.Grayscale.js
install-deps: css/leaflet.css css/Leaflet.EditInOSM.css js/L.TileLayer.Grayscale.js