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 | ||
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/=.*$/=/ | |
19 | /#MMALLOC_DISABLE/s/^#// | |
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 | ||
35 | /@DEFS@/s/@DEFS@//g | |
36 | ||
37 | /@YACC@/s/@YACC@/byacc/g | |
38 | ||
39 | /@ENABLE_OBS@/s/@ENABLE_OBS@//g | |
40 | ||
41 | /@ENABLE_CLIBS@/s/@ENABLE_CLIBS@//g | |
42 | ||
43 | /INCLUDE_DIR/s/"{s}"{INCLUDE_DIR}/{INCLUDE_DIR}/g | |
44 | /INCLUDE_DIR/s/{INCLUDE_DIR}:/{INCLUDE_DIR}/g | |
45 | /INCLUDE_DIR/s/"{INCLUDE_DIR}":/"{INCLUDE_DIR}"/g | |
46 | ||
47 | /{BFD_DIR}/s/"{BFD_DIR}":/"{BFD_DIR}"/g | |
48 | /{BFD_DIR}/s/\([ ]\){BFD_DIR}/\1::{BFD_DIR}/g | |
49 | /{BFD_DIR}/s/\([ ]\)"{BFD_DIR}"/\1::"{BFD_DIR}"/g | |
50 | ||
51 | /{BFD_SRC}/s/"{s}"{BFD_SRC}/{BFD_SRC}/g | |
52 | /{BFD_SRC}/s/{BFD_SRC}:/{BFD_SRC}/g | |
53 | ||
54 | /{READLINE_SRC}/s/"{s}"{READLINE_SRC}/{READLINE_SRC}/g | |
55 | ||
56 | /^readline_headers =/,/^$/c\ | |
57 | readline_headers =\ | |
58 | ||
59 | ||
60 | /{MMALLOC_CHECK}/s/{MMALLOC_CHECK}//g | |
61 | ||
62 | # This isn't really useful, and seems to cause nonsensical complaints. | |
63 | /{ALLDEPFILES}/s/{ALLDEPFILES}//g | |
64 | ||
65 | /^copying.c \\Option-f /,/^$/d | |
66 | ||
67 | # Fix the syntax of bits of C code that go into version.c. | |
68 | /char /s/'char .Option-x/'char */ | |
69 | ||
70 | /version/s/"{s}"version\.c/"{o}"version.c/g | |
71 | /version/s/^version\.c/"{o}"version.c/ | |
72 | /xm/s/"{s}"xm\.h/"{o}"xm.h/g | |
73 | /xm/s/^xm\.h/"{o}"xm.h/ | |
74 | /tm/s/"{s}"tm\.h/"{o}"tm.h/g | |
75 | /tm/s/^tm\.h/"{o}"tm.h/ | |
76 | /nm/s/"{s}"nm\.h/"{o}"nm.h/g | |
77 | /nm/s/^nm\.h/"{o}"nm.h/ | |
78 | ||
79 | /exp.tab.c/s/"{s}"\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/g | |
80 | /exp.tab.c/s/^\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/ | |
81 | ||
82 | /y.tab/s/"{s}"y.tab\.c/"{o}"y.tab.c/g | |
83 | /y.tab/s/^y.tab\.c/"{o}"y.tab.c/ | |
84 | ||
85 | /init/s/"{s}"init\.c-tmp/"{o}"init.c-tmp/g | |
86 | /init/s/^init\.c-tmp/"{o}"init.c-tmp/ | |
87 | /init/s/"{s}"init\.c/"{o}"init.c/g | |
88 | /init/s/^init\.c/"{o}"init.c/ | |
89 | ||
90 | /"{o}"version.c \\Option-f Makefile/,/^$/c\ | |
91 | "{o}"version.c \\Option-f Makefile\ | |
92 | echo -n 'char *version = "' >"{o}"version.c\ | |
93 | echo -n "{VERSION}" >>"{o}"version.c\ | |
94 | echo '";' >>"{o}"version.c\ | |
95 | echo -n 'char *host_name = "' >>"{o}"version.c\ | |
96 | echo -n "{host_alias}" >>"{o}"version.c\ | |
97 | echo '";' >>"{o}"version.c\ | |
98 | echo -n 'char *target_name = "' >>"{o}"version.c\ | |
99 | echo -n "{target_alias}" >>"{o}"version.c\ | |
100 | echo '";' >>"{o}"version.c\ | |
101 | ||
102 | ||
103 | # Open-brace in a command causes much confusion; replace with the | |
104 | # result from a script. | |
105 | /initialize_all_files ()/c\ | |
106 | Echo -n 'void initialize_all_files () ' >> "{o}"init.c-tmp\ | |
107 | open-brace >> "{o}"init.c-tmp | |
108 | ||
109 | # Replace the whole sed bit for init.c; it's simpler that way... | |
110 | /filename=`echo $i | sed/,/esac/c\ | |
111 | set filename "`Echo {i} | sed \\Option-d\ | |
112 | -e '/^Onindy.c.o/d' \\Option-d\ | |
113 | -e '/^nindy.c.o/d' \\Option-d\ | |
114 | -e '/ttyflush.c.o/d' \\Option-d\ | |
115 | -e '/xdr_ld.c.o/d' \\Option-d\ | |
116 | -e '/xdr_ptrace.c.o/d' \\Option-d\ | |
117 | -e '/xdr_rdb.c.o/d' \\Option-d\ | |
118 | -e '/udr.c.o/d' \\Option-d\ | |
119 | -e '/udip2soc.c.o/d' \\Option-d\ | |
120 | -e '/udi2go32.c.o/d' \\Option-d\ | |
121 | -e '/version.c.o/d' \\Option-d\ | |
122 | -e '/[a-z0-9A-Z_]*-exp.tab.c.o/d' \\Option-d\ | |
123 | -e 's/\\.c\\.o/.c/' \\Option-d\ | |
124 | -e 's/^://'`"\ | |
125 | If "{filename}" != ""\ | |
126 | sed <"{s}""{filename}" >>"{o}"init.c-tmp -n \\Option-d\ | |
127 | -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\\([a-z_0-9A-Z]*\\).*/ {extern void \\1 (); \\1 ();}/p'\ | |
128 | End If | |
129 | ||
130 | # Fix the main compile/link command. | |
131 | /{CC_LD} {INTERNAL_LDFLAGS} -o gdb/,/"{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES}/c\ | |
132 | {CC_LD} {INTERNAL_LDFLAGS} -o gdb{PROG_EXT} "{o}"init.c.o {OBS} {TSOBS} {ADD_FILES} {CLIBS} {LOADLIBES} {EXTRALIBS}\ | |
133 | {MAKEPEF} gdb{PROG_EXT} -o gdb {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\ | |
134 | {REZ} "{s}"mac-gdb.r -o gdb -append -d PROG_NAME='"'gdb'"' -d VERSION_STRING='"'{version}'"'\ | |
135 | ||
c148ab3c SS |
136 | /^install \\Option-f /,/^$/c\ |
137 | install \\Option-f all install-only\ | |
138 | \ | |
139 | install-only \\Option-f \ | |
140 | Duplicate -y gdb "{bindir}"gdb\ | |
141 | If "`Exists SiowGDB`" != ""\ | |
142 | Duplicate -y SiowGDB "{bindir}"SiowGDB\ | |
143 | End If\ | |
144 | ||
145 | ||
7bd447ba SS |
146 | # Don't do any recursive subdir stuff. |
147 | / subdir_do/s/{MAKE}/null-command/ | |
148 | ||
149 | /^config.status \\Option-f/,/^$/d | |
96336a43 RJ |
150 | |
151 | # Add an action to build SIOWgdb. | |
152 | $a\ | |
153 | SIOWgdb \\Option-f {OBS} {TSOBS} {ADD_DEPS} {CDEPS} "{o}"init.c.o\ | |
154 | Delete -i -y SIOWgdb\ | |
155 | {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}\ | |
156 | {MAKEPEF} SIOWgdb{PROG_EXT} -o SIOWgdb -ft 'APPL' -fc 'gdb ' {MAKEPEF_FLAGS} \ | |
1c1a6a1e | 157 | {REZ} -o SIOWgdb "{RIncludes}"siow.r -append -d __kPrefSize=5000 -d __kMinSize=2000 -d APPNAME='"'SIOWgdb'"' \ |
96336a43 | 158 | {REZ} "{s}"mac-gdb.r -o SIOWgdb -append -d VERSION_STRING='"'{version}'"'\ |
1c1a6a1e | 159 |