gdb-3.4
[deliverable/binutils-gdb.git] / gdb / Makefile.dist
1 /* This file should be run through the C preprocessor by config.gdb
2 to produce the Makefile. */
3
4 /* System V:
5 If your system has a broken alloca(), define ALLOCA & ALLOCA1 below.
6 Also, if you compile gdb with a compiler which uses the coff
7 encapsulation feature (this is a function of the compiler used, NOT
8 of the m-?.h file selected by config.gdb), you must make sure that
9 the GNU nm is the one that is used by munch. */
10
11 /* If you are compiling with GCC, make sure that either 1) You use the
12 -traditional flag, or 2) You have the fixed include files where GCC
13 can reach them. Otherwise the ioctl calls in inflow.c and readline.c
14 will be incorrectly compiled. The "fixincludes" script in the gcc
15 distribution will fix your include files up. */
16 /* CC=gcc -traditional */
17 CC=cc
18
19 /* It is also possible that you will need to add -I/usr/include/sys to the
20 CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
21 is where it should be according to Posix). */
22
23 YACC=bison -y -v
24 /* YACC=yacc */
25 SHELL=/bin/sh
26 MAKE=make
27
28 /* Set this up with gcc if you have gnu ld and the loader will print out
29 line numbers for undefinded refs. */
30 /* CC-LD=gcc -static */
31 CC-LD=${CC}
32
33 /* If you are using the GNU C library, uncomment the following line. */
34 /* HAVE_VPRINTF_DEFINE = -DHAVE_VPRINTF */
35
36 /* -I. for "#include <obstack.h>". Possibly regex.h also. */
37
38 /* M_CFLAGS, if defined, has system-dependent CFLAGS. */
39 #if !defined(M_CFLAGS)
40 #define M_CFLAGS
41 #endif
42
43 /* CFLAGS for both GDB and readline. */
44 GLOBAL_CFLAGS = -g M_CFLAGS
45 CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
46 /* None of the things in CFLAGS will do any harm, and on some systems
47 (e.g. SunOS4) it is important to use the M_CFLAGS. */
48 LDFLAGS = $(CFLAGS)
49
50 /*
51 define this to be "obstack.o" if you don't have the obstack library installed
52 you must at the same time define OBSTACK1 as "obstack.o"
53 so that the dependencies work right. Similarly with REGEX and "regex.o".
54 You must define REGEX and REGEX1 on USG machines.
55 If your sysyem is missing alloca(), or, more likely, it's there but
56 it doesn't work, define ALLOCA & ALLOCA1 */
57 OBSTACK = obstack.o
58 OBSTACK1 = obstack.o
59
60 #ifdef M_REGEX
61 REGEX = M_REGEX
62 REGEX1 = M_REGEX
63 #else
64 REGEX =
65 REGEX1 =
66 #endif
67
68 #ifdef M_ALLOCA
69 ALLOCA = M_ALLOCA
70 ALLOCA1 = M_ALLOCA
71 #else
72 ALLOCA =
73 ALLOCA1 =
74 #endif
75
76 /*
77 define this to be "malloc.o" if you want to use the gnu malloc routine
78 (useful for debugging memory allocation problems in gdb). Otherwise, leave
79 it blank. */
80 /* GNU_MALLOC = */
81 GNU_MALLOC = malloc.o
82
83 /* Flags to be used in compiling malloc.o
84 Specify range checking for storage allocation. */
85 /* MALLOC_FLAGS = ${CFLAGS} */
86 MALLOC_FLAGS = ${CFLAGS} -Drcheck -Dbotch=fatal_dump_core -DMSTATS
87
88 /* Define SYSV if compiling on a system V or HP machine. */
89 #ifdef M_SYSV
90 SYSV_DEFINE = -DSYSV
91 #else
92 SYSV_DEFINE =
93 #endif
94
95 /* MUNCH_DEFINE should be -DSYSV if have System V-style nm,
96 or null if have BSD-style nm. */
97 #ifdef M_BSD_NM
98 MUNCH_DEFINE =
99 #else
100 MUNCH_DEFINE = ${SYSV_DEFINE}
101 #endif
102
103 /* Flags that describe where you can find the termcap library.
104 You may need to make other arrangements for USG. */
105 TERMCAP = -ltermcap
106
107 /* M_CLIBS, if defined, has system-dependent libs
108 For example, -lPW for System V */
109 #ifndef M_CLIBS
110 #define M_CLIBS
111 #endif
112 CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
113
114 ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
115 ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
116
117 SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
118 environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
119 kdb-start.c main.c printcmd.c \
120 remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
121 utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
122 xgdb.c
123
124 DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
125 sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
126 symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c
127
128 PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
129 ns32k-pinsn.c convex-pinsn.c
130
131 HFILES = command.h defs.h environ.h expression.h frame.h getpagesize.h \
132 inferior.h symseg.h symtab.h value.h wait.h \
133 a.out.encap.h a.out.gnu.h stab.gnu.h
134
135 OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
136 ns32k-opcode.h convex-opcode.h
137
138 MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
139 m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
140 m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
141 m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
142 m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h
143
144 /* This list of files really shouldn't be in this makefile, but I can't think
145 of any good way to get the readline makefile to tell us what files
146 to put in our tarfile. */
147 READLINE = readline.c history.c funmap.c \
148 emacs_keymap.c vi_keymap.c vi_mode.c keymaps.c \
149 readline.h history.h keymaps.h chardefs.h \
150 inc-readline.texinfo inc-history.texinfo \
151 Makefile ChangeLog
152
153 REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
154
155 POSSLIBS = obstack.h obstack.c regex.c regex.h malloc.c alloca.c
156
157 TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
158
159 OTHERS = Makefile.dist createtags munch config.gdb ChangeLog README TAGS \
160 gdb.texinfo .gdbinit COPYING expread.tab.c stab.def \
161 XGDB-README copying.c Projects Convex.notes copying.awk hp-include
162
163 TAGFILES = ${SFILES} ${DEPFILES} ${PINSNS} ${HFILES} ${OPCODES} ${MFILES} \
164 ${POSSLIBS}
165 TARFILES = ${TAGFILES} ${OTHERS} ${REMOTE_EXAMPLES}
166
167 OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
168 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
169 symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
170 command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
171 copying.o ${READLINEOBS}
172
173 TSOBS = core.o inflow.o dep.o
174
175 NTSOBS = standalone.o
176
177 TSSTART = /lib/crt0.o
178
179 NTSSTART = kdb-start.o
180
181 RL_LIB = readline/libreadline.a
182
183 /* Do some fancy trickery to produce a line like
184 -DM_MAKEDEFINE="-DM_SYSV -DM_BSD_NM".
185 */
186 MD=M_MAKEDEFINE
187
188 /* Avoid funny things that Sun's make throws in for us. */
189 /* TARGET_ARCH is supposed to get around it putting in the machine type.
190 If the "things" up there really is plural, we'll need to do something
191 else as well. */
192 /*.c.o:
193 ${CC} -c ${CFLAGS} $< */
194 TARGET_ARCH=
195
196 gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
197 rm -f init.c
198 ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
199 ${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
200
201 /* This is useful when debugging GDB, because Unix doesn't let you run GDB
202 on itself without copying the executable. So "make gdb1" will make
203 gdb and put a copy in gdb1, and you can run it with "gdb gdb1". */
204 gdb1 : gdb
205 cp gdb gdb1
206
207 Makefile : Makefile.dist
208 cp Makefile.dist tmp.c
209 /* This did not work-- -Usparc became "-Usparc" became "-Usparc.
210 Or something like that. */
211 /* $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=\"$(MD)\"" */
212 $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
213 -rm tmp.c
214
215 xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
216 rm -f init.c
217 ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
218 $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
219 -lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
220
221 /* Old (pre R3) xgdb comp.
222 $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
223 -lXaw -lXt -lX11 $(CLIBS) */
224
225 kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
226 rm -f init.c
227 ./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
228 $(CC) $(LDFLAGS) -c init.c $(CLIBS)
229 ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o ${RL_LIB} -lc $(CLIBS)
230
231 /* If it can figure out the appropriate order, createtags will make sure
232 that the proper m-*, *-dep, *-pinsn, and *-opcode files come first
233 in the tags list. It will attempt to do the same for dbxread.c and
234 coffread.c. This makes using M-. on machine dependent routines much
235 easier. */
236
237 TAGS: ${TAGFILES}
238 createtags ${TAGFILES}
239 tags: TAGS
240
241 gdb.tar: ${TARFILES}
242 rm -f gdb.tar
243 mkdir dist-gdb
244 cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
245 mkdir dist-gdb/readline
246 cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
247 tar chf gdb.tar dist-gdb
248 rm -rf dist-gdb
249
250 /* Remove gdb.tar.Z so stupid compress doesn't ask whether we want to
251 overwrite it. compress -f is not what we want, because we do want
252 to know if compress would not make it smaller. */
253 gdb.tar.Z: gdb.tar
254 if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; fi
255 compress gdb.tar
256
257 clean:
258 rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
259 rm -f init.c init.o
260 rm -f gdb core gdb.tar gdb.tar.Z make.log
261 rm -f gdb[0-9]
262 cd readline ; make clean
263
264 distclean: clean expread.tab.c TAGS
265 rm -f dep.c opcode.h param.h pinsn.c config.status
266 rm -f y.output yacc.acts yacc.tmp
267 rm -f ${TESTS} Makefile
268
269 realclean: clean
270 rm -f expread.tab.c TAGS
271 rm -f dep.c opcode.h param.h pinsn.c config.status
272 rm -f Makefile
273
274 xgdb.o : defs.h param.h symtab.h frame.h
275
276 /* Make copying.c from COPYING */
277 copying.c : COPYING copying.awk
278 awk -f copying.awk < COPYING > copying.c
279
280 expread.tab.c : expread.y
281 @echo 'Expect 4 shift/reduce conflict.'
282 ${YACC} expread.y
283 mv y.tab.c expread.tab.c
284
285 expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
286 $(CC) -c ${CFLAGS} expread.tab.c
287 mv expread.tab.o expread.o
288
289 readline/libreadline.a : force_update
290 cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
291 "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
292
293 force_update :
294
295 /* Only useful if you are using the gnu malloc routines. */
296 malloc.o : malloc.c
297 ${CC} -c ${MALLOC_FLAGS} malloc.c
298
299 /* dep.o depends on config.status in case someone reconfigures gdb out
300 from under an already compiled gdb. */
301 dep.o : dep.c config.status defs.h param.h frame.h inferior.h obstack.h \
302 a.out.encap.h
303
304 /* pinsn.o depends on config.status in case someone reconfigures gdb out
305 from under an already compiled gdb. */
306 pinsn.o : pinsn.c config.status defs.h param.h symtab.h obstack.h symseg.h \
307 frame.h opcode.h
308
309 /* The rest of this is a standard dependencies list (hand edited output of
310 cpp -M). It does not include dependencies of .o files on .c files. */
311 /* All files which depend on config.status also depend on param.h in case
312 someone reconfigures gdb out from under an already compiled gdb. */
313 blockframe.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
314 breakpoint.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
315 coffread.o : defs.h param.h config.status
316 command.o : command.h defs.h
317 core.o : defs.h param.h config.status a.out.encap.h
318 dbxread.o : param.h config.status defs.h symtab.h obstack.h symseg.h a.out.encap.h \
319 stab.gnu.h
320 environ.o : environ.h
321 eval.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
322 expprint.o : defs.h symtab.h obstack.h symseg.h param.h config.status expression.h
323 findvar.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h value.h
324 infcmd.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
325 environ.h value.h
326 inflow.o : defs.h param.h config.status frame.h inferior.h
327 infrun.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
328 wait.h
329 kdb-start.o : defs.h param.h config.status
330 main.o : defs.h command.h param.h config.status
331 malloc.o : getpagesize.h
332 obstack.o : obstack.h
333 printcmd.o : defs.h param.h config.status frame.h symtab.h obstack.h symseg.h value.h \
334 expression.h
335 regex.o : regex.h
336 remote.o : defs.h param.h config.status frame.h inferior.h wait.h
337 source.o : defs.h symtab.h obstack.h symseg.h param.h config.status
338 stack.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
339 standalone.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h \
340 inferior.h wait.h
341 symmisc.o : defs.h symtab.h obstack.h symseg.h obstack.h
342 symtab.o : defs.h symtab.h obstack.h symseg.h param.h config.status obstack.h
343 utils.o : defs.h param.h config.status
344 valarith.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
345 valops.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h frame.h \
346 inferior.h
347 valprint.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
348 values.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
349
350 robotussin.h : getpagesize.h
351 symtab.h : obstack.h symseg.h
352 a.out.encap.h : a.out.gnu.h
353
This page took 0.037434 seconds and 5 git commands to generate.