190075Sobrien# Sed commands to finish translating the ld Makefile.in into MPW syntax.
290075Sobrien
390075Sobrien/HDEFINES/s/@HDEFINES@//
490075Sobrien
590075Sobrien/^target_alias = @target_alias@/s/^/#/
690075Sobrien
790075Sobrien/^EMUL = @EMUL@/s/^/#/
890075Sobrien
990075Sobrien/^EMULATION_OFILES = @EMULATION_OFILES@/s/^/#/
1090075Sobrien
1190075Sobrien# Fixadd to the include paths.
1290075Sobrien/^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
1390075Sobrien/BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
1490075Sobrien/INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
1590075Sobrien
1690075Sobrien# Use byacc instead of bison (for now anyway).
1790075Sobrien/BISON/s/^BISON =.*$/BISON = byacc/
18169689Skan#/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
19169689Skan
2090075Sobrien# Suppress the suppression of smart makes.
2190075Sobrien/^\.y\.c/d
2290075Sobrien
2390075Sobrien# Hack up ldmain compile.
2490075Sobrien/^"{o}"ldmain.c.o \\Option-f .* config.status$/,/^$/c\
2590075Sobrien"{o}"ldmain.c.o \\Option-f  "{s}"ldmain.c\
26117395Skan	{CC} @DASH_C_FLAG@ -d DEFAULT_EMULATION={dq}{EMUL}{dq} -d SCRIPTDIR={dq}{scriptdir}{dq} {ALL_CFLAGS} "{s}"ldmain.c -o "{o}"ldmain.c.o\
2790075Sobrien
2890075Sobrien
2990075Sobrien# Remove ldemul-list.h build, rely on configure to make one.
3090075Sobrien/^ldemul-list.h /,/Rename -y "{s}"ldemul-tmp.h /d
3190075Sobrien
3290075Sobrien# Fix pathnames to generated files.
33117395Skan/config.h/s/"{s}"config\.h/"{o}"config.h/g
3490075Sobrien/config.h/s/^config\.h/"{o}"config.h/
3590075Sobrien
3690075Sobrien/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
3790075Sobrien/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
3890075Sobrien/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
3990075Sobrien/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
4090075Sobrien
4190075Sobrien/ldgram.c/s/"{s}"ldgram\.c/"{o}"ldgram.c/g
4290075Sobrien/ldgram.c/s/^ldgram\.c/"{o}"ldgram.c/
4390075Sobrien
4490075Sobrien/ldgram.h/s/"{s}"ldgram\.h/"{o}"ldgram.h/g
4590075Sobrien/ldgram.h/s/^ldgram\.h/"{o}"ldgram.h/
4690075Sobrien
4790075Sobrien/ldlex.c/s/"{s}"ldlex\.c/"{o}"ldlex.c/g
4890075Sobrien/ldlex.c/s/^ldlex\.c/"{o}"ldlex.c/
4990075Sobrien
5090075Sobrien/ldlex.c.new/s/"{s}"ldlex\.c\.new/"{o}"ldlex.c.new/g
51
52/lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g
53
54/ldemul-list.h/s/"{s}"ldemul-list\.h/"{o}"ldemul-list.h/g
55/ldemul-list.h/s/^ldemul-list\.h/"{o}"ldemul-list.h/
56
57# Edit pathnames to emulation files.
58/"{s}"e.*\.c/s/"{s}"e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/g
59/^e.*\.c/s/^e\([-_a-z0-9]*\)\.c/"{o}"e\1.c/
60
61# We can't run genscripts, so don't try.
62/{GENSCRIPTS}/s/{GENSCRIPTS}/null-command/
63
64# Comment out the TDIRS bits.
65/^TDIRS@/s/^/#/
66
67# Point at the BFD library directly.
68/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
69
70# Don't need this.
71/@HLDFLAGS@/s/@HLDFLAGS@//
72
73#/sed.*free/,/> "{o}"ldlex.c.new/c\
74#	\	Catenate "{o}"lex.yy.c >"{o}"ldlex.c.new
75
76# The resource file is called mac-ld.r.
77/{LD_PROG}.r/s/{LD_PROG}\.r/mac-ld.r/
78
79/^install \\Option-f /,/^$/c\
80install \\Option-f  all install-only\
81\
82install-only \\Option-f\
83	NewFolderRecursive "{bindir}"\
84	Duplicate -y :ld.new "{bindir}"ld\
85
86
87# Remove dependency rebuilding crud.
88/^.dep /,/# .PHONY /d
89
90# Remove the lintlog action, pipe symbols in column 1 lose.
91/^lintlog \\Option-f/,/^$/d
92
93/^Makefile \\Option-f/,/^$/d
94/^"{o}"config.h \\Option-f/,/^$/d
95/^config.status \\Option-f/,/^$/d
96