-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcondenseSourceCode.sh
More file actions
78 lines (66 loc) · 3.01 KB
/
condenseSourceCode.sh
File metadata and controls
78 lines (66 loc) · 3.01 KB
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
# Line Follower 2013 | Source Code Condensation Script.
# Script to Condense Entire Source Code into a single File.
# Source Code Condensation Script Begins.
echo "Source Code Condensation - Line Follower 2013"
echo "---------------------------------------------"
echo "Starting Source Code Condensing Process..."
echo ""
echo "Merging Header Files..."
echo "/* ****************************" > inc/condensedHeader.h
echo "Header Files for Line Follower." >> inc/condensedHeader.h
echo "**************************** */" >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
cat inc/lineFollowerMain.h >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
cat inc/adci.h >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
cat inc/normalizeAlgorithm.h >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
cat inc/moveAlgorithm.h >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
echo "" >> inc/condensedHeader.h
echo "Header Files Merged."
echo ""
echo "Merging Program Source Files..."
echo "/* ***********************************" > src/lineFollowerSourceCondensed.c
echo "Source Code For Functions Begins Here." >> src/lineFollowerSourceCondensed.c
echo "*********************************** */" >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/lineFollower.c >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/initializeAll.c >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/inputSensorArray.c >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/isRunningFeasible.c >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/normalizeSensorArray.c >> src/lineFollowerSourceCondensed.c
sed '/^\#/d' src/moveLineFollower.c >> src/lineFollowerSourceCondensed.c
echo "Program Source Files Merged."
echo ""
echo "Creating Condensed Source Code File..."
echo "/* ********************************************" > lineFollowerCondensed.c
echo "Line Follower 2013 | Condensed Source Code File" >> lineFollowerCondensed.c
echo "******************************************** */" >> lineFollowerCondensed.c
echo "" >> lineFollowerCondensed.c
echo "Condensed Source Code File Created Successfully."
echo ""
echo "Including Library Header Files..."
echo "// Library Header Files" >> lineFollowerCondensed.c
echo "" >> lineFollowerCondensed.c
echo "#include <avr/io.h>" >> lineFollowerCondensed.c
echo "#include <util/delay.h>" >> lineFollowerCondensed.c
echo "#include <math.h>" >> lineFollowerCondensed.c
echo "#include <stdlib.h>" >> lineFollowerCondensed.c
echo "" >> lineFollowerCondensed.c
echo "Library Header Files Included."
echo ""
echo "Merging Everything..."
cat inc/condensedHeader.h src/lineFollowerSourceCondensed.c >> lineFollowerCondensed.c
echo "Merged Everything."
echo ""
echo "Source Code has been Condensed Successfully."
echo ""
echo "Cleaning Up..."
rm inc/condensedHeader.h src/lineFollowerSourceCondensed.c
echo "Cleanup Done."
echo "---------------------------------------------"
# End of Source Code Condensation Script.