forked from SeeedJP/LBM_WM1110
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvert.sh
91 lines (77 loc) · 1.98 KB
/
convert.sh
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
#!/usr/bin/bash
echo
date
################################################################################
# LBM
cd src/lbm
echo
echo "=== LBM"
git describe --always --tags --dirty
git show | head -1
#rm -rf .git
rm Makefile
rm -r makefiles
rm smtc_modem_core/lr1mac/src/lr1mac_class_b/smtc_d2d.c
rm -r smtc_modem_core/radio_drivers/sx126x_driver
rm -r smtc_modem_core/radio_drivers/sx128x_driver
rm -r smtc_modem_core/smtc_modem_crypto/soft_secure_element
rm smtc_modem_core/smtc_ral/src/ral_llcc68*
rm smtc_modem_core/smtc_ral/src/ral_sx126x*
rm smtc_modem_core/smtc_ral/src/ral_sx128x*
rm smtc_modem_core/smtc_ralf/src/ralf_sx126x*
rm smtc_modem_core/smtc_ralf/src/ralf_sx128x*
rm -r utilities
lbm_headers=`find -type f -name "*.h"`
lbm_sources=`find -type f -name "*.c"`
echo
for f in ${lbm_headers} ${lbm_sources}
do
echo Convert ${f}
for h in ${lbm_headers}
do
if [ `dirname ${h}` != `dirname ${f}` ]
then
h=${h/.\//}
sed -i "s/#include \"`basename ${h}`\"/#include \"lbm\/${h//\//\\\/}\"/" ${f}
fi
done
done
cd ../..
################################################################################
# MW
cd src/mw
echo
echo "=== MW"
git describe --always --tags --dirty
git show | head -1
#rm -rf .git
rm -r apps
rm -r host_driver
rm -r lora_basics_modem
rm -r shields
rm -r smtc_hal
rm -r toolchain
rm -r geolocation_middleware/doc
mw_headers=`find -type f -name "*.h"`
mw_sources=`find -type f -name "*.c"`
echo
for f in ${mw_headers} ${mw_sources}
do
echo Convert ${f}
for h in ${mw_headers}
do
if [ `dirname ${h}` != `dirname ${f}` ]
then
h=${h/.\//}
sed -i "s/#include \"`basename ${h}`\"/#include \"mw\/${h//\//\\\/}\"/" ${f}
fi
done
for h in ${lbm_headers}
do
if [ `dirname ${h}` != `dirname ${f}` ]
then
h=${h/.\//}
sed -i "s/#include \"`basename ${h}`\"/#include \"lbm\/${h//\//\\\/}\"/" ${f}
fi
done
done