Add autogen.sh, which just runs autoheader and autoconf.
[wvstreams.git] / gen-cc
blob5ceecdafb0fe1a0b752a34ccf711bbaa38040fa0
1 #!/bin/sh -e
2 OUTFILE=$1
3 EXT=$2
4 echo "* Generating $OUTFILE" >&2
5 TEMPFILE=`tempfile --directory=. --prefix=gencc`
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