* Makefile.in (ENVSETUP): Don't assume POSIX make semantics for
[s-roff.git] / gendef.sh
blobde32279b0069d27d871cbb932b9f0efdff91126d
1 # gendef filename var=val var=val
3 file=$1
4 shift
6 defs="#define $1"
7 shift
8 for def
9 do
10 defs="$defs
11 #define $def"
12 done
14 # Use $TMPDIR if defined. Default to cwd, for non-Unix systems
15 # which don't have /tmp on each drive (we are going to remove
16 # the file before we exit anyway). Put the PID in the basename,
17 # since the extension can only hold 3 characters on MS-DOS.
18 t=${TMPDIR-.}/gro$$.tmp
20 sed -e 's/=/ /' >$t <<EOF
21 $defs
22 EOF
24 test -r $file && cmp -s $t $file || cp $t $file
26 rm -f $t
28 exit 0