forked from embeddedprojects/gnublin-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-API.sh
87 lines (67 loc) · 2.55 KB
/
build-API.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
#!/bin/bash
#Wrapper Script to build the GNUBLIN API
export build_time="$(date '+%D %H:%M')"
#################################################
## Building gnublin.h
#################################################
echo building gnublin.h
echo "//********************************************
//GNUBLIN API -- HEADER FILE
//build date: $build_time
//******************************************** \n" > gnublin.h
cat include/includes.h >> include_tmp.h
sed -i "/#endif/d" include_tmp.h
cat include_tmp.h >> gnublin.h
rm include_tmp.h
cat include/functions.h >> gnublin.h
cat drivers/gpio.h >> gnublin.h
cat drivers/i2c.h >> gnublin.h
cat drivers/spi.h >> gnublin.h
cat drivers/adc.h >> gnublin.h
cat drivers/serial.h >> gnublin.h
cat drivers/pwm.h >> gnublin.h
cat modules/module_dogm.h >> gnublin.h
cat modules/module_lm75.h >> gnublin.h
cat modules/module_adc.h >> gnublin.h
cat modules/module_adc_12_bit.h >> gnublin.h
cat modules/module_pca9555.h >> gnublin.h
cat modules/module_relay.h >> gnublin.h
cat modules/module_step.h >> gnublin.h
cat modules/module_lcd.h >> gnublin.h
cat modules/module_dac.h >> gnublin.h
cat library/mail/base64.h >> gnublin.h
cat library/mail/CSmtp.h >> gnublin.h
cat library/csv/csv.h >> gnublin.h
sed -i "s/#include \"..\/include\/includes.h\"/\/\/***** NEW BLOCK *****/g" gnublin.h
sed -i "/^#include \"/d" gnublin.h
echo \#endif >> gnublin.h
#################################################
## Building gnublin.cpp
#################################################
echo building gnublin.cpp
echo "//********************************************
//GNUBLIN API -- MAIN FILE
//build date: $build_time
//******************************************** \n" > gnublin.cpp
cat include/functions.cpp >> gnublin.cpp
cat drivers/gpio.cpp >> gnublin.cpp
cat drivers/i2c.cpp >> gnublin.cpp
cat drivers/spi.cpp >> gnublin.cpp
cat drivers/adc.cpp >> gnublin.cpp
cat drivers/serial.cpp >> gnublin.cpp
cat drivers/pwm.cpp >> gnublin.cpp
cat modules/module_dogm.cpp >> gnublin.cpp
cat modules/module_lm75.cpp >> gnublin.cpp
cat modules/module_adc.cpp >> gnublin.cpp
cat modules/module_adc_12_bit.cpp >> gnublin.cpp
cat modules/module_pca9555.cpp >> gnublin.cpp
cat modules/module_relay.cpp >> gnublin.cpp
cat modules/module_step.cpp >> gnublin.cpp
cat modules/module_lcd.cpp >> gnublin.cpp
cat modules/module_dac.cpp >> gnublin.cpp
cat library/mail/base64.cpp >> gnublin.cpp
cat library/mail/CSmtp.cpp >> gnublin.cpp
cat library/csv/csv.cpp >> gnublin.cpp
sed -i "/^#include/d" gnublin.cpp
#sed -i "/^#include \"/d" gnublin.cpp
sed -i "6i#include \"gnublin.h\"\n\n" gnublin.cpp