1 /* This file should be run through the C preprocessor by config.gdb
2 to produce the Makefile. */
4 /* Define this to xgdb if you want to compile xgdb as well as gdb. */
6 /* Place to install binaries. */
8 /* Place to install X binaries. */
11 /* System V: If you compile gdb with a compiler which uses the coff
12 encapsulation feature (this is a function of the compiler used, NOT
13 of the m-?.h file selected by config.gdb), you must make sure that
14 the GNU nm is the one that is used by munch. */
16 /* If you are compiling with GCC, make sure that either 1) You use the
17 -traditional flag, or 2) You have the fixed include files where GCC
18 can reach them. Otherwise the ioctl calls in inflow.c and readline.c
19 will be incorrectly compiled. The "fixincludes" script in the gcc
20 distribution will fix your include files up. */
21 /* CC=gcc -traditional */
24 /* It is also possible that you will need to add -I/usr/include/sys to the
25 CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
26 is where it should be according to Posix). */
33 /* Set this up with gcc if you have gnu ld and the loader will print out
34 line numbers for undefinded refs. */
35 /* CC-LD=gcc -static */
38 /* If you are using the GNU C library, uncomment the following line. */
39 /* HAVE_VPRINTF_DEFINE = -DHAVE_VPRINTF */
41 /* -I. for "#include <obstack.h>". Possibly regex.h also. */
43 /* M_CFLAGS, if defined, has system-dependent CFLAGS. */
44 #if !defined(M_CFLAGS)
48 /* CFLAGS for both GDB and readline. */
49 GLOBAL_CFLAGS = -g M_CFLAGS
50 CFLAGS = -I. ${HAVE_VPRINTF_DEFINE} ${GLOBAL_CFLAGS}
51 /* None of the things in CFLAGS will do any harm, and on some systems
52 (e.g. SunOS4) it is important to use the M_CFLAGS. */
56 define this to be "obstack.o" if you don't have the obstack library installed
57 you must at the same time define OBSTACK1 as "obstack.o"
58 so that the dependencies work right. Similarly with REGEX and "regex.o".
59 You must define REGEX and REGEX1 on USG machines.
60 If your sysyem is missing alloca(), or, more likely, it's there but
61 it doesn't work, define ALLOCA & ALLOCA1 */
82 define this to be "malloc.o" if you want to use the gnu malloc routine
83 (useful for debugging memory allocation problems in gdb). Otherwise, leave
88 /* Flags to be used in compiling malloc.o
89 Specify range checking for storage allocation. */
90 /* MALLOC_FLAGS = ${CFLAGS} */
91 MALLOC_FLAGS = ${CFLAGS} -Drcheck -Dbotch=fatal_dump_core -DMSTATS
93 /* Define SYSV if compiling on a system V or HP machine. */
100 /* MUNCH_DEFINE should be -DSYSV if have System V-style nm,
101 or null if have BSD-style nm. */
105 MUNCH_DEFINE = ${SYSV_DEFINE}
108 /* Flags that describe where you can find the termcap library.
109 You may need to make other arrangements for USG. */
112 /* M_CLIBS, if defined, has system-dependent libs
113 For example, -lPW for System V to get alloca(). */
117 CLIBS = ${ADD_FILES} ${TERMCAP} M_CLIBS
119 ADD_FILES = ${OBSTACK} ${REGEX} ${ALLOCA} ${GNU_MALLOC}
120 ADD_DEPS = ${OBSTACK1} ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
122 SFILES = blockframe.c breakpoint.c dbxread.c coffread.c command.c core.c \
123 environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
124 kdb-start.c main.c printcmd.c \
125 remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
126 utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
129 DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
130 sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
131 symmetry-dep.c convex-dep.c altos-dep.c isi-dep.c pyr-dep.c
133 PINSNS = gld-pinsn.c i386-pinsn.c sparc-pinsn.c vax-pinsn.c m68k-pinsn.c \
134 ns32k-pinsn.c convex-pinsn.c pyr-pinsn.c
136 HFILES = command.h defs.h environ.h expression.h frame.h getpagesize.h \
137 inferior.h symseg.h symtab.h value.h wait.h \
138 a.out.encap.h a.out.gnu.h stab.gnu.h
140 OPCODES = m68k-opcode.h pn-opcode.h sparc-opcode.h npl-opcode.h vax-opcode.h \
141 ns32k-opcode.h convex-opcode.h pyr-opcode.h
143 MFILES = m-hp9k320.h m-hp300bsd.h m-i386.h m-i386gas.h \
144 m-i386-sv32.h m-i386g-sv32.h m-isi.h m-merlin.h \
145 m-altos.h m-news.h m-newsos3.h m-npl.h m-pn.h \
146 m-sparc.h m-sun2.h m-sun3.h m-sun2os4.h \
147 m-sun3os4.h m-sun4os4.h m-umax.h m-vax.h m-symmetry.h m-convex.h \
150 /* This list of files really shouldn't be in this makefile, but I can't think
151 of any good way to get the readline makefile to tell us what files
152 to put in our tarfile. */
153 READLINE = readline.c history.c funmap.c \
154 emacs_keymap.c vi_keymap.c vi_mode.c keymaps.c \
155 readline.h history.h keymaps.h chardefs.h \
156 inc-readline.texinfo inc-history.texinfo \
157 readline.texinfo history.texinfo \
160 REMOTE_EXAMPLES = remote-sa.m68k.shar remote-multi.shar
162 POSSLIBS = obstack.h obstack.c regex.c regex.h malloc.c alloca.c
164 TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
166 OTHERS = Makefile.dist createtags munch config.gdb ChangeLog README TAGS \
167 gdb.texinfo .gdbinit COPYING expread.tab.c stab.def \
168 XGDB-README copying.c Projects Convex.notes copying.awk hp-include
170 TAGFILES = ${SFILES} ${DEPFILES} ${PINSNS} ${HFILES} ${OPCODES} ${MFILES} \
172 TARFILES = ${TAGFILES} ${OTHERS} ${REMOTE_EXAMPLES}
174 OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
175 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
176 symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
177 command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
178 copying.o ${READLINEOBS}
180 TSOBS = core.o inflow.o dep.o
182 NTSOBS = standalone.o
184 TSSTART = /lib/crt0.o
186 NTSSTART = kdb-start.o
188 RL_LIB = readline/libreadline.a
190 /* Do some fancy trickery to produce a line like
191 -DM_MAKEDEFINE="-DM_SYSV -DM_BSD_NM".
195 /* Avoid funny things that Sun's make throws in for us. */
196 /* TARGET_ARCH is supposed to get around it putting in the machine type.
197 If the "things" up there really is plural, we'll need to do something
200 ${CC} -c ${CFLAGS} $< */
206 cp gdb $(bindir)/gdb.new
207 mv $(bindir)/gdb.new $(bindir)/gdb
208 -if [ "$(XGDB)" = xgdb ]; then \
209 cp xgdb $(xbindir)/xgdb.new; \
210 mv $(xbindir)/xgdb.new $(xbindir)xgdb; \
213 gdb : $(OBS) $(TSOBS) ${ADD_DEPS} ${RL_LIB}
215 ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
216 ${CC-LD} $(LDFLAGS) -o gdb init.c $(OBS) $(TSOBS) ${RL_LIB} $(CLIBS)
218 /* This is useful when debugging GDB, because Unix doesn't let you run GDB
219 on itself without copying the executable. So "make gdb1" will make
220 gdb and put a copy in gdb1, and you can run it with "gdb gdb1". */
224 Makefile : Makefile.dist
225 cp Makefile.dist tmp.c
226 $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=$(MD)"
228 /* This did not work-- -Usparc became "-Usparc" became "-Usparc.
229 Or something like that. */
230 /* $(CC) -E >Makefile tmp.c $(MD) "-DM_MAKEDEFINE=\"$(MD)\"" */
232 xgdb : $(OBS) $(TSOBS) xgdb.o ${ADD_DEPS} ${RL_LIB}
234 ./munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) xgdb.o > init.c
235 $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
236 -lXaw -lXmu -lXt -lX11 ${RL_LIB} $(CLIBS)
238 /* Old (pre R3) xgdb comp.
239 $(CC-LD) $(LDFLAGS) -o xgdb init.c $(OBS) $(TSOBS) xgdb.o \
240 -lXaw -lXt -lX11 $(CLIBS) */
242 kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${RL_LIB}
244 ./munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
245 $(CC) $(LDFLAGS) -c init.c $(CLIBS)
246 ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o ${RL_LIB} -lc $(CLIBS)
248 /* If it can figure out the appropriate order, createtags will make sure
249 that the proper m-*, *-dep, *-pinsn, and *-opcode files come first
250 in the tags list. It will attempt to do the same for dbxread.c and
251 coffread.c. This makes using M-. on machine dependent routines much
255 createtags ${TAGFILES}
261 cd dist-gdb ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
262 mkdir dist-gdb/readline
263 cd dist-gdb/readline ; for i in ${READLINE} ; do ln -s ../../readline/$$i . ; done
264 tar chf gdb.tar dist-gdb
267 /* Remove gdb.tar.Z so stupid compress doesn't ask whether we want to
268 overwrite it. compress -f is not what we want, because we do want
269 to know if compress would not make it smaller. */
271 if [ -f gdb.tar.Z ]; then rm -f gdb.tar.Z; else true; fi
275 rm -f ${OBS} ${TSOBS} ${NTSOBS} ${OBSTACK} ${REGEX} ${GNU_MALLOC}
278 rm -f gdb core gdb.tar gdb.tar.Z make.log
280 cd readline ; make clean
282 distclean: clean expread.tab.c TAGS
283 rm -f dep.c opcode.h param.h pinsn.c config.status
284 rm -f y.output yacc.acts yacc.tmp
285 rm -f ${TESTS} Makefile
288 rm -f expread.tab.c TAGS
289 rm -f dep.c opcode.h param.h pinsn.c config.status
292 xgdb.o : defs.h param.h symtab.h frame.h
294 /* Make copying.c from COPYING */
295 copying.c : COPYING copying.awk
296 awk -f copying.awk < COPYING > copying.c
298 expread.tab.c : expread.y
299 @echo 'Expect 4 shift/reduce conflict.'
301 mv y.tab.c expread.tab.c
303 expread.o : expread.tab.c defs.h param.h symtab.h frame.h expression.h
304 $(CC) -c ${CFLAGS} expread.tab.c
305 mv expread.tab.o expread.o
307 readline/libreadline.a : force_update
308 cd readline ; ${MAKE} "SYSV=${SYSV_DEFINE}" \
309 "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
313 /* Only useful if you are using the gnu malloc routines. */
315 ${CC} -c ${MALLOC_FLAGS} malloc.c
317 /* dep.o depends on config.status in case someone reconfigures gdb out
318 from under an already compiled gdb. */
319 dep.o : dep.c config.status defs.h param.h frame.h inferior.h obstack.h \
322 /* pinsn.o depends on config.status in case someone reconfigures gdb out
323 from under an already compiled gdb. */
324 pinsn.o : pinsn.c config.status defs.h param.h symtab.h obstack.h symseg.h \
327 /* The rest of this is a standard dependencies list (hand edited output of
328 cpp -M). It does not include dependencies of .o files on .c files. */
329 /* All files which depend on config.status also depend on param.h in case
330 someone reconfigures gdb out from under an already compiled gdb. */
331 blockframe.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
332 breakpoint.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
333 coffread.o : defs.h param.h config.status
334 command.o : command.h defs.h
335 core.o : defs.h param.h config.status a.out.encap.h
336 dbxread.o : param.h config.status defs.h symtab.h obstack.h symseg.h a.out.encap.h \
338 environ.o : environ.h
339 eval.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
340 expprint.o : defs.h symtab.h obstack.h symseg.h param.h config.status expression.h
341 findvar.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h value.h
342 infcmd.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
344 inflow.o : defs.h param.h config.status frame.h inferior.h
345 infrun.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h inferior.h \
347 kdb-start.o : defs.h param.h config.status
348 main.o : defs.h command.h param.h config.status
349 malloc.o : getpagesize.h
350 obstack.o : obstack.h
351 printcmd.o : defs.h param.h config.status frame.h symtab.h obstack.h symseg.h value.h \
354 remote.o : defs.h param.h config.status frame.h inferior.h wait.h
355 source.o : defs.h symtab.h obstack.h symseg.h param.h config.status
356 stack.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h
357 standalone.o : defs.h param.h config.status symtab.h obstack.h symseg.h frame.h \
359 symmisc.o : defs.h symtab.h obstack.h symseg.h obstack.h
360 symtab.o : defs.h symtab.h obstack.h symseg.h param.h config.status obstack.h
361 utils.o : defs.h param.h config.status
362 valarith.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h expression.h
363 valops.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h frame.h \
365 valprint.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
366 values.o : defs.h param.h config.status symtab.h obstack.h symseg.h value.h
368 robotussin.h : getpagesize.h
369 symtab.h : obstack.h symseg.h
370 a.out.encap.h : a.out.gnu.h