-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile.overlay
49 lines (37 loc) · 1.25 KB
/
Makefile.overlay
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
OVERLAYNAME?=test
OVERLAYS=$(addprefix y_$(OVERLAYNAME)/yOrtho4XP_Overlays/*/*/, $(shell cat $(OVERLAYNAME)_tile_list) )
y_$(OVERLAYNAME)_overlays.zip: $(OVERLAYS)
zip -r $@ y_$(OVERLAYNAME)
split $@ -d -b1G $@.
%.sha256: %
sha256sum $< > $@
y_$(OVERLAYNAME):
mkdir -p $@
y_$(OVERLAYNAME)/yOrtho4XP_Overlays/*/*/%.dsf: Ortho4XP/yOrtho4XP_Overlays/*/*/%.dsf y_$(OVERLAYNAME)
set -e;\
export DSTREGION=$$(echo "$<" | awk -F "/" '{print $$4}');\
export DSTFILE=$$(echo "$<" | awk -F "/" '{print $$5}');\
export DSTPATH="y_$(OVERLAYNAME)/yOrtho4XP_Overlays/Earth nav data/$$DSTREGION/$$DSTFILE";\
echo "Copy $< to $$DSTPATH";\
mkdir -p "$$(dirname "$$DSTPATH")";\
cp "$<" "$$DSTPATH" || true;
Ortho4XP/yOrtho4XP_Overlays/*/*/%.dsf: Ortho4XP
@echo "Make overlay $@"
set -e;\
export COORDS=$$(echo $@ | sed -e 's|.*/\([-+][0-9]\+\)\([-+][0-9]\+\).dsf|\1 \2|g');\
cd $< && python3 extract_overlay.py $$COORDS
#
# Ortho4XP setup
#
ortho4xp.diff:
cd Ortho4XP && git diff > ../ortho4xp.diff
Ortho4XP:
git clone --depth=1 https://github.com/oscarpilote/Ortho4XP.git
cd $@ && patch -p1 -u < ../ortho4xp.diff
cp extract_overlay.py $@/.
cp Ortho4XP.cfg $@/.
mkdir $@/tmp
clean:
-rm -rf Ortho4XP
-rm -rf y_$(OVERLAYNAME)
-rm -rf y_$(OVERLAYNAME)_overlays.zip