This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / binutils / mpw-make.sed
1 # Sed commands to finish translating the binutils Unix makefile into MPW syntax.
2
3 # Add a rule.
4 /^#### .*/a\
5 \
6 "{o}"underscore.c.o \\Option-f "{o}"underscore.c\
7
8 # Comment out any alias settings.
9 /^host_alias =/s/^/#/
10 /^target_alias =/s/^/#/
11
12 # Whack out unused host define bits.
13 /HDEFINES/s/@HDEFINES@//
14
15 # Don't build specialized tools.
16 /BUILD_NLMCONV/s/@BUILD_NLMCONV@//
17 /BUILD_SRCONV/s/@BUILD_SRCONV@//
18 /BUILD_DLLTOOL/s/@BUILD_DLLTOOL@//
19
20 /UNDERSCORE/s/@UNDERSCORE@/{UNDERSCORE}/
21
22 # Don't need this.
23 /@HLDFLAGS@/s/@HLDFLAGS@//
24
25 # Point at the libraries directly.
26 /@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
27 /@OPCODES@/s/@OPCODES@/::opcodes:libopcodes.o/
28
29 # Whack out target makefile fragment.
30 /target_makefile_fragment/s/target_makefile_fragment@//
31
32 # Fix and add to the include paths.
33 /^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
34 /BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
35 /INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
36
37 # Use byacc instead of bison (for now anyway).
38 /BISON/s/^BISON =.*$/BISON = byacc/
39 #/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
40
41 # Embed the version in symbolic doublequotes that will expand to
42 # the right thing for each compiler.
43 /VERSION/s/'"{VERSION}"'/{dq}{VERSION}{dq}/
44
45 # '+' is a special char to MPW, don't use it ever.
46 /c++filt/s/c++filt/cplusfilt/
47
48 # All of the binutils use the same Rez file, change names to refer to it.
49 /^{[A-Z]*_PROG}/s/$/ "{s}"mac-binutils.r/
50 /{[A-Z]*_PROG}\.r/s/{[A-Z]*_PROG}\.r/mac-binutils.r/
51
52 # There are auto-generated references to BFD .h files that are not
53 # in the objdir (like bfd.h) but are in the source dir.
54 /::bfd:lib/s/::bfd:lib\([a-z]*\)\.h/{BFDDIR}:lib\1.h/g
55
56 # Fix the locations of generated files.
57 /config/s/"{s}"config\.h/"{o}"config.h/g
58 /config/s/^config\.h/"{o}"config\.h/
59 /underscore/s/"{s}"underscore\.c/"{o}"underscore.c/g
60 /underscore/s/^underscore\.c/"{o}"underscore\.c/
61
62 # Fix paths to generated source files.
63 /lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g
64 /lex.yy.c/s/^lex\.yy\.c/"{o}"lex.yy.c/
65 /arlex.c/s/"{s}"arlex\.c/"{o}"arlex.c/g
66 /arlex.c/s/^arlex\.c/"{o}"arlex.c/
67 /y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
68 /y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
69 /arparse.c/s/"{s}"arparse\.c/"{o}"arparse.c/g
70 /arparse.c/s/^arparse\.c/"{o}"arparse.c/
71 /y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
72 /y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
73 /arparse.h/s/"{s}"arparse\.h/"{o}"arparse.h/g
74 /arparse.h/s/^arparse\.h/"{o}"arparse.h/
75
76 /"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g
77
78 # The generated lexer may include an ifdef for older Mac compilers that
79 # needs to work with newer compilers also.
80 /lex.yy.c/s/Rename -y \([^ ]*\) \([^ ]*\)$/sed -e 's,ifdef macintosh,if defined(macintosh) || defined(__MWERKS__),' \1 > \2/
81
82 # Fix an over-eagerness.
83 /echo.*WARNING.*This file/s/'.*'/' '/
84
85 # Add a "stamps" target.
86 $a\
87 stamps \\Option-f stamp-under\
88
89 /^install \\Option-f /,/^$/c\
90 install \\Option-f  all install-only\
91 \
92 install-only \\Option-f\
93         NewFolderRecursive "{bindir}"\
94         # Need to copy all the tools\
95         For prog in {PROGS}\
96                 Set progname `echo {prog} | sed -e 's/.new//'`\
97                 Duplicate -y :{prog} "{bindir}"{progname}\
98         End For\
99
100
101 /true/s/ ; @true$//
102
103 # dot files are trouble, remove them and their actions.
104 /^\.dep/,/^$/d
105
106 # Remove un-useful targets.
107 /^Makefile \\Option-f/,/^$/d
108 /^"{o}"config.h \\Option-f/,/^$/d
109 /^config.status \\Option-f/,/^$/d
110
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//
115