Wed Jul 31 14:46:11 1996 Martin M. Hunt <hunt@pizza.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / mpw-make.sed
1 # Sed commands that finish translating the GDB Unix Makefile to MPW syntax.
2
3 /^host_alias =/s/^/#/
4 /^target_alias =/s/^/#/
5
6 /^host_makefile_frag@$/d
7 /^target_makefile_frag@$/d
8
9 /@ENABLE_CFLAGS@/s/@ENABLE_CFLAGS@/{ENABLE_CFLAGS}/g
10 /^ENABLE_CFLAGS=/s/^/#/
11
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 # Whack out autoconf hook for thread debugging.
36 /@CONFIG_LDFLAGS@/s/@CONFIG_LDFLAGS@//g
37
38 /@DEFS@/s/@DEFS@//g
39
40 /@YACC@/s/@YACC@/byacc/g
41
42 /@ENABLE_OBS@/s/@ENABLE_OBS@//g
43
44 /@ENABLE_CLIBS@/s/@ENABLE_CLIBS@//g
45
46 /@LIBS@/s/@LIBS@//g
47
48 # Whack out autoconf hook for thread debugging.
49 /@THREAD_DB_OBS@/s/@THREAD_DB_OBS@//g
50
51 # Fix up paths to include directories.
52 /INCLUDE_DIR/s/"{s}"{INCLUDE_DIR}/{INCLUDE_DIR}/g
53 /INCLUDE_DIR/s/{INCLUDE_DIR}:/{INCLUDE_DIR}/g
54 /INCLUDE_DIR/s/"{INCLUDE_DIR}":/"{INCLUDE_DIR}"/g
55
56 /{BFD_DIR}/s/"{BFD_DIR}":/"{BFD_DIR}"/g
57 /{BFD_DIR}/s/\([ ]\){BFD_DIR}/\1::{BFD_DIR}/g
58 /{BFD_DIR}/s/\([ ]\)"{BFD_DIR}"/\1::"{BFD_DIR}"/g
59
60 /{BFD_SRC}/s/"{s}"{BFD_SRC}/{BFD_SRC}/g
61 /{BFD_SRC}/s/{BFD_SRC}:/{BFD_SRC}/g
62
63 /{READLINE_SRC}/s/"{s}"{READLINE_SRC}/{READLINE_SRC}/g
64
65 /^readline_headers =/,/^$/c\
66 readline_headers =\
67
68
69 /{MMALLOC_CHECK}/s/{MMALLOC_CHECK}//g
70
71 # This isn't really useful, and seems to cause nonsensical complaints.
72 /{ALLDEPFILES}/s/{ALLDEPFILES}//g
73
74 /^copying.c \\Option-f /,/^$/d
75
76 # Fix the syntax of bits of C code that go into version.c.
77 /char /s/'char .Option-x/'char */
78
79 # Point at files in the obj dir rather than src dir.
80 /version/s/"{s}"version\.c/"{o}"version.c/g
81 /version/s/^version\.c/"{o}"version.c/
82 /config/s/"{s}"config\.h/"{o}"config.h/g
83 /config/s/^config\.h/"{o}"config.h/
84 /xm/s/"{s}"xm\.h/"{o}"xm.h/g
85 /xm/s/^xm\.h/"{o}"xm.h/
86 /tm/s/"{s}"tm\.h/"{o}"tm.h/g
87 /tm/s/^tm\.h/"{o}"tm.h/
88 /nm/s/"{s}"nm\.h/"{o}"nm.h/g
89 /nm/s/^nm\.h/"{o}"nm.h/
90
91 /exp.tab.c/s/"{s}"\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/g
92 /exp.tab.c/s/^\([a-z0-9]*\)-exp\.tab\.c/"{o}"\1-exp.tab.c/
93
94 /y.tab/s/"{s}"y.tab\.c/"{o}"y.tab.c/g
95 /y.tab/s/^y.tab\.c/"{o}"y.tab.c/
96
97 /init/s/"{s}"init\.c-tmp/"{o}"init.c-tmp/g
98 /init/s/^init\.c-tmp/"{o}"init.c-tmp/
99 /init/s/"{s}"init\.c/"{o}"init.c/g
100 /init/s/^init\.c/"{o}"init.c/
101
102 /"{o}"version.c \\Option-f Makefile/,/^$/c\
103 "{o}"version.c \\Option-f Makefile\
104 echo -n 'char *version = "' >"{o}"version.c\
105 echo -n "{VERSION}" >>"{o}"version.c\
106 echo '";' >>"{o}"version.c\
107 echo -n 'char *host_name = "' >>"{o}"version.c\
108 echo -n "{host_alias}" >>"{o}"version.c\
109 echo '";' >>"{o}"version.c\
110 echo -n 'char *target_name = "' >>"{o}"version.c\
111 echo -n "{target_alias}" >>"{o}"version.c\
112 echo '";' >>"{o}"version.c\
113
114
115 # Open-brace in a command causes much confusion; replace with the
116 # result from a script.
117 /initialize_all_files ()/c\
118 Echo -n 'void initialize_all_files () ' >> "{o}"init.c-tmp\
119 open-brace >> "{o}"init.c-tmp
120
121 # Replace the whole sed bit for init.c; it's simpler that way...
122 /filename=`echo $i | sed/,/esac/c\
123 set filename "`Echo {i} | sed \\Option-d\
124 -e '/^Onindy.c.o/d' \\Option-d\
125 -e '/^nindy.c.o/d' \\Option-d\
126 -e '/ttyflush.c.o/d' \\Option-d\
127 -e '/xdr_ld.c.o/d' \\Option-d\
128 -e '/xdr_ptrace.c.o/d' \\Option-d\
129 -e '/xdr_rdb.c.o/d' \\Option-d\
130 -e '/udr.c.o/d' \\Option-d\
131 -e '/udip2soc.c.o/d' \\Option-d\
132 -e '/udi2go32.c.o/d' \\Option-d\
133 -e '/version.c.o/d' \\Option-d\
134 -e '/[a-z0-9A-Z_]*-exp.tab.c.o/d' \\Option-d\
135 -e 's/\\.c\\.o/.c/' \\Option-d\
136 -e 's/^://'`"\
137 If "{filename}" != ""\
138 sed <"{s}""{filename}" >>"{o}"init.c-tmp -n \\Option-d\
139 -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\\([a-z_0-9A-Z]*\\).*/ {extern void \\1 (); \\1 ();}/p'\
140 End If
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
148 /^install \\Option-f /,/^$/c\
149 install \\Option-f all install-only\
150 \
151 install-only \\Option-f \
152 Duplicate -y gdb "{bindir}"gdb\
153 If "`Exists SiowGDB`" != ""\
154 Duplicate -y SiowGDB "{bindir}"SiowGDB\
155 End If\
156
157
158 # Don't do any recursive subdir stuff.
159 / subdir_do/s/{MAKE}/null-command/
160
161 # Edit out actions that only confuse MPW Make.
162 /^config.status \\Option-f/,/^$/d
163 /^Makefile \\Option-f/,/^$/d
164
165 /^"{o}"config.h \\Option-f/s/^/#/
166
167 # Add an action to build SIOWgdb.
168 $a\
169 SIOWgdb \\Option-f {OBS} {TSOBS} {ADD_DEPS} {CDEPS} "{o}"init.c.o\
170 Delete -i -y SIOWgdb\
171 {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}\
172 {MAKEPEF} SIOWgdb{PROG_EXT} -o SIOWgdb -ft 'APPL' -fc 'gdb ' {MAKEPEF_FLAGS} \
173 {REZ} -o SIOWgdb "{RIncludes}"siow.r -append -d __kPrefSize=5000 -d __kMinSize=2000 -d APPNAME='"'SIOWgdb'"' \
174 {REZ} "{s}"mac-gdb.r -o SIOWgdb -append -d VERSION_STRING='"'{version}'"'\
175
This page took 0.033267 seconds and 4 git commands to generate.