* mpw-make.sed: Edit paths to generated y.tab.[ch] files.
[external/binutils.git] / binutils / mpw-make.sed
1 # Sed commands to finish translating the binutils Unix makefile into MPW syntax.
2
3 # Define undefined makefile variables.
4 /^#### .*/a\
5 \
6 BUILD_NLMCONV = \
7 BUILD_SRCONV = \
8 SYSINFO_PROG = \
9 BUILD_DLLTOOL = \
10 \
11 "{o}"underscore.c.o \\Option-f "{o}"underscore.c\
12
13 # Whack out unused host define bits.
14 /HDEFINES/s/@HDEFINES@//
15
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 # Whack out target makefile fragment.
23 /target_makefile_fragment/s/target_makefile_fragment@//
24
25 # Fix and add to the include paths.
26 /^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
27 /BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
28 /INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
29
30 # Use byacc instead of bison (for now anyway).
31 /BISON/s/^BISON =.*$/BISON = byacc/
32 #/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
33
34 # '+' is a special char to MPW, don't use it ever.
35 /c++filt/s/c++filt/cplusfilt/
36
37 /^{[A-Z]*_PROG}/s/$/ "{s}"mac-binutils.r/
38 /{[A-Z]*_PROG}\.r/s/{[A-Z]*_PROG}\.r/mac-binutils.r/
39
40 # Fix the locations of generated files.
41 /config/s/"{s}"config\.h/"{o}"config.h/g
42 /config/s/^config\.h/"{o}"config\.h/
43 /underscore/s/"{s}"underscore\.c/"{o}"underscore.c/g
44 /underscore/s/^underscore\.c/"{o}"underscore\.c/
45
46 # Fix paths to generated source files.
47 /lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g
48 /lex.yy.c/s/^lex\.yy\.c/"{o}"lex.yy.c/
49 /arlex.c/s/"{s}"arlex\.c/"{o}"arlex.c/g
50 /arlex.c/s/^arlex\.c/"{o}"arlex.c/
51 /y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
52 /y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
53 /arparse.c/s/"{s}"arparse\.c/"{o}"arparse.c/g
54 /arparse.c/s/^arparse\.c/"{o}"arparse.c/
55 /y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
56 /y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
57 /arparse.h/s/"{s}"arparse\.h/"{o}"arparse.h/g
58 /arparse.h/s/^arparse\.h/"{o}"arparse.h/
59
60 /"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g
61
62 # The generated lexer may include an ifdef for older Mac compilers that
63 # needs to work with newer compilers also.
64 /lex.yy.c/s/Rename -y \([^ ]*\) \([^ ]*\)$/sed -e 's,ifdef macintosh,if defined(macintosh) || defined(__MWERKS__),' \1 > \2/
65
66 # Fix an over-eagerness.
67 /echo.*WARNING.*This file/s/'.*'/' '/
68
69 # Remove un-useful targets.
70 /^Makefile \\Option-f/,/^$/d
71 /^"{o}"config.h \\Option-f/,/^$/d
72 /^config.status \\Option-f/,/^$/d