1# Sed commands to finish translating the ld Makefile.in into MPW syntax.
2
3/HDEFINES/s/@HDEFINES@//
4
5/^target_alias = @target_alias@/s/^/#/
6
7/^EMUL = @EMUL@/s/^/#/
8
9/^EMULATION_OFILES = @EMULATION_OFILES@/s/^/#/
10
11# Fixadd to the include paths.
12/^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
13/BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
14/INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
15
16# Use byacc instead of bison (for now anyway).
17/BISON/s/^BISON =.*$/BISON = byacc/
18#/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
19
20# Suppress the suppression of smart makes.
21/^\.y\.c/d
22
23# Hack up ldmain compile.
24/^"{o}"ldmain.c.o \\Option-f .* config.status$/,/^$/c\
25"{o}"ldmain.c.o \\Option-f  "{s}"ldmain.c\
26	{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\
27
28
29# Remove ldemul-list.h build, rely on configure to make one.
30/^ldemul-list.h /,/Rename -y "{s}"ldemul-tmp.h /d
31
32# Fix pathnames to generated files.
33/config.h/s/"{s}"config\.h/"{o}"config.h/g
34/config.h/s/^config\.h/"{o}"config.h/
35
36/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
37/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
38/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
39/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
40
41/ldgram.c/s/"{s}"ldgram\.c/"{o}"ldgram.c/g
42/ldgram.c/s/^ldgram\.c/"{o}"ldgram.c/
43
44/ldgram.h/s/"{s}"ldgram\.h/"{o}"ldgram.h/g
45/ldgram.h/s/^ldgram\.h/"{o}"ldgram.h/
46
47/ldlex.c/s/"{s}"ldlex\.c/"{o}"ldlex.c/g
48/ldlex.c/s/^ldlex\.c/"{o}"ldlex.c/
49
50/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