1 # Sed commands to finish translating the binutils Unix makefile into MPW syntax.
6 "{o}"underscore.c.o \\Option-f "{o}"underscore.c\
8 # Comment out any alias settings.
10 /^target_alias =/s/^/#/
12 # Whack out unused host define bits.
13 /HDEFINES/s/@HDEFINES@//
15 /BUILD_NLMCONV/s/@BUILD_NLMCONV@//
16 /BUILD_SRCONV/s/@BUILD_SRCONV@//
17 /BUILD_DLLTOOL/s/@BUILD_DLLTOOL@//
19 /UNDERSCORE/s/@UNDERSCORE@/{UNDERSCORE}/
22 /@HLDFLAGS@/s/@HLDFLAGS@//
24 # Point at the libraries directly.
25 /@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
26 /@OPCODES@/s/@OPCODES@/::opcodes:libopcodes.o/
28 # Whack out target makefile fragment.
29 /target_makefile_fragment/s/target_makefile_fragment@//
31 # Fix and add to the include paths.
32 /^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
33 /BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
34 /INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
36 # Use byacc instead of bison (for now anyway).
37 /BISON/s/^BISON =.*$/BISON = byacc/
38 #/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
40 # '+' is a special char to MPW, don't use it ever.
41 /c++filt/s/c++filt/cplusfilt/
43 /^{[A-Z]*_PROG}/s/$/ "{s}"mac-binutils.r/
44 /{[A-Z]*_PROG}\.r/s/{[A-Z]*_PROG}\.r/mac-binutils.r/
46 # There are auto-generated references to BFD .h files that are not
47 # in the objdir (like bfd.h) but are in the source dir.
48 /::bfd:lib/s/::bfd:lib\([a-z]*\)\.h/{BFDDIR}:lib\1.h/g
50 # Fix the locations of generated files.
51 /config/s/"{s}"config\.h/"{o}"config.h/g
52 /config/s/^config\.h/"{o}"config\.h/
53 /underscore/s/"{s}"underscore\.c/"{o}"underscore.c/g
54 /underscore/s/^underscore\.c/"{o}"underscore\.c/
56 # Fix paths to generated source files.
57 /lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g
58 /lex.yy.c/s/^lex\.yy\.c/"{o}"lex.yy.c/
59 /arlex.c/s/"{s}"arlex\.c/"{o}"arlex.c/g
60 /arlex.c/s/^arlex\.c/"{o}"arlex.c/
61 /y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
62 /y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
63 /arparse.c/s/"{s}"arparse\.c/"{o}"arparse.c/g
64 /arparse.c/s/^arparse\.c/"{o}"arparse.c/
65 /y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
66 /y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
67 /arparse.h/s/"{s}"arparse\.h/"{o}"arparse.h/g
68 /arparse.h/s/^arparse\.h/"{o}"arparse.h/
70 /"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g
72 # The generated lexer may include an ifdef for older Mac compilers that
73 # needs to work with newer compilers also.
74 /lex.yy.c/s/Rename -y \([^ ]*\) \([^ ]*\)$/sed -e 's,ifdef macintosh,if defined(macintosh) || defined(__MWERKS__),' \1 > \2/
76 # Fix an over-eagerness.
77 /echo.*WARNING.*This file/s/'.*'/' '/
79 # Add a "stamps" target.
81 stamps \\Option-f stamp-under\
83 /^install \\Option-f /,/^$/c\
84 install \\Option-f all install-only\
86 install-only \\Option-f\
87 If "`Exists "{prefix}"`" == ""\
88 Echo "{prefix}" does not exist, cannot install anything\
91 If "`Exists "{bindir}"`" == ""\
94 # Need to copy all the tools\
96 Set progname `echo {prog} | sed -e 's/.new//'`\
97 Duplicate -y :{prog} "{bindir}"{progname}\
103 # dot files are trouble, remove them and their actions.
106 # Remove un-useful targets.
107 /^Makefile \\Option-f/,/^$/d
108 /^"{o}"config.h \\Option-f/,/^$/d
109 /^config.status \\Option-f/,/^$/d
111 # Don't try to make the demangler's man page, it's useless.
112 /^{DEMANGLER_PROG}\.1 \\Option-f/,/^$/d
113 # Don't depend on it either.
114 /{DEMANGLER_PROG}/s/ {DEMANGLER_PROG}\.1//