1 ##Copyright (C) 1989-1991 Free Software Foundation, Inc.
3 # This file is part of GDB.
5 # GDB is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 1, or (at your option)
10 # GDB is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GDB; see the file COPYING. If not, write to
17 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 # Place to install binaries.
22 # System V: If you compile gdb with a compiler which uses the coff
23 # encapsulation feature (this is a function of the compiler used, NOT
24 # of the m-?.h file selected by config.gdb), you must make sure that
25 # the GNU nm is the one that is used by munch.
27 # If you are compiling with GCC, make sure that either 1) You use the
28 # -traditional flag, or 2) You have the fixed include files where GCC
29 # can reach them. Otherwise the ioctl calls in inflow.c and readline.c
30 # will be incorrectly compiled. The "fixincludes" script in the gcc
31 # distribution will fix your include files up.
38 # It is also possible that you will need to add -I/usr/include/sys to the
39 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
40 # is where it should be according to Posix).
47 # Set this up with gcc if you have gnu ld and the loader will print out
48 # line numbers for undefinded refs.
52 # define this to be "gmalloc.o" if you want to use the gnu malloc routine
53 # (useful for debugging memory allocation problems in gdb). To use your
54 # system malloc, uncomment the following two lines.
56 #MALLOC_CFLAGS = -DNO_MALLOC_CHECK
57 GNU_MALLOC
= gmalloc.o mcheck.o mtrace.o
60 # Where is the "include" directory? Traditionally ../include or ./include
61 INCLUDE_DIR
= ${srcdir}/..
/include
62 INCLUDE_DEP
= $$(INCLUDE_DIR
)
64 # Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
65 # (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
66 BFD_DIR
= ${srcdir}/..
/bfd
69 # All the includes used for CFLAGS and for lint.
70 # -I. for config files.
71 # -I${srcdir} possibly for regex.h also.
72 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
$(INCLUDE_DIR
) -I
${srcdir}/vx-share
74 # {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
75 # CFLAGS for both GDB and readline.
76 GLOBAL_CFLAGS
= -g
${TM_CFLAGS} ${XM_CFLAGS}
79 CFLAGS
= ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS}
80 # None of the things in CFLAGS will do any harm, and on some systems
81 # (e.g. SunOS4) it is important to use the M_CFLAGS.
84 # Where is the "-liberty" library, containing getopt and obstack?
85 LIBIBERTY
= ${srcdir}/..
/libiberty
${subdir}/libiberty.a
87 # Flags that describe where you can find the termcap library.
88 # You may need to make other arrangements for USG.
91 # You must define REGEX and REGEX1 on USG machines.
92 # If your sysyem is missing alloca(), or, more likely, it's there but
93 # it doesn't work, define ALLOCA & ALLOCA1
95 # {X,T}M_CLIBS, if defined, has system-dependent libs
96 # For example, -lPW for System V to get alloca().
97 # FIXME STOPGAP FOR BFD LIBRARY: BFD stuff
98 CLIBS
= ${TERMCAP} $(XM_CLIBS
) ${TM_CLIBS} ${BFD_DIR}${subdir}/libbfd.a \
100 CDEPS
= ${XM_CDEPS} ${TM_CDEPS} ${BFD_DIR}/libbfd.a \
103 ADD_FILES
= ${REGEX} ${ALLOCA} ${GNU_MALLOC}
104 ADD_DEPS
= ${REGEX1} ${ALLOCA1} ${GNU_MALLOC}
112 # Source files in the main directory.
113 # Files which are included via a tconfig/* or xconfig/* file
114 # should *not* be specified here; they're in "ALLDEPFILES".
116 blockframe.c breakpoint.c command.c core.c \
117 environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
119 remote.c source.c stack.c symmisc.c symtab.c symfile.c \
120 utils.c valarith.c valops.c valprint.c values.c expread.y \
121 signame.c cplus-dem.c mem-break.c target.c inftarg.c \
122 dbxread.c coffread.c \
125 # Source files in subdirectories (which will be handled separately by
127 # Files which are included via a tconfig/* or xconfig/* file
128 # should *not* be specified here; they're in "ALLDEPFILES".
130 ${srcdir}/vx-share
/dbgRpcLib.h \
131 ${srcdir}/vx-share
/ptrace.h \
132 ${srcdir}/vx-share
/reg.h \
133 ${srcdir}/vx-share
/vxTypes.h \
134 ${srcdir}/vx-share
/vxWorks.h \
135 ${srcdir}/vx-share
/wait.h \
136 ${srcdir}/vx-share
/xdr_ld.h \
137 ${srcdir}/vx-share
/xdr_ptrace.h \
138 ${srcdir}/vx-share
/xdr_rdb.h \
139 ${srcdir}/vx-share
/xdr_regs.h \
140 ${srcdir}/nindy-share
/Makefile \
141 ${srcdir}/nindy-share
/VERSION \
142 ${srcdir}/nindy-share
/b.out.h \
143 ${srcdir}/nindy-share
/block_io.h \
144 ${srcdir}/nindy-share
/coff.h \
145 ${srcdir}/nindy-share
/demux.h \
146 ${srcdir}/nindy-share
/env.h \
147 ${srcdir}/nindy-share
/stop.h \
148 ${srcdir}/nindy-share
/ttycntl.h
150 # All source files that go into linking GDB, except config-specified files.
151 SFILES
= $(SFILES_MAINDIR
) $(SFILES_SUBDIR
)
153 # All source files that lint should look at
154 LINTFILES
= $(SFILES
) expread.tab.c init.c
156 # Any additional files specified on these lines should also be added to
157 # the OTHERS = definition below, so they go in the tar files.
158 SFILES_STAND
= $(SFILES
) standalone.c
159 SFILES_KGDB
= $(SFILES
) stuff.c kdb-start.c
161 # Header files that are not named in tconfig/* or xconfig/* go here.
162 HFILES
= breakpoint.h command.h defs.h environ.h \
163 expression.h frame.h gdbcmd.h gdbcore.h \
164 getpagesize.h ieee-float.h inferior.h param-no-tm.h param.h \
165 signals.h signame.h symfile.h symtab.h \
166 target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
169 OPCODES
= pn-opcode.h np1-opcode.h sparc-opcode.h vax-opcode.h m68k-opcode.h \
170 ns32k-opcode.h convx-opcode.h pyr-opcode.h mips-opcode.h \
173 REMOTE_EXAMPLES
= rem-m68k.
shar rem-multi.
shar
175 MALLOCSRC
= gmalloc.c mcheck.c mtrace.c mtrace.awk \
176 ansidecl.h stdlib.h gmalloc.h stddef.h
178 POSSLIBS_MAINDIR
= regex.c regex.h alloca.c
$(MALLOCSRC
)
179 POSSLIBS
= $(POSSLIBS_MAINDIR
)
181 TESTS
= testbpt.c testfun.c testrec.c testreg.c testregs.c
183 # tdesc-lib cannot be named simply tdesc, because if if it were GNU make
184 # would try to make it from tdesc.c.
185 # tdesc-lib removed from the list due to Motorola copyrights...gnu@cygnus.com
186 OTHERS
= Makefile.
dist depend alldeps.mak Makefile.sdir \
187 createtags munch config.gdb config.status \
188 ChangeLog ChangeLog-3.x \
189 README TODO TAGS WHATS.NEW \
190 gdb.texinfo gdbint.texinfo gdbrc.
tex threecol.
tex \
191 .gdbinit COPYING expread.tab.c stab.def \
192 copying.c Projects Convex.notes copying.awk \
193 saber.suppress standalone.c stuff.c kdb-start.c \
196 DEPFILES
= ${TDEPFILES} ${XDEPFILES}
198 SOURCES
=$(SFILES
) $(ALLDEPFILES
)
199 TAGFILES
= $(SOURCES
) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS}
200 TAGFILES_MAINDIR
= $(SFILES_MAINDIR
) $(ALLDEPFILES_MAINDIR
) \
201 ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR}
202 TARFILES
= ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
204 OBS
= main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
205 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
206 symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
207 command.o utils.o expread.o expprint.o environ.o version.o \
208 copying.o
$(DEPFILES
) signame.o cplus-dem.o mem-break.o target.o \
209 inftarg.o ieee-float.o putenv.o \
210 dbxread.o coffread.o
# mipsread.o
212 RAPP_OBS
= rgdb.o rudp.o rserial.o serial.o udp.o
$(XDEPFILES
)
214 TSOBS
= core.o inflow.o
216 NTSOBS
= standalone.o
218 TSSTART
= /lib
/crt0.o
220 NTSSTART
= kdb-start.o
222 RL_LIB
= readline
/libreadline.a
223 RL_LIB_DEP
= $(RL_LIB
)
225 # Prevent Sun make from putting in the machine type. Setting
226 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
228 ${CC} -c
${CFLAGS} $<
233 cp gdb
$(bindir)/gdb.new
234 mv
$(bindir)/gdb.new
$(bindir)/gdb
237 init.c
: $(srcdir)/munch
$(MUNCH_DEFINE
) $(OBS
) $(TSOBS
)
238 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(TSOBS
) > init.c
240 gdb
: $(OBS
) $(TSOBS
) ${ADD_DEPS} ${RL_LIB_DEP} ${CDEPS} init.o
241 ${CC-LD
} $(LDFLAGS
) -o gdb init.o
$(OBS
) $(TSOBS
) $(ADD_FILES
) \
244 saber_gdb
: $(SFILES
) $(DEPFILES
) copying.c version.c
245 #setopt load_flags $(CFLAGS) -I$(BFD_DIR)
246 #load ./init.c $(SFILES)
247 #unload ${srcdir}/expread.y
248 #load ${srcdir}/expread.tab.c readline/libreadline.a
249 #load copying.c version.c
250 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
251 #load ${BFD_DIR}/libbfd.a -ltermcap
252 ##void mcheck(a) void (*a)(); { }
256 # This is useful when debugging GDB, because some Unix's don't let you run GDB
257 # on itself without copying the executable. So "make gdb1" will make
258 # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
259 # Removing gdb1 before the copy is the right thing if gdb1 is open
260 # in another process.
265 # This is a remote stub which runs under unix and starts up an
266 # inferior process. This is at least useful for debugging GDB's
270 ${srcdir}/munch
${RAPP_OBS} > rapp_init.c
271 ${CC-LD
} $(LDFLAGS
) -o
$@ rapp_init.c
$(RAPP_OBS
)
273 Makefiles
= Makefile.sdir
$(M_MAKEFILE
) \
274 ${srcdir}/alldeps.mak
${srcdir}/Makefile.
dist
276 MAKE_MAKEFILE
= echo
"M_MAKEFILE=$(M_MAKEFILE)" | \
277 cat
- ${Makefiles} ${srcdir}/depend
>Makefile
279 Makefile
: $(Makefiles
)
282 alldeps.mak
: ${srcdir}/tconfig
${srcdir}/xconfig
283 rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
284 for i in
`ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
285 ${srcdir}/xconfig/*[0-9A-Za-z] | grep -v RCS` ; do \
286 echo
$$i >>allconfig.tmp
; \
288 $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
289 for (i = 2; i <= NF; i++) \
290 print $$i >> "alldeps.tmp" ; \
292 $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
293 print $$2 >> "allparam.tmp" }' ; \
295 sort <alldeps.tmp | uniq | \
296 sed
-e
's/arm-convert.o/arm-convert.s/' \
297 -e
's!^Onindy.o!nindy-share/Onindy.c!' \
298 -e
's!^nindy.o!nindy-share/nindy.c!' \
299 -e
's!ttybreak.o!nindy-share/ttybreak.c!' \
300 -e
's!ttyflush.o!nindy-share/ttyflush.c!' \
301 -e
's!xdr_ld.o!vx-share/xdr_ld.c!' \
302 -e
's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
303 -e
's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
304 -e
's!xdr_regs.o!vx-share/xdr_regs.c!' \
307 echo
'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
309 grep
-v
/ alldeps2.tmp | \
310 awk
'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
311 NR == 0 {printf $$0;} \
312 NR != 0 {printf "\\\n" $$0} \
313 END {printf "\n\n"}' >>alldeps.mak
;
314 grep
/ alldeps2.tmp | \
315 awk
'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
316 NR == 0 {printf $$0;} \
317 NR != 0 {printf "\\\n" $$0} \
318 END {printf "\n\n"}' >>alldeps.mak
;
319 sort <allparam.tmp | uniq | awk
'BEGIN {printf "ALLPARAM="} \
320 NR == 0 {printf $$0;} \
321 NR != 0 {printf "\\\n" $$0} \
322 END {printf "\n\n"}' >>alldeps.mak
;
323 sort <allconfig.tmp | uniq | awk
'BEGIN {printf "ALLCONFIG="} \
324 NR == 0 {printf $$0;} \
325 NR != 0 {printf "\\\n" $$0} \
326 END {printf "\n\n"}' >>alldeps.mak
;
327 rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
329 # The sed script makes everything which depends on {x,t}m.h depend on
330 # config.status as well, in case someone reconfigures gdb out from
331 # under an already compiled gdb.
332 depend
: $(SOURCES
) Makefile.
dist
333 @echo Ignore errors about non-existent system-supplied
include files
334 @echo for systems other than the one you are using.
335 @echo
"If xm.h and tm.h don't exist, the error messages saying so"
336 @echo can safely be ignored.
337 @echo Also ignore parse errors in valops.c
, and any errors in
339 -$(GCC
) -MM
$(CFLAGS
) -I
$(BFD_DIR
) \
340 `ls $(SOURCES) | sort -u` >depend.tmp
341 <depend.tmp sed
-e
's/ [xt]m.h/& config.status/g' \
342 -e
's; vx-share/; $${srcdir}/vx-share/;g' \
343 -e
's; nindy-share/; $${srcdir}/nindy-share/;g' \
344 -e
's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
345 -e
's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
346 -e
's; \./; $${srcdir}/;g' \
352 @echo
"You must configure gdb. Look at the README file for details."
355 # These are not generated by "make depend" because they only are there
357 # But these rules don't do what we want; we want to hack the foo.o: tm.h
358 # dependency to do the right thing.
359 tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h
: tm-68k.h
360 tm-hp300hpux.h tm-sun2.h tm-3b1.h
: tm-68k.h
361 xm-news1000.h
: xm-news.h
362 xm-i386-sv32.h
: xm-i386.h
363 tm-i386gas.h
: tm-i386.h
364 xm-sun4os4.h
: xm-sparc.h
365 tm-sun4os4.h
: tm-sparc.h
367 kdb
: $(NTSSTART
) $(OBS
) $(NTSOBS
) ${ADD_DEPS} ${RL_LIB_DEP}
369 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(NTSOBS
) > init.c
370 $(CC
) $(LDFLAGS
) -c init.c
$(CLIBS
)
371 ld -o kdb
$(NTSSTART
) $(OBS
) $(NTSOBS
) init.o
$(ADD_FILES
) \
372 ${RL_LIB} -lc
$(CLIBS
)
374 # Put the proper machine-specific files first.
375 # createtags will edit the .o in DEPFILES into .c
377 $(srcdir)/createtags
$(TM_FILE
) ${XM_FILE} $(DEPFILES
) ${TAGFILES}
380 # FIXME: Get alldeps.mak up to date, config.gdb none, THEN make gdb.tar.Z!
381 gdb.
tar.Z
: ${TARFILES}
382 rm -f gdb.
tar; rm -rf
$(DIST
)
383 cd readline
; make readline.
tar
385 cd
$(DIST
) ; for i in
${TARFILES} ; do ln
-s ..
/$$i .
; done
386 mkdir
$(DIST
)/readline
387 cd
$(DIST
)/readline
; tar xf ..
/..
/readline
/readline.
tar
388 mkdir
$(DIST
)/xconfig
${DIST}/tconfig
389 cd
$(DIST
)/tconfig
; \
390 for i in
$(ALLCONFIG
) ; do ln
-s ..
/..
/$$i ..
/$$i ; done
391 mkdir
$(DIST
)/vx-share
$(DIST
)/nindy-share
392 cd
$(DIST
)/tconfig
; \
393 for i in
$(SFILES_SUBDIR
) $(ALLDEPFILES_SUBDIR
); \
394 do ln
-s ..
/..
/$$i ..
/$$i ; done
395 tar chf
- $(DIST
) | compress
>gdb.
tar.Z
399 rm -f
${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES}
400 rm -f init.c init.o version.c
401 rm -f gdb core gdb.
tar gdb.
tar.Z make.log
403 cd readline
; make
clean
405 distclean: clean expread.tab.c TAGS
406 rm -f tm.h xm.h config.status
407 rm -f y.output
yacc.acts
yacc.tmp
408 rm -f
${TESTS} Makefile
411 rm -f expread.tab.c TAGS
412 rm -f tm.h xm.h config.status
415 gdb.
dvi : gdb.texinfo
420 # Make copying.c from COPYING
421 copying.c
: COPYING copying.awk
422 awk
-f copying.awk
< COPYING
> copying.c
424 version.c
: Makefile.
dist
425 echo
'char *version = "$(VERSION)";' >version.c
427 ${srcdir}/expread.tab.c
: $(srcdir)/expread.y
428 @echo
'Expect 4 shift/reduce conflict.'
429 ${YACC} $(srcdir)/expread.y
430 mv y.tab.c
${srcdir}/expread.tab.c
432 expread.o
: ${srcdir}/expread.tab.c defs.h param.h symtab.h \
434 $(CC
) -c
${CFLAGS} `echo ${srcdir}/expread.tab.c | sed 's,^\./,,'`
435 mv expread.tab.o expread.o
437 # dbxread, coffread, mipsread have dependencies on BFD header files.
438 dbxread.o
: ${srcdir}/dbxread.c
439 ${CC} -c
${CFLAGS} -I
$(BFD_DIR
) ${srcdir}/dbxread.c
441 coffread.o
: ${srcdir}/coffread.c
442 ${CC} -c
${CFLAGS} -I
$(BFD_DIR
) ${srcdir}/coffread.c
444 mipsread.o
: ${srcdir}/mipsread.c
445 ${CC} -c
${CFLAGS} -I
$(BFD_DIR
) ${srcdir}/mipsread.c
447 # Drag in the files that are in another directory.
449 xdr_ld.o
: ${srcdir}/vx-share
/xdr_ld.c
450 ${CC} -c
${CFLAGS} ${srcdir}/vx-share
/xdr_ld.c
452 xdr_ptrace.o
: ${srcdir}/vx-share
/xdr_ptrace.c
453 ${CC} -c
${CFLAGS} ${srcdir}/vx-share
/xdr_ptrace.c
455 xdr_rdb.o
: ${srcdir}/vx-share
/xdr_rdb.c
456 ${CC} -c
${CFLAGS} ${srcdir}/vx-share
/xdr_rdb.c
458 xdr_regs.o
: ${srcdir}/vx-share
/xdr_regs.c
459 ${CC} -c
${CFLAGS} ${srcdir}/vx-share
/xdr_regs.c
461 nindy.o
: ${srcdir}/nindy-share
/nindy.c
462 ${CC} -c
${CFLAGS} ${srcdir}/nindy-share
/nindy.c
464 Onindy.o
: ${srcdir}/nindy-share
/Onindy.c
465 ${CC} -c
${CFLAGS} ${srcdir}/nindy-share
/Onindy.c
467 ttybreak.o
: ${srcdir}/nindy-share
/ttybreak.c
468 ${CC} -c
${CFLAGS} ${srcdir}/nindy-share
/ttybreak.c
470 ttyflush.o
: ${srcdir}/nindy-share
/ttyflush.c
471 ${CC} -c
${CFLAGS} ${srcdir}/nindy-share
/ttyflush.c
473 tdesc-lib
/libdc.o
: force_update
474 cd tdesc-lib
; ${MAKE} "SYSV_DEFINE=${SYSV_DEFINE}"
476 # In LOCAL_INCLUDES, -I${srcdir} is right if srcdir is an absolute path,
477 # and -I../${srcdir} is right if it is relative (e.g. ".."), so search both.
478 readline
/libreadline.a
: force_update
479 cd readline
; ${MAKE} "SYSV=${SYSV_DEFINE}"\
480 "VPATH=${srcdir}/readline:../${srcdir}/readline"\
481 "LOCAL_INCLUDES=-I../ -I${srcdir}/ -I../${srcdir}/"\
482 "DEBUG_FLAGS=${GLOBAL_CFLAGS}" "CC=${CC}" libreadline.a
485 $(LINT
) $(INCLUDE_CFLAGS
) $(LINTFLAGS
) $(LINTFILES
)
488 cxref
-I.
$(SFILES
) >gdb.cxref
492 # When used with GDB, the demangler should never look for leading
493 # underscores because GDB strips them off during symbol read-in. Thus
496 cplus-dem.o
: cplus-dem.c
497 ${CC} -c
${CFLAGS} -Dnounderscore \
498 `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`