1#!/bin/sh 2 3TOP_DIR=. 4OBJ_DIR=. 5 6for x in "$@" 7do 8 case x"$x" in 9 x--srcdir=* | x--topdir=* ) 10 TOP_DIR=`echo $x | sed 's/^--[a-z]*dir=//'` 11 ;; 12 x--builddir=* | x--objdir=* ) 13 OBJ_DIR=`echo $x | sed 's/^--[a-z]*dir=//'` 14 ;; 15 esac 16done 17 18mkdir -p ${OBJ_DIR}/builds/atari/tmp/orig 19 20( cd ${TOP_DIR} && find . -name '*.[CHch]' -type f | fgrep -v builds/atari/tmp | cpio -o ) | \ 21( cd ${OBJ_DIR}/builds/atari/tmp/orig && cpio -idum ) 22cp ${TOP_DIR}/builds/atari/deflinejoiner.awk ${OBJ_DIR}/builds/atari/tmp 23 24pushd ${OBJ_DIR}/builds/atari/tmp 25 26 cp -pr orig purec 27 for f in `cd orig && find . -type f` 28 do 29 echo filter $f 30 env LANG=C awk -f deflinejoiner.awk < orig/$f > purec/$f 31 done 32 33 echo '#define FT2_BUILD_LIBRARY' > purec/include/ft2build.h 34 echo '#include "ATARI.H"' >> purec/include/ft2build.h 35 env LANG=C awk -f deflinejoiner.awk < orig/include/ft2build.h >> purec/include/ft2build.h 36 37 env LANG=C diff -ur orig purec > ../purec.diff 38 39popd 40rm -rf ${OBJ_DIR}/builds/atari/tmp 41