Unify process_alloc() and process_realloc() with PROCESS_ALLOC_MODE_REALLOC bit
[moveable_pool.git] / ifdef.sh
1 #!/bin/sh
2 mkdir $4
3 for i in $2/*.[ch]
4 do
5   f=`basename $i`
6   if test -f $3/$f
7   then
8     sed -e 's/^#/##/' <$2/$f >a
9     sed -e 's/^#/##/' <$3/$f >b
10     diff --ifdef=$1 a b |./ifdef.py |sed -e 's/^#if\([^@]*\)@@/@#if\1@/; s/@@#else\([^@]*\)/@#else\1@/; s/@@#endif\([^@]*\)/@#endif\1@/' >$4/$f
11   else
12     sed -e 's/^#/##/' <$2/$f >$4/$f
13   fi
14 done
15 for i in $3/*.[ch]
16 do
17   f=`basename $i`
18   if ! test -f $2/$f
19   then
20     sed -e 's/^#/##/' <$3/$f >$4/$f
21   fi
22 done