]>
Commit | Line | Data |
---|---|---|
a6922ef0 SS |
1 | # Sed commands that finish translating the GDB Unix Makefile to MPW syntax. |
2 | ||
884fb64c SS |
3 | /^host_alias =/s/^/#/ |
4 | /^target_alias =/s/^/#/ | |
a6922ef0 SS |
5 | |
6 | /^host_makefile_frag@$/d | |
7 | /^target_makefile_frag@$/d | |
8 | ||
c148ab3c SS |
9 | /@ENABLE_CFLAGS@/s/@ENABLE_CFLAGS@/{ENABLE_CFLAGS}/g |
10 | /^ENABLE_CFLAGS=/s/^/#/ | |
653b07da | 11 | |
a6922ef0 SS |
12 | # Edit all the symbolic definitions pointing to various libraries and such. |
13 | ||
14 | /^INCLUDE_DIR = /s/"{srcdir}":include/"{topsrcdir}"include:/ | |
15 | ||
16 | /^MMALLOC_DIR = /s/::mmalloc/mmalloc:/ | |
17 | /^MMALLOC_SRC = /s/"{srcdir}"/"{topsrcdir}"/ | |
18 | /^MMALLOC =/s/=.*$/=/ | |
0728afad | 19 | /MMALLOC_CFLAGS =/s/=.*$/= -u USE_MMALLOC/ |
a6922ef0 SS |
20 | |
21 | /^BFD_DIR = /s/::bfd/bfd:/ | |
22 | /^BFD = /s/{BFD_DIR}:libbfd/{BFD_DIR}libbfd/ | |
23 | /^BFD_SRC = /s/"{srcdir}"/"{topsrcdir}"/ | |
24 | ||
25 | /^READLINE_DIR = /s/::readline/readline:/ | |
26 | /^READLINE =/s/=.*$/=/ | |
27 | /^READLINE_SRC = /s/"{srcdir}"/"{topsrcdir}"/ | |
28 | ||
29 | /^INCLUDE_CFLAGS = /s/$/ -i "{topsrcdir}"include:mpw: -i ::extra-include:/ | |
30 | ||
31 | /^SER_HARDWIRE =/s/ser-unix/ser-mac/ | |
32 | ||
33 | /^TERMCAP =/s/ =.*$/ =/ | |
34 | ||
b208ff3b | 35 | # Whack out various autoconf vars that we don't need. |
6687c953 | 36 | /@CONFIG_LDFLAGS@/s/@CONFIG_LDFLAGS@//g |
5efcbe36 | 37 | /@HLDFLAGS@/s/@HLDFLAGS@//g |
a6922ef0 | 38 | /@DEFS@/s/@DEFS@//g |
a6922ef0 | 39 | /@YACC@/s/@YACC@/byacc/g |
a6922ef0 | 40 | /@ENABLE_OBS@/s/@ENABLE_OBS@//g |
a6922ef0 | 41 | /@ENABLE_CLIBS@/s/@ENABLE_CLIBS@//g |
884fb64c SS |
42 | /@LIBS@/s/@LIBS@//g |
43 | ||
e7600d8e SS |
44 | # Whack out autoconf hook for thread debugging. |
45 | /@THREAD_DB_OBS@/s/@THREAD_DB_OBS@//g | |
46 | ||
47 | # Fix up paths to include directories. | |
a6922ef0 SS |
48 | /INCLUDE_DIR/s/"{s}"{INCLUDE_DIR}/{INCLUDE_DIR}/g |
49 | /INCLUDE_DIR/s/{INCLUDE_DIR}:/{INCLUDE_DIR}/g | |
50 | /INCLUDE_DIR/s/"{INCLUDE_DIR}":/"{INCLUDE_DIR}"/g | |
51 | ||
52 | /{BFD_DIR}/s/"{BFD_DIR}":/"{BFD_DIR}"/g | |
53 | /{BFD_DIR}/s/\([ ]\){BFD_DIR}/\1::{BFD_DIR}/g | |
54 | /{BFD_DIR}/s/\([ ]\)"{BFD_DIR}"/\1::"{BFD_DIR}"/g | |
55 | ||
56 | /{BFD_SRC}/s/"{s}"{BFD_SRC}/{BFD_SRC}/g | |
57 | /{BFD_SRC}/s/{BFD_SRC}:/{BFD_SRC}/g | |
58 | ||
59 | /{READLINE_SRC}/s/"{s}"{READLINE_SRC}/{READLINE_SRC}/g | |
60 | ||
61 | /^readline_headers =/,/^$/c\ | |
62 | readline_headers =\ | |
63 | ||
64 | ||
a6922ef0 SS |
65 | # This isn't really useful, and seems to cause nonsensical complaints. |
66 | /{ALLDEPFILES}/s/{ALLDEPFILES}//g | |
67 | ||
68 | /^copying.c \\Option-f /,/^$/d | |
69 | ||
70 | # Fix the syntax of bits of C code that go into version.c. | |
71 | /char /s/'char .Option-x/'char */ | |
72 | ||
e7600d8e | 73 | # Point at files in the obj dir rather than src dir. |
a6922ef0 SS |
74 | /version/s/"{s}"version\.c/"{o}"version.c/g |
75 | /version/s/^version\.c/"{o}"version.c/ | |
761e98aa SS |
76 | /config/s/"{s}"config\.h/"{o}"config.h/g |
77 | /config/s/^config\.h/"{o}"config.h/ | |
a6922ef0 SS |
78 | /xm/s/"{s}"xm\.h/"{o}"xm.h/g |
79 | /xm/s/^xm\.h/"{o}"xm.h/ | |
80 | /tm/s/"{s}"tm\.h/"{o}"tm.h/g | |
81 | /tm/s/^tm\.h/"{o}"tm.h/ | |
82 | /nm/s/"{s}"nm\.h/"{o}"nm.h/g | |
83 | /nm/s/^nm\.h/"{o}"nm.h/ | |
84 | ||
85 | /exp.tab.c/s/"{s}"\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/g | |
86 | /exp.tab.c/s/^\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/ | |
87 | ||
88 | /y.tab/s/"{s}"y.tab\.c/"{o}"y.tab.c/g | |
89 | /y.tab/s/^y.tab\.c/"{o}"y.tab.c/ | |
90 | ||
91 | /init/s/"{s}"init\.c-tmp/"{o}"init.c-tmp/g | |
92 | /init/s/^init\.c-tmp/"{o}"init.c-tmp/ | |
93 | /init/s/"{s}"init\.c/"{o}"init.c/g | |
94 | /init/s/^init\.c/"{o}"init.c/ | |
95 | ||
b208ff3b | 96 | # Fix up the generation of version.c. |
a6922ef0 SS |
97 | /"{o}"version.c \\Option-f Makefile/,/^$/c\ |
98 | "{o}"version.c \\Option-f Makefile\ | |
99 | echo -n 'char *version = "' >"{o}"version.c\ | |
100 | echo -n "{VERSION}" >>"{o}"version.c\ | |
101 | echo '";' >>"{o}"version.c\ | |
102 | echo -n 'char *host_name = "' >>"{o}"version.c\ | |
103 | echo -n "{host_alias}" >>"{o}"version.c\ | |
104 | echo '";' >>"{o}"version.c\ | |
105 | echo -n 'char *target_name = "' >>"{o}"version.c\ | |
106 | echo -n "{target_alias}" >>"{o}"version.c\ | |
107 | echo '";' >>"{o}"version.c\ | |
108 | ||
109 | ||
b208ff3b SS |
110 | /ansidecl/s/include "{s}""ansidecl.h"/include "ansidecl.h"/ |
111 | ||
a6922ef0 SS |
112 | # Open-brace in a command causes much confusion; replace with the |
113 | # result from a script. | |
114 | /initialize_all_files ()/c\ | |
115 | Echo -n 'void initialize_all_files () ' >> "{o}"init.c-tmp\ | |
116 | open-brace >> "{o}"init.c-tmp | |
117 | ||
118 | # Replace the whole sed bit for init.c; it's simpler that way... | |
5efcbe36 SS |
119 | /echo {OBS} {TSOBS}/,/echo '}'/c\ |
120 | For i in {OBS} {TSOBS}\ | |
121 | Set filename "`Echo {i} | sed \\Option-d\ | |
a6922ef0 SS |
122 | -e '/^Onindy.c.o/d' \\Option-d\ |
123 | -e '/^nindy.c.o/d' \\Option-d\ | |
124 | -e '/ttyflush.c.o/d' \\Option-d\ | |
125 | -e '/xdr_ld.c.o/d' \\Option-d\ | |
126 | -e '/xdr_ptrace.c.o/d' \\Option-d\ | |
127 | -e '/xdr_rdb.c.o/d' \\Option-d\ | |
128 | -e '/udr.c.o/d' \\Option-d\ | |
129 | -e '/udip2soc.c.o/d' \\Option-d\ | |
130 | -e '/udi2go32.c.o/d' \\Option-d\ | |
131 | -e '/version.c.o/d' \\Option-d\ | |
132 | -e '/[a-z0-9A-Z_]*-exp.tab.c.o/d' \\Option-d\ | |
133 | -e 's/\\.c\\.o/.c/' \\Option-d\ | |
134 | -e 's/^://'`"\ | |
135 | If "{filename}" != ""\ | |
136 | sed <"{s}""{filename}" >>"{o}"init.c-tmp -n \\Option-d\ | |
137 | -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\\([a-z_0-9A-Z]*\\).*/ {extern void \\1 (); \\1 ();}/p'\ | |
5efcbe36 SS |
138 | End If\ |
139 | End For\ | |
140 | Echo '}' >>"{o}"init.c-tmp | |
a6922ef0 SS |
141 | |
142 | # Fix the main compile/link command. | |
143 | /{CC_LD} {INTERNAL_LDFLAGS} -o gdb/,/"{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES}/c\ | |
144 | {CC_LD} {INTERNAL_LDFLAGS} -o gdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES} {EXTRALIBS}\ | |
145 | {MAKEPEF} gdb{PROG_EXT} -o gdb {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\ | |
146 | {REZ} "{s}"mac-gdb.r -o gdb -append -d PROG_NAME='"'gdb'"' -d VERSION_STRING='"'{version}'"'\ | |
147 | ||
b208ff3b | 148 | # Replace the install actions with MPW-friendly script. |
c148ab3c SS |
149 | /^install \\Option-f /,/^$/c\ |
150 | install \\Option-f all install-only\ | |
151 | \ | |
152 | install-only \\Option-f \ | |
7885e8b3 | 153 | NewFolderRecursive "{bindir}"\ |
c148ab3c SS |
154 | Duplicate -y gdb "{bindir}"gdb\ |
155 | If "`Exists SiowGDB`" != ""\ | |
156 | Duplicate -y SiowGDB "{bindir}"SiowGDB\ | |
157 | End If\ | |
158 | ||
159 | ||
7bd447ba SS |
160 | # Don't do any recursive subdir stuff. |
161 | / subdir_do/s/{MAKE}/null-command/ | |
162 | ||
884fb64c | 163 | # Edit out actions that only confuse MPW Make. |
7bd447ba | 164 | /^config.status \\Option-f/,/^$/d |
884fb64c | 165 | /^Makefile \\Option-f/,/^$/d |
96336a43 | 166 | |
b208ff3b | 167 | # Don't test config.h dependencies. |
761e98aa SS |
168 | /^"{o}"config.h \\Option-f/s/^/#/ |
169 | ||
96336a43 RJ |
170 | # Add an action to build SIOWgdb. |
171 | $a\ | |
172 | SIOWgdb \\Option-f {OBS} {TSOBS} {ADD_DEPS} {CDEPS} "{o}"init.c.o\ | |
173 | Delete -i -y SIOWgdb\ | |
174 | {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}\ | |
175 | {MAKEPEF} SIOWgdb{PROG_EXT} -o SIOWgdb -ft 'APPL' -fc 'gdb ' {MAKEPEF_FLAGS} \ | |
1c1a6a1e | 176 | {REZ} -o SIOWgdb "{RIncludes}"siow.r -append -d __kPrefSize=5000 -d __kMinSize=2000 -d APPNAME='"'SIOWgdb'"' \ |
96336a43 | 177 | {REZ} "{s}"mac-gdb.r -o SIOWgdb -append -d VERSION_STRING='"'{version}'"'\ |
1c1a6a1e | 178 |