* mpw-config.in: Add variable with names of SIOW libraries.
[platform/upstream/binutils.git] / gdb / mpw-make.sed
1 # Sed commands that finish translating the GDB Unix Makefile to MPW syntax.
2
3 /^host_alias =/d
4 /^target_alias =/d
5
6 /^host_makefile_frag@$/d
7 /^target_makefile_frag@$/d
8
9 /@ENABLE_CFLAGS@/s/@ENABLE_CFLAGS@//g
10
11 # Edit all the symbolic definitions pointing to various libraries and such.
12
13 /^INCLUDE_DIR = /s/"{srcdir}":include/"{topsrcdir}"include:/
14
15 /^MMALLOC_DIR = /s/::mmalloc/mmalloc:/
16 /^MMALLOC_SRC = /s/"{srcdir}"/"{topsrcdir}"/
17 /^MMALLOC =/s/=.*$/=/
18 /#MMALLOC_DISABLE/s/^#//
19
20 /^BFD_DIR = /s/::bfd/bfd:/
21 /^BFD = /s/{BFD_DIR}:libbfd/{BFD_DIR}libbfd/
22 /^BFD_SRC = /s/"{srcdir}"/"{topsrcdir}"/
23
24 /^READLINE_DIR = /s/::readline/readline:/
25 /^READLINE =/s/=.*$/=/
26 /^READLINE_SRC = /s/"{srcdir}"/"{topsrcdir}"/
27
28 /^INCLUDE_CFLAGS = /s/$/ -i "{topsrcdir}"include:mpw: -i ::extra-include:/
29
30 /^SER_HARDWIRE =/s/ser-unix/ser-mac/
31
32 /^TERMCAP =/s/ =.*$/ =/
33
34 /@DEFS@/s/@DEFS@//g
35
36 /@YACC@/s/@YACC@/byacc/g
37
38 /@ENABLE_OBS@/s/@ENABLE_OBS@//g
39
40 /@ENABLE_CLIBS@/s/@ENABLE_CLIBS@//g
41
42 /INCLUDE_DIR/s/"{s}"{INCLUDE_DIR}/{INCLUDE_DIR}/g
43 /INCLUDE_DIR/s/{INCLUDE_DIR}:/{INCLUDE_DIR}/g
44 /INCLUDE_DIR/s/"{INCLUDE_DIR}":/"{INCLUDE_DIR}"/g
45
46 /{BFD_DIR}/s/"{BFD_DIR}":/"{BFD_DIR}"/g
47 /{BFD_DIR}/s/\([        ]\){BFD_DIR}/\1::{BFD_DIR}/g
48 /{BFD_DIR}/s/\([        ]\)"{BFD_DIR}"/\1::"{BFD_DIR}"/g
49
50 /{BFD_SRC}/s/"{s}"{BFD_SRC}/{BFD_SRC}/g
51 /{BFD_SRC}/s/{BFD_SRC}:/{BFD_SRC}/g
52
53 /{READLINE_SRC}/s/"{s}"{READLINE_SRC}/{READLINE_SRC}/g
54
55 /^readline_headers =/,/^$/c\
56 readline_headers =\
57
58
59 /{MMALLOC_CHECK}/s/{MMALLOC_CHECK}//g
60
61 # This isn't really useful, and seems to cause nonsensical complaints.
62 /{ALLDEPFILES}/s/{ALLDEPFILES}//g
63
64 /^copying.c \\Option-f /,/^$/d
65
66 # Fix the syntax of bits of C code that go into version.c.
67 /char /s/'char .Option-x/'char */
68
69 /version/s/"{s}"version\.c/"{o}"version.c/g
70 /version/s/^version\.c/"{o}"version.c/
71 /xm/s/"{s}"xm\.h/"{o}"xm.h/g
72 /xm/s/^xm\.h/"{o}"xm.h/
73 /tm/s/"{s}"tm\.h/"{o}"tm.h/g
74 /tm/s/^tm\.h/"{o}"tm.h/
75 /nm/s/"{s}"nm\.h/"{o}"nm.h/g
76 /nm/s/^nm\.h/"{o}"nm.h/
77
78 /exp.tab.c/s/"{s}"\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/g
79 /exp.tab.c/s/^\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/
80
81 /y.tab/s/"{s}"y.tab\.c/"{o}"y.tab.c/g
82 /y.tab/s/^y.tab\.c/"{o}"y.tab.c/
83
84 /init/s/"{s}"init\.c-tmp/"{o}"init.c-tmp/g
85 /init/s/^init\.c-tmp/"{o}"init.c-tmp/
86 /init/s/"{s}"init\.c/"{o}"init.c/g
87 /init/s/^init\.c/"{o}"init.c/
88
89 /"{o}"version.c \\Option-f Makefile/,/^$/c\
90 "{o}"version.c \\Option-f Makefile\
91         echo -n 'char *version = "'      >"{o}"version.c\
92         echo -n "{VERSION}"             >>"{o}"version.c\
93         echo '";'                       >>"{o}"version.c\
94         echo -n 'char *host_name = "'   >>"{o}"version.c\
95         echo -n "{host_alias}"          >>"{o}"version.c\
96         echo '";'                       >>"{o}"version.c\
97         echo -n 'char *target_name = "' >>"{o}"version.c\
98         echo -n "{target_alias}"        >>"{o}"version.c\
99         echo '";'                       >>"{o}"version.c\
100
101
102 # Open-brace in a command causes much confusion; replace with the
103 # result from a script.
104 /initialize_all_files ()/c\
105         Echo -n 'void initialize_all_files () ' >> "{o}"init.c-tmp\
106         open-brace >> "{o}"init.c-tmp
107
108 # Replace the whole sed bit for init.c; it's simpler that way...
109 /filename=`echo $i | sed/,/esac/c\
110           set filename "`Echo {i} | sed \\Option-d\
111             -e '/^Onindy.c.o/d' \\Option-d\
112             -e '/^nindy.c.o/d' \\Option-d\
113             -e '/ttyflush.c.o/d' \\Option-d\
114             -e '/xdr_ld.c.o/d' \\Option-d\
115             -e '/xdr_ptrace.c.o/d' \\Option-d\
116             -e '/xdr_rdb.c.o/d' \\Option-d\
117             -e '/udr.c.o/d' \\Option-d\
118             -e '/udip2soc.c.o/d' \\Option-d\
119             -e '/udi2go32.c.o/d' \\Option-d\
120             -e '/version.c.o/d' \\Option-d\
121             -e '/[a-z0-9A-Z_]*-exp.tab.c.o/d' \\Option-d\
122             -e 's/\\.c\\.o/.c/' \\Option-d\
123             -e 's/^://'`"\
124           If "{filename}" != ""\
125             sed <"{s}""{filename}" >>"{o}"init.c-tmp -n \\Option-d\
126             -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\\([a-z_0-9A-Z]*\\).*/  {extern void \\1 (); \\1 ();}/p'\
127           End If
128
129 # Fix the main compile/link command.
130 /{CC_LD} {INTERNAL_LDFLAGS} -o gdb/,/"{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES}/c\
131         {CC_LD} {INTERNAL_LDFLAGS} -o gdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES} {EXTRALIBS}\
132         {MAKEPEF} gdb{PROG_EXT} -o gdb {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
133         {REZ} "{s}"mac-gdb.r -o gdb -append -d PROG_NAME='"'gdb'"' -d VERSION_STRING='"'{version}'"'\
134
135 # Don't do any recursive subdir stuff.
136 / subdir_do/s/{MAKE}/null-command/
137
138 /^config.status \\Option-f/,/^$/d
139
140 # Add an action to build SIOWgdb.
141 $a\
142 SIOWgdb \\Option-f {OBS} {TSOBS} {ADD_DEPS} {CDEPS} "{o}"init.c.o\
143         Delete -i -y SIOWgdb\
144         {CC_LD} {INTERNAL_LDFLAGS} -t 'APPL' -c 'gdb ' -o SIOWgdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {SIOW_LIB} {LOADLIBES} {EXTRALIBS}\
145         {MAKEPEF} SIOWgdb{PROG_EXT} -o SIOWgdb -ft 'APPL' -fc 'gdb ' {MAKEPEF_FLAGS} \
146         {REZ} -o SIOWgdb {RIncludes}siow.r -append -d __kPrefSize=5000 -d __kMinSize=2000 -d APPNAME='"'SIOWgdb'"' \
147         {REZ} "{s}"mac-gdb.r -o SIOWgdb -append -d VERSION_STRING='"'{version}'"'\
148
149
150