original versions of the files, so as to avoid rebuilding files when not
necessary. Also fixes a potential SMP/Parallel build problem when one
make process runs compile_et to generate the .h file, and a partially
generated .c file is compiled by another make process. (Addresses
Sourceforge Bug: #1157933)
exit 1;
fi
-$AWK -f "${DIR}/et_h.awk" "outfile=${BASE}.h" "$ROOT.et"
-$AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c" "$ROOT.et"
+$AWK -f "${DIR}/et_h.awk" "outfile=${BASE}.h.$$" "outfn=${BASE}.h" "$ROOT.et"
+if test -f ${BASE}.h && cmp -s ${BASE}.h.$$ ${BASE}.h ; then
+ rm ${BASE}.h.$$
+else
+ mv ${BASE}.h.$$ ${BASE}.h
+fi
+$AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c.$$" "outfn=${BASE}.c" "$ROOT.et"
+if test -f ${BASE}.c && cmp -s ${BASE}.c.$$ ${BASE}.c ; then
+ rm ${BASE}.c.$$
+else
+ mv ${BASE}.c.$$ ${BASE}.c
+fi
BEGIN {
+if ( length(outfn) == 0) {
+ outfn = outfile
+}
char_shift=64
## "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
c2n["A"]=1
}
}
print "/*" > outfile
- print " * " outfile ":" > outfile
+ print " * " outfn ":" > outfile
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
BEGIN {
+if ( length(outfn) == 0) {
+ outfn = outfile
+}
char_shift=64
## "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
c2n["A"]=1
curr_high = tab_base_high
curr_sign = tab_base_sign
print "/*" > outfile
- print " * " outfile ":" > outfile
+ print " * " outfn ":" > outfile
print " * This file is automatically generated; please do not edit it." > outfile
print " */" > outfile
print "" > outfile