forked from fgarbe/TypeChef-BusyboxIfdeftoif
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransAndReplace.sh
executable file
·29 lines (24 loc) · 1.02 KB
/
transAndReplace.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
#!/bin/bash -e
#!/bin/bash -vxe
filesToProcess() {
local listFile=busybox/busybox_files
cat $listFile
#awk -F: '$1 ~ /.c$/ {print gensub(/\.c$/, "", "", $1)}' < linux_2.6.33.3_pcs.txt
}
path=$(cd "$(dirname "$0")"; pwd)
extension="_ifdeftoif.c"
flags="-U HAVE_LIBDMALLOC -DCONFIG_FIND -U CONFIG_FEATURE_WGET_LONG_OPTIONS -U ENABLE_NC_110_COMPAT -U CONFIG_EXTRA_COMPAT -D_GNU_SOURCE"
srcPath="busybox-1.18.5"
filePath=$(find $srcPath -name $1.c |head -1)
baseFilePath="${filePath%.c}"
ifdeftoifPath="${baseFilePath}_ifdeftoif.c"
renamedPath="${baseFilePath}.orig"
export partialPreprocFlags="--bdd -x CONFIG_ --include busybox/config.h -I $srcPath/include --featureModelDimacs busybox/featureModel.dimacs --recordTiming --parserstatistics --debugInterface --ifdeftoifstatistics"
## Reset output
echo "Starting process on file $1"
./jcpp.sh $filePath $flags
## Create id2i_optionstruct
./../Hercules/ifdeftoif.sh --featureConfig BusyBoxDefConfig.config
## Rename files
mv "$filePath" "$renamedPath"
mv "$ifdeftoifPath" "$filePath"