#!/bin/sh
make clean
F=.f1
G=.f2

echo  > ${F}
find . -name \*.\[ch\] -print  >> ${F}
find . -name \*.lex -print >> ${F}
find . -name \*.rcp -print >> ${F}
find . -name \*.s -print >> ${F}
find . -name \*.y -print >> ${F}
find . -name Makefile -print >> ${F}
find . -name make.inc -print >> ${F}
find . -name make.arch -print >> ${F}
find . -name .fish -print >> ${F}
find . -name RCS -print >> ${F}
find . -type f -a -perm +111 -print >> ${F}
find . -type l -print >> ${F}

echo ./palm/about >> ${F}
echo ./.files >> ${F}
echo ./libhifimsg/doc.txt >> ${F}
echo ./mpeg_V2/mpg123/mpg123.1 >> ${F}
echo ./nope/protocol.txt >> ${F}
echo ./nope/serial.dat >> ${F}
echo ./palm/about.bmp >> ${F}
echo ./palm/icon.bmp >> ${F}
echo ./palm/smallicon.bmp >> ${F}
echo ./palm/.gdbinit >> ${F}
echo "./WEB"  >> ${F}

for i in GUNK libfiles/libfiles.h libfiles/mtd_file.yy.c libfiles/mtd_file.tab.c libfiles/mtd_file.tab.h; do 
grep -v $i $F > $G
mv $G $F
done

grep -v '^$' $F > .files 

/bin/rm -f $F $G
