instead of cpp. sed is portable and POSIX; cpp is neither.
-# .Sanitize for deja-gnu.
-
# Each directory to survive it's way into a release will need a file
# like this one called "./.Sanitize". All keyword lines must exist,
# and must exist in the order specified by this file. Each directory
aout.mt
configure.in
ecoff.mt
-weird-aout.S
+weird-aout.sed
weird-ecoff.sed
-weird-ecoff.S
-weird-xcoff.S
+weird-xcoff.sed
weird.def
weird.exp
xcoff.mt
-weird.o: $(srcdir)/weird.def $(srcdir)/weird-aout.S
- sed -f $(srcdir)/weird-aout.S <$(srcdir)/weird.def >weird.s
+weird.o: $(srcdir)/weird.def $(srcdir)/weird-aout.sed
+ sed -f $(srcdir)/weird-aout.sed <$(srcdir)/weird.def >weird.s
$(CC) -c weird.s
+++ /dev/null
-# GDB legitimately expects a file name.
-# The sun3 assembler bogusly requires that the value of this stab be a
-# label. Placate it.
-1i\
- .stabs "weird.c",0x64,0,0,Label0\
-Label0:
-#
-s/N_LSYM/0x80/
-s/N_GSYM/0x20/
-# Replace a single backslash with a doubled backslash
-/\.stabs/s/\\/\\\\/
-s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
-s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
-s/\.align_it/.align 2/
-/^#/d
-/.if alpha/,/.endif alpha/d
-/.if/d
-/.endif/d
--- /dev/null
+# GDB legitimately expects a file name.
+# The sun3 assembler bogusly requires that the value of this stab be a
+# label. Placate it.
+1i\
+ .stabs "weird.c",0x64,0,0,Label0\
+Label0:
+#
+s/N_LSYM/0x80/
+s/N_GSYM/0x20/
+# Replace a single backslash with a doubled backslash
+/\.stabs/s/\\/\\\\/
+s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
+s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
+s/\.align_it/.align 2/
+/^#/d
+/.if alpha/,/.endif alpha/d
+/.if/d
+/.endif/d
+++ /dev/null
-# GDB legitimately expects a file name.
-1i\
- .file 1 "weird.c"\
- #@stabs\
- #.stabs "weird.c",0x64,0,0,0
-/^#/d
-# Remove whitespace from various places.
-s/" *, */",/g
-s/\([0-9]\) *, */\1,/g
-s/ *$//
-#
-s/N_LSYM/0x80/
-s/N_GSYM/0x20/
-s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
-s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
-s/\.align_it/.align 2/
-/.if/d
-/.endif/d
+# GDB legitimately expects a file name.
+1i\
+ .file 1 "weird.c"\
+ #@stabs\
+ #.stabs "weird.c",0x64,0,0,0
+/^#/d
+# Remove whitespace from various places.
+s/" *, */",/g
+s/\([0-9]\) *, */\1,/g
+s/ *$//
+#
+s/N_LSYM/0x80/
+s/N_GSYM/0x20/
+s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
+s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
+s/\.align_it/.align 2/
+/.if/d
+/.endif/d
+++ /dev/null
-# Put everything in this csect, which seems to make things work.
-# The compiler actually puts the stabs in .csect [PR], but that didn't
-# work here (I guess because there is no text section).
-1i\
- .csect .data[RW]
-# .stabs string,type,0,0,value -> .stabx string,value,type,0
-s/^[ ]*\.stabs[ ]*\("[^"]*"\),[ ]*\([^,]*\),[ ]*0,0,[ ]*\(.*\)$/.stabx \1,\3,\2,0/
-s/N_GSYM/128/
-s/N_LSYM/129/
-s/\.begin_common/.bc/
-# The AIX assembler doesn't want the name in a .ec directive
-s/\.end_common.*/.ec/
-s/\.align_it/.align 1/
-/^#/d
-/.if alpha/,/.endif alpha/d
-/.if/d
-/.endif/d
--- /dev/null
+# Put everything in this csect, which seems to make things work.
+# The compiler actually puts the stabs in .csect [PR], but that didn't
+# work here (I guess because there is no text section).
+1i\
+ .csect .data[RW]
+# .stabs string,type,0,0,value -> .stabx string,value,type,0
+s/^[ ]*\.stabs[ ]*\("[^"]*"\),[ ]*\([^,]*\),[ ]*0,0,[ ]*\(.*\)$/.stabx \1,\3,\2,0/
+s/N_GSYM/128/
+s/N_LSYM/129/
+s/\.begin_common/.bc/
+# The AIX assembler doesn't want the name in a .ec directive
+s/\.end_common.*/.ec/
+s/\.align_it/.align 1/
+/\.data/d
+/^#/d
+/\.if alpha/,/\.endif alpha/d
+/\.if/d
+/\.endif/d
-WEIRDSTABS_S=weird-xcoff.S
-
-weird.o: ${srcdir}/${WEIRDSTABS_S} ${srcdir}/weird.def
- cp ${srcdir}/${WEIRDSTABS_S} tmp.c
- $(CC) -I${srcdir} -E tmp.c >weird.s
+weird.o: $(srcdir)/weird.def $(srcdir)/weird-xcoff.sed
+ sed -f $(srcdir)/weird-xcoff.sed <$(srcdir)/weird.def >weird.s
$(CC) -c weird.s