forked from travisgoodspeed/md380tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·167 lines (133 loc) · 3.89 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
RELEASE=dist/md380tools-`date "+%Y-%m-%d"`
.PHONY: dist all
all: image_D13
# cleans everything also downloaded files
distclean: clean
rm -rf dist
"${MAKE}" -C db clean
"${MAKE}" -C firmware clean
# does not clean external downloads
clean:
"${MAKE}" -C patches/2.032 clean
"${MAKE}" -C patches/3.020 clean
"${MAKE}" -C patches/s13.020 clean
"${MAKE}" -C patches/d13.020 clean
"${MAKE}" -C applet clean
"${MAKE}" -C annotations clean
"${MAKE}" -C emulator clean
rm -f *~ *.pyc *.bin
image_D02:
"${MAKE}" -C applet FW=D02_032 all
image_D13:
"${MAKE}" -C applet FW=D13_020 all
image_S13:
"${MAKE}" -C applet FW=S13_020 all
original_D13:
"${MAKE}" -C firmware unwrapped/D013.020.img
original_D13.34:
"${MAKE}" -C firmware unwrapped/D013.034.img
original_S13:
"${MAKE}" -C firmware unwrapped/S013.020.img
original_D02:
"${MAKE}" -C firmware unwrapped/D002.032.img
original_D03:
"${MAKE}" -C firmware unwrapped/D003.020.img
flash_original_D13: original_D13
./md380-dfu upgrade firmware/bin/D013.020.bin
flash_original_D13.34: original_D13.34
./md380-dfu upgrade firmware/bin/D013.034.bin
flash_original_S13: original_S13
./md380-dfu upgrade firmware/bin/S013.020.bin
flash_original_D02: original_D02
./md380-dfu upgrade firmware/bin/D002.032.bin
flash_original_D03: original_D03
./md380-dfu upgrade firmware/bin/D003.020.bin
flash: image_D13
./md380-dfu upgrade applet/experiment.bin
settime:
./md380-dfu settime
flash_D02: image_D02
./md380-dfu upgrade applet/experiment.bin
flash_D13: image_D13
./md380-dfu upgrade applet/experiment.bin
flash_S13: image_S13
./md380-dfu upgrade applet/experiment.bin
sync:
"${MAKE}" -C annotations sync
.PHONY: updatedb updatedb_eur
updatedb:
"${MAKE}" -C db update
updatedb_eur:
"${MAKE}" -C db update_eur
.PHONY: db/stripped.csv
db/stripped.csv:
"${MAKE}" -C db stripped.csv
user.bin: db/stripped.csv
wc -c < db/stripped.csv > user.bin
cat db/stripped.csv >> user.bin
.PHONY: flashdb
flashdb: user.bin
./md380-tool spiflashwrite user.bin 0x100000
.PHONY: release
release:
-mkdir release
"${MAKE}" clean image_D13
cp applet/experiment.bin release/D13.exp.bin
"${MAKE}" clean image_S13
cp applet/experiment.bin release/S13.exp.bin
"${MAKE}" clean image_D02
cp applet/experiment.bin release/S02.exp.bin
"${MAKE}" clean user.bin
cp user.bin release/
"${MAKE}" clean original_D13
cp firmware/bin/D013.020.bin release/
"${MAKE}" clean original_S13
cp firmware/bin/S013.020.bin release/
"${MAKE}" clean original_D02
cp firmware/bin/D002.032.bin release/
"${MAKE}" clean original_D03
cp firmware/bin/D003.020.bin release/
dist:
rm -rf $(RELEASE) $(RELEASE).zip
mkdir -p $(RELEASE)/python
#Main release.
"${MAKE}" clean image_D13
cp applet/experiment.bin $(RELEASE)/firmware-`date "+%Y-%m-%d-NoGPS"`.bin
#For GPS radios.
"${MAKE}" clean image_S13
cp applet/experiment.bin $(RELEASE)/firmware-`date "+%Y-%m-%d-GPS"`.bin
#Older
"${MAKE}" clean image_D02
cp applet/experiment.bin $(RELEASE)/firmware-`date "+%Y-%m-%d-OLD"`.bin
#Include the Official Installer
cd $(RELEASE) && unzip ../../firmware/dl/D002.032.zip
mv $(RELEASE)/Firmware\ 2.32 $(RELEASE)/windows
rm $(RELEASE)/windows/MD-380-D2.32\(AD\).bin $(RELEASE)/windows/Operation.doc.pdf
cp *.py 99-md380.rules md380-dfu md380-tool $(RELEASE)/python/
#Clean out some gunk
rm -rf $(RELEASE)/__MACOSX
#Add the latest database
"${MAKE}" -C db clean all
cp db/stripped.csv $(RELEASE)/callerid.csv
#Zip it up for distribution.
zip -r $(RELEASE).zip $(RELEASE)
dbg:
@echo ________
@echo PATH: '${PATH}'
@echo SHELL: '${SHELL}'
@echo MAKE: '${MAKE}'
@echo ________
@echo AWK version
-awk -Wversion 2>/dev/null || awk --version
@echo ________
@echo Make version
"${MAKE}" -v
@echo ________
ci: dbg clean
"${MAKE}" -C applet ci
"${MAKE}" -C db ci
"${MAKE}" user.bin
# "${MAKE}" -C annotations/d13.020 ci
"${MAKE}" clean
check-ignore:
find -type f | git check-ignore -v --stdin | less