-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreateMLibrary
More file actions
executable file
·54 lines (39 loc) · 1.51 KB
/
createMLibrary
File metadata and controls
executable file
·54 lines (39 loc) · 1.51 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
#!/bin/csh -f
if($#argv != 1) then
echo " "
echo "Usage: "
echo " >> createMLibrary libraryName"
echo " "
exit 0
endif
set library = $1
set templateLibrary = textProgressBar
mkdir $library
foreach p (SConstruct SConscript example.cc settings.xcconfig Doxyfile README.md)
cp $templateLibrary/$p $library/
end
foreach p (changelog todo)
touch $library/$p
end
set header = $library"_h"
set cheader = `echo $header | tr "[:lower:]" "[:upper:]"`
touch $library/$library".cc"
echo "#ifndef " $cheader > $library/$library".h"
echo "#define " $cheader " 1" >> $library/$library".h"
echo >> $library/$library".h"
echo >> $library/$library".h"
echo "class $library {" >> $library/$library".h"
echo >> $library/$library".h"
echo >> $library/$library".h"
echo "};" >> $library/$library".h"
echo >> $library/$library".h"
echo >> $library/$library".h"
echo "#endif" >> $library/$library".h"
foreach f(README.md Doxyfile example.cc SConscript SConstruct)
sed -i '' s/textProgressBar/$library/g $library/$f
sed -i '' s/TextProgressBar/$library/g $library/$f
sed -i '' s/"Text Progress Bar"/$library/g $library/$f
sed -i '' s/"text progress bar"/$library/g $library/$f
end
echo "// $library " > $library/$library".cc"
echo '#include "'$library'.h"' >> $library/$library".cc"