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