"wvtestmain ''" actually still runs all the tests, so skip the warning.
[wvstreams.git] / gen-cc
blob3793350c3d4ba1a1ac58ef7e8695863358c81a7f
1 #!/bin/sh -e
2 OUTFILE=$1
3 EXT=$2
4 echo "* Generating $OUTFILE" >&2
5 TEMPFILE=gencc-$$.tmp
7 cat >$TEMPFILE <<-EOF
8 #!/bin/sh
9 set -e
11 MODE=\$1
12 BASE=\$2
13 DIR=\$(dirname \$BASE)
14 DEPFILE=\$(dirname \$BASE)/.\$(basename \$BASE .o).d
15 shift
16 shift
18 $CC \$MODE -o \$BASE.o \$BASE.$EXT \\
19 -MMD -MF \$DEPFILE -MP -MQ \$BASE.o \\
20 $CPPFLAGS \\
21 $CFLAGS \\
22 "\$@"
23 EOF
25 chmod a+x $TEMPFILE
26 mv $TEMPFILE $OUTFILE