1 /* This file should be run through the C preprocessor by config.gdb
2 to produce the Makefile. */
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. */
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 */
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). */
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 */
33 /* If you are using the GNU C library, uncomment the following line. */
34 /* HAVE_VPRINTF_DEFINE = -DHAVE_VPRINTF */
36 /* -I. for "#include <obstack.h>". Possibly regex.h also. */
38 /* M_CFLAGS, if defined, has system-dependent CFLAGS. */
39 #if !defined(M_CFLAGS)
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. */
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 */
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
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
88 /* Define SYSV if compiling on a system V or HP machine. */
95 /* MUNCH_DEFINE should be -DSYSV if have System V-style nm,
96 or null if have BSD-style nm. */
100 MUNCH_DEFINE = ${SYSV_DEFINE}
103 /* Flags that describe where you can find the termcap library.
104 You may need to make other arrangements for USG. */
107 /* M_CLIBS, if defined, has system-dependent libs
108 For example, -lPW for System V */
112 CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
114 ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
115 ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
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 \
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
128 PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
129 ns32k-pinsn.c convex-pinsn.c
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
135 OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
136 ns32k-opcode.h convex-opcode.h
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
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 \
153 REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
155 POSSLIBS = obstack.h obstack.c regex.c regex.h malloc.c alloca.c
157 TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
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
163 TAGFILES = ${SFILES} ${DEPFILES} ${PINSNS} ${HFILES} ${OPCODES} ${MFILES} \
165 TARFILES = ${TAGFILES} ${OTHERS} ${REMOTE_EXAMPLES}
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}
173 TSOBS = core.o inflow.o dep.o
175 NTSOBS = standalone.o
177 TSSTART = /lib/crt0.o
179 NTSSTART = kdb-start.o
181 RL_LIB = readline/libreadline.a
183 /* Do some fancy trickery to produce a line like
184 -DM_MAKEDEFINE="-DM_SYSV -DM_BSD_NM".
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
193 ${CC} -c ${CFLAGS} $< */
196 gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
198 ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
199 ${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
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". */
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)"
215 xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
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)
221 /* Old (pre R3) xgdb comp.
222 $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
223 -lXaw -lXt -lX11 $(CLIBS) */
225 kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
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)
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
238 createtags ${TAGFILES}
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
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. */
254 if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; fi
258 rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
260 rm -f gdb core gdb.tar gdb.tar.Z make.log
262 cd readline ; make clean
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
270 rm -f expread.tab.c TAGS
271 rm -f dep.c opcode.h param.h pinsn.c config.status
274 xgdb.o : defs.h param.h symtab.h frame.h
276 /* Make copying.c from COPYING */
277 copying.c : COPYING copying.awk
278 awk -f copying.awk < COPYING > copying.c
280 expread.tab.c : expread.y
281 @echo 'Expect 4 shift/reduce conflict.'
283 mv y.tab.c expread.tab.c
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
289 readline/libreadline.a : force_update
290 cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
291 "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
295 /* Only useful if you are using the gnu malloc routines. */
297 ${CC} -c ${MALLOC_FLAGS} malloc.c
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 \
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 \
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 \
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 \
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 \
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 \
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 \
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 \
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
350 robotussin.h : getpagesize.h
351 symtab.h : obstack.h symseg.h
352 a.out.encap.h : a.out.gnu.h