summaryrefslogtreecommitdiff
path: root/make_idh.sh
blob: 272ae6aa96f046a36de3508cb3cb4db8f75c65c3 (plain)
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
#!/bin/sh

DIR_PROTECT="arch/arm/cpu/armv7/sc8810 arch/arm/cpu/arm926ejs/sc8800g arch/arm/cpu/arm926ejs/sc8800x property nand_fdl nand_spl"
PRODUCTS="sc8810_openphone sp8810 sp8805ga sp6810a openphone native_openphone 788"

argu=$1
if [ -z $argu ]; then
argu="clean"
elif [ $argu != "clean" ] && [ $argu != "restore" ]; then
echo " you should type as $0 clean or restore"
exit 0
fi

if [ $argu = "clean" ]; then
    for dir in $DIR_PROTECT; do
    find $dir -name *.c -o -name *.S | xargs rm -f
    done

    echo "CONFIG_IDH_BUILD = 1" > ./include/idh_config.mk
fi 

if [ $argu = "restore" ]; then
    for dir in $DIR_PROTECT; do
    git checkout -- $dir
    done
    rm ./include/idh_config.mk 2>/dev/null
fi