forked from PolMine/RcppCWB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup
executable file
·43 lines (31 loc) · 1.33 KB
/
cleanup
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
#!/bin/sh
rm -r src/Makevars
rm -f src/*.o
rm -f src/*.so
rm -f src/cwb/cl/*.a
rm -f src/cwb/cl/*.o
rm -f src/cwb/cl/depend.mk
echo "" > src/cwb/cl/depend.mk # restore empty dummy file
rm -f src/cwb/cqp/*.a
rm -f src/cwb/cqp/*.o
rm -f src/cwb/cqp/depend.mk
echo "" > src/cwb/cqp/depend.mk
rm -f src/cwb/CQi/*.o
rm -r src/cwb/utils/libcwb.a
rm -r src/cwb/utils/*.a
rm -r src/cwb/utils/*.o
PLATFORMFILE=`grep -oh "PLATFORM=.*" ./src/cwb/config.mk | sed "s/PLATFORM=//g"`
echo ${PLATFORMFILE}
sed -e "s/PLATFORM=.*/PLATFORM=mingw-native/" ./src/cwb/config.mk > ./src/cwb/config.mk.mod
rm ./src/cwb/config.mk
mv ./src/cwb/config.mk.mod ./src/cwb/config.mk
sed -e "s/CC[[:space:]]=[[:space:]].*?/CC = gcc/" ./src/cwb/config/platform/${PLATFORMFILE} > ./tmpfile
rm ./src/cwb/config/platform/${PLATFORMFILE}
mv ./tmpfile ./src/cwb/config/platform/${PLATFORMFILE}
# For darwin/macOS machines, variable CC is not set in the platform files (darwin/darwin-64/darwin-arm64)
# but in the unix platform file. So we restore gcc as default compiler here too.
# A better solution would be to set the compiler in the dedicated platorm file! This is a matter
# of the configure script (TODO).
sed -e "s/^CC[[:space:]]=[[:space:]].*/# CC = gcc/" ./src/cwb/config/platform/unix > ./tmpfile
rm ./src/cwb/config/platform/unix
mv ./tmpfile ./src/cwb/config/platform/unix