-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
executable file
·231 lines (208 loc) · 5.76 KB
/
run.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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#!/bin/bash
# tput value
## 0 black COLOR_BLACK 0,0,0
## 1 red COLOR_RED 1,0,0
## 2 green COLOR_GREEN 0,1,0
## 3 yellow COLOR_YELLOW 1,1,0
## 4 blue COLOR_BLUE 0,0,1
## 5 magenta COLOR_MAGENTA 1,0,1
## 6 cyan COLOR_CYAN 0,1,1
## 7 white COLOR_WHITE 1,1,1
## sgr0 Reset text format to the terminal's default
tool="$(which hpp2plantuml)"
if [ -z ${tool} ]; then
tput setaf 1
echo "Do install hpp2plantuml"
echo "Method-1. run setting_env_user_mode.sh in current directory"
echo "Method-2. Install by yourself from URL) https://github.com/thibaultmarin/hpp2plantuml"
tput sgr0
exit 4;
fi
tput setaf 5
echo "${tool}"
tput sgr0
${tool} -i exmaple/B/ISmsSendCallback.cpp > hpp2plantuml.run.log
if [ $? -ne 0 ]; then
tput setaf 1
echo "Need new version of hpp2plantuml from URL) https://github.com/thibaultmarin/hpp2plantuml"
echo "Need python3 to install it."
tput sgr0
exit 4;
fi
tool="$(which pandoc)"
if [ -z ${tool} ]; then
tput setaf 1
echo "Do install pandoc"
echo "linux ex) apt-get install pandoc"
tput sgr0
exit 5;
fi
tput setaf 5
echo "${tool}"
tput sgr0
tool="$(which markdown-pp)"
if [ -z ${tool} ]; then
tput setaf 1
echo "Do install markdown-pp"
echo "Method-1. run setting_env_user_mode.sh in current directory"
echo "Method-2. Install by yourself from URL) https://github.com/jreese/markdown-pp"
tput sgr0
exit 6;
fi
tput setaf 5
echo "${tool}"
tput sgr0
perl -e "use 5.010"
if [ $? -ge 1 ]
then
tput setaf 1
echo "Need more recent perl version than v5.010"
tput sgr0
exit 3;
fi
if [ -s ./.perlmodule ]; then
tput setaf 5
echo "Already perlmodule was installed. If you want to initialize , remove .perlmodule file"
tput sgr0
else
perl -e "use Excel::Writer::XLSX"
if [ $? -ge 1 ]; then
tput setaf 1
echo "Need perl module Excel::Writer::XLSX"
echo "$ cpan Excel::Writer::XLSX"
tput sgr0
cpan Excel::Writer::XLSX
echo "INSTALLED Excel::Writer::XLSX perl module" > ./.perlmodule
exit 4;
else
tput setaf 5
echo "Already installed Excel::Writer::XLSX perl module"
tput sgr0
echo "INSTALLED Excel::Writer::XLSX perl module" > ./.perlmodule
fi
fi
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
machine=Linux
lsOption="-alF --color=auto"
break
;;
Darwin*)
machine=Mac
lsOption="-alFG"
;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac
tput setaf 5
echo "Machine => ${machine}"
tput sgr0
if [ -z $* ]
then
tput setaf 1
echo "$ run.sh source_directories"
echo " - directory is not recursive."
echo " - ex) run.sh .. ../inc example/A"
tput sgr0
exit 1;
fi
if [ $1 = "clean" ]
then
tput setaf 2
echo "#### Clean ./build_doxygen/src ####"
tput sgr0
/bin/rm -f ./build_doxygen/src/*
/bin/rm -f ./build_uml/src/*
/bin/rm -f ./build_perlmod/src/*
/bin/rm -f ./build_perlmod/work/*
ls ${lsOption} ./build_doxygen/src/
tput setaf 2
echo "#### build_doxygen makefile clean ####"
tput sgr0
cd build_doxygen; make clean; cd ..
tput setaf 2
echo "#### build_uml makefile clean ####"
tput sgr0
cd build_uml; make clean; cd ..
tput setaf 2
echo "#### build_perlmod makefile clean ####"
tput sgr0
cd build_perlmod; make clean; cd ..
exit 0;
fi
tput setaf 2
echo "#### Make soft links in src ####"
tput sgr0
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
/bin/rm -rf ./build_doxygen/src
/bin/rm -rf ./build_uml/src
/bin/rm -rf ./build_perlmod/src
/bin/rm -rf ./build_perlmod/work
mkdir -p ./build_doxygen/src
mkdir -p ./build_uml/src
mkdir -p ./build_perlmod/src
mkdir -p ./build_perlmod/work
pwd=`pwd`
for directory in $*
do
echo "directory : $directory"
for file in $directory/*.cpp $directory/*.cc $directory/*.h $directory/*.hpp $directory/*.sldd $directory/*.tcli
do
basefile=`basename $file`
echo " basefile : $basefile , file : $file"
if [ -s $file ]; then
echo "make soft link $pwd/$file <-- ./build_doxygen/src/$basefile ./build_uml/src/$basefile ./build_perlmod/$basefile"
ln -sf $pwd/$file ./build_doxygen/src/$basefile
ln -sf $pwd/$file ./build_uml/src/$basefile
ln -sf $pwd/$file ./build_perlmod/src/$basefile
fi
done
for file in $directory/*.md $directory/*.mdpp
do
basefile=`basename $file`
echo " basefile : $basefile , file : $file"
if [ -s $file ]; then
echo "make soft link $pwd/$file <-- ./build_perlmod/work/$basefile "
ln -sf $pwd/$file ./build_perlmod/work/$basefile
fi
done
#cp -f $file $file\.orig
#expand -t 4 $file\.orig > $file\.tmp
#sed --in-place 's/[[:space:]]\+$//' $file\.tmp
#sed --in-place 's/ //g' $file\.tmp
#diff -q $file $file\.tmp
#if [ $? -ne '0' ]
#then
#echo "$file Changed ::: original file : $file\.orig"
#cp -f $file\.tmp $file
#fi
#rm -f $file\.tmp
done
#if [ -s ./README.md ]; then
#echo "make soft link $pwd/README.md <-- ./build_doxygen/src/README.md"
#ln -sf $pwd/work/README.md ./build_doxygen/src/README.md
#fi
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
tput setaf 5
echo "### Source C/C++/Header Files for making a doxygen : ls ./build_doxygen/src/ ####"
tput sgr0
ls ${lsOption} ./build_doxygen/src/
tput setaf 5
echo "### Source MarkDown Files for making a doxygen : ls ./build_perlmod/work/ ####"
tput sgr0
ls ${lsOption} ./build_perlmod/work/
tput setaf 2
echo "#### build_doxygen makefile ####"
tput sgr0
cd build_doxygen; make ; cd ..
tput setaf 2
echo "#### build_uml makefile ####"
tput sgr0
cd build_uml; make ; cd ..
tput setaf 2
echo "#### build_perlmod makefile ####"
tput sgr0
cd build_perlmod; make ; cd ..
exit 0;