10 sed -e '/^[ \t]*$/d' -e '/^[ \t]*#/d' $1 > $2
14 sed -n 's,^[ \t]*#include ,,p' $1 |
17 echo $outfile: $inc >> $outfile.makefrag
18 echo $inc: >> $outfile.makefrag
24 i=$1; o=$2; t=${2}.tmp
25 while process_includes_1 $i $o; do
32 rm -f $outfile.makefrag
34 process_includes $incfile $outfile.inc
36 if test x$extfile != x -a -f "$extfile"; then
37 process_includes $extfile $outfile.ext.inc
38 cat $outfile.ext.inc >> $outfile.inc
39 rm -f $outfile.ext.inc
42 sort -u $outfile.inc > $outfile.inc_s
46 if test -n "$excfile" -a -f "$excfile"; then
47 process_includes $excfile $outfile.exc
50 if test -n "$extexcfile"; then
51 process_includes $extexcfile $outfile.ext_exc
52 cat $outfile.ext_exc >> $outfile.exc
53 rm -f $outfile.ext_exc
56 if test -f $outfile.exc; then
57 # So what we're doing below with uniq -u is that we take
58 # lines that have not been duplicated. This computes the
59 # symmetric difference between the files. This is not
60 # what we want. If a file is in the excludes but not in
61 # the sources, we want that file not to show up. By duplicating the
62 # excludes, we ensure that we won't end up in this failure state.
63 sort -u $outfile.exc > $outfile.exc_s
66 cat $outfile.exc_s >> $outfile.exc_s_dup
67 cat $outfile.exc_s >> $outfile.exc_s_dup
69 rm -f $outfile.exc $outfile.exc_s
71 cat $outfile.inc_s $outfile.exc_s_dup | sort | uniq -u > $outfile
72 rm -f $outfile.inc_s $outfile.exc_s_dup
74 mv $outfile.inc_s $outfile