1 #Copyright 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
3 # This file is part of GDB.
5 # This program 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 2 of the License, or
8 # (at your option) any later version.
10 # This program 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 this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 program_transform_name
=
22 exec_prefix = $(prefix)
23 bindir = $(exec_prefix)/bin
24 libdir = $(exec_prefix)/lib
25 tooldir
= $(libdir)/$(target_alias
)
27 datadir = $(prefix)/lib
28 mandir = $(prefix)/man
29 man1dir = $(mandir)/man1
30 man2dir = $(mandir)/man2
31 man3dir = $(mandir)/man3
32 man4dir = $(mandir)/man4
33 man5dir = $(mandir)/man5
34 man6dir = $(mandir)/man6
35 man7dir = $(mandir)/man7
36 man8dir = $(mandir)/man8
37 man9dir = $(mandir)/man9
38 infodir = $(prefix)/info
39 includedir = $(prefix)/include
40 docdir
= $(datadir)/doc
45 INSTALL_PROGRAM
= $(INSTALL
)
46 INSTALL_DATA
= $(INSTALL
)
52 # Flags that describe where you can find the termcap library.
53 # This can be overridden in the host Makefile fragment file.
56 # System V: If you compile gdb with a compiler which uses the coff
57 # encapsulation feature (this is a function of the compiler used, NOT
58 # of the m-?.h file selected by config.gdb), you must make sure that
59 # the GNU nm is the one that is used by munch.
61 # If you are compiling with GCC, make sure that either 1) You use the
62 # -traditional flag, or 2) You have the fixed include files where GCC
63 # can reach them. Otherwise the ioctl calls in inflow.c
64 # will be incorrectly compiled. The "fixincludes" script in the gcc
65 # distribution will fix your include files up.
70 # Directory containing source files. Don't clean up the spacing,
71 # this exact string is matched for by the "configure" script.
74 # It is also possible that you will need to add -I/usr/include/sys to the
75 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
76 # is where it should be according to Posix).
78 # If you use bison instead of yacc, it needs to include the "-y" argument.
83 # where to find texinfo; GDB dist should include a recent one
84 TEXIDIR
=${srcdir}/..
/texinfo
86 # where to find makeinfo, preferably one designed for texinfo-2
89 # Set this up with gcc if you have gnu ld and the loader will print out
90 # line numbers for undefinded refs.
94 # Where is the "include" directory? Traditionally ../include or ./include
95 INCLUDE_DIR
= ${srcdir}/..
/include
96 INCLUDE_DEP
= $$(INCLUDE_DIR
)
98 # Where is the source dir for the MMALLOC library? Traditionally ../mmalloc
99 # or ./mmalloc (When we want the binary library built from it, we use
100 # ${MMALLOC_DIR}${subdir}.)
101 # Note that mmalloc can still be used on systems without mmap().
102 # To use your system malloc, comment out the following defines.
103 MMALLOC_DIR
= ${srcdir}/..
/mmalloc
104 MMALLOC_DEP
= $$(MMALLOC_DIR
)
105 MMALLOC_LIB
= .
/..
/mmalloc
${subdir}/libmmalloc.a
106 # To use your system malloc, uncomment MMALLOC_DISABLE.
107 #MMALLOC_DISABLE = -DNO_MMALLOC
108 # To use mmalloc but disable corruption checking, uncomment MMALLOC_CHECK
109 #MMALLOC_CHECK = -DNO_MMALLOC_CHECK
110 MMALLOC_CFLAGS
= ${MMALLOC_CHECK} ${MMALLOC_DISABLE}
112 # Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
113 # (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
114 BFD_DIR
= ${srcdir}/..
/bfd
115 BFD_DEP
= $$(BFD_DIR
)
116 BFD_LIB
= .
/..
/bfd
${subdir}/libbfd.a
118 # Where is the source dir for the READLINE library? Traditionally in .. or .
119 # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
120 READLINE_DIR
= ${srcdir}/..
/readline
121 READLINE_DEP
= $$(READLINE_DIR
)
122 RL_LIB
= .
/..
/readline
${subdir}/libreadline.a
124 # All the includes used for CFLAGS and for lint.
125 # -I. for config files.
126 # -I${srcdir} possibly for regex.h also.
127 # -I${srcdir}/config for more generic config files.
128 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
${srcdir}/config
-I
$(INCLUDE_DIR
)
130 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
131 # from the config/ directory.
132 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
133 #PROFILE_CFLAGS = -pg
135 # CFLAGS is specifically reserved for setting from the command line
136 # when running make. I.E. "make USER_CFLAGS=-Wmissing-prototypes".
138 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
139 INTERNAL_CFLAGS
= ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MMALLOC_CFLAGS} ${INCLUDE_CFLAGS} ${USER_CFLAGS}
140 # None of the things in CFLAGS will do any harm, and on some systems
141 # (e.g. SunOS4) it is important to use the MH_CFLAGS.
144 # Where is the "-liberty" library, containing getopt and obstack?
145 LIBIBERTY_DIR
= ${srcdir}/..
/libiberty
146 LIBIBERTY
= .
/..
/libiberty
${subdir}/libiberty.a
148 # Where is the "-lopcodes" library, with (some of) the opcode tables and
150 OPCODES
= .
/..
/opcodes
${subdir}/libopcodes.a
152 # The config/mh-* file must define REGEX and REGEX1 on USG machines.
153 # If your system is missing alloca(), or, more likely, it's there but
154 # it doesn't work, define ALLOCA & ALLOCA1 too.
156 # Libraries and corresponding dependencies for compiling gdb.
157 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
158 # TERMCAP comes after readline, since readline depends on it.
159 # If you have the Cygnus libraries installed,
160 # you can use 'CLIBS=${INSTALLED_LIBS}' 'CDEPS='
161 INSTALLED_LIBS
=-lbfd
-lreadline
${TERMCAP} -lopcodes
-lmmalloc \
162 -liberty
${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
163 CLIBS
= ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} \
164 ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
165 CDEPS
= ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
166 ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY}
168 ADD_FILES
= ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES} \
170 ADD_DEPS
= ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
177 LINTFLAGS
= -I
${BFD_DIR}
182 # Host and target-dependent makefile fragments come in here.
184 # End of host and target-dependent makefile fragments
188 "exec_prefix=$(exec_prefix)" \
189 "against=$(against)" \
191 "AR_FLAGS=$(AR_FLAGS)" \
194 "CHILLFLAGS=$(CHILLFLAGS)" \
196 "CHILL_LIB=$(CHILL_LIB)" \
198 "CXXFLAGS=$(CXXFLAGS)" \
200 "MAKEINFO=$(MAKEINFO)" \
201 "INSTALL=$(INSTALL)" \
202 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
203 "INSTALL_DATA=$(INSTALL_DATA)" \
204 "RUNTEST=$(RUNTEST)" \
205 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
208 # Flags that we pass when building the testsuite.
211 if [ -f $${rootme}/../gcc/Makefile ] ; then \
212 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
214 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
217 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
224 if [ -f $${rootme}/../gcc/Makefile ] ; then \
225 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
227 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
230 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
234 CHILLFLAGS
= $(CFLAGS
)
236 CHILL_FOR_TARGET
= ` \
237 if [ -f $${rootme}/../gcc/Makefile ] ; then \
238 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../chillrt/; \
240 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
243 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
248 # The use of $$(x_FOR_TARGET) reduces the command line length by not
249 # duplicating the lengthy definition.
250 TARGET_FLAGS_TO_PASS
= \
252 "exec_prefix=$(exec_prefix)" \
253 "against=$(against)" \
254 'CC=$$(CC_FOR_TARGET)' \
255 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
257 "CHILLFLAGS=$(CHILLFLAGS)" \
258 'CHILL=$$(CHILL_FOR_TARGET)' \
259 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
260 "CHILL_LIB=$(CHILL_LIB)" \
261 'CXX=$$(CXX_FOR_TARGET)' \
262 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
263 "CXXFLAGS=$(CXXFLAGS)" \
264 "MAKEINFO=$(MAKEINFO)" \
265 "INSTALL=$(INSTALL)" \
266 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
267 "INSTALL_DATA=$(INSTALL_DATA)" \
268 "RUNTEST=$(RUNTEST)" \
269 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
272 # All source files that go into linking GDB.
273 # Source files which are included via a config/*/* Makefile fragment should
274 # *not* be specified here; they're in "ALLDEPFILES".
275 # Neither should links made at configuration time be specified here, since
276 # SFILES is used in building the distribution archive.
278 SFILES
= ${srcdir}/blockframe.c
${srcdir}/breakpoint.c
${srcdir}/buildsym.c \
279 ${srcdir}/c-exp.y
${srcdir}/c-lang.c
${srcdir}/c-typeprint.c \
280 ${srcdir}/c-valprint.c
${srcdir}/ch-exp.y
${srcdir}/ch-lang.c \
281 ${srcdir}/ch-typeprint.c
${srcdir}/ch-valprint.c
${srcdir}/coffread.c \
282 ${srcdir}/command.c
${srcdir}/complaints.c
${srcdir}/core.c \
283 ${srcdir}/cp-valprint.c
${srcdir}/dbxread.c
${srcdir}/demangle.c \
284 ${srcdir}/dwarfread.c
${srcdir}/elfread.c
${srcdir}/environ.c \
285 ${srcdir}/eval.c
${srcdir}/expprint.c
${srcdir}/findvar.c \
286 ${srcdir}/gdbtypes.c \
287 ${srcdir}/infcmd.c
${srcdir}/inflow.c
${srcdir}/infrun.c \
288 ${srcdir}/language.c
${srcdir}/putenv.c
${srcdir}/m2-exp.y \
289 ${srcdir}/m2-lang.c
${srcdir}/m2-typeprint.c \
290 ${srcdir}/m2-valprint.c
${srcdir}/main.c
${srcdir}/maint.c \
291 ${srcdir}/mem-break.c
${srcdir}/minsyms.c
${srcdir}/mipsread.c \
292 ${srcdir}/objfiles.c
${srcdir}/parse.c
${srcdir}/printcmd.c \
293 ${srcdir}/remote.c
${srcdir}/source.c
${srcdir}/stabsread.c \
295 ${srcdir}/symfile.c
${srcdir}/symmisc.c
${srcdir}/symtab.c \
296 ${srcdir}/target.c
${srcdir}/typeprint.c
${srcdir}/utils.c \
297 ${srcdir}/valarith.c \
298 ${srcdir}/valops.c
${srcdir}/valprint.c
${srcdir}/values.c \
299 ${srcdir}/serial.c
${srcdir}/ser-go32.c
${srcdir}/ser-unix.c
301 # Files that are not source code, but need to go into gdb-$(VERSION).tar.Z.
302 NONSRC
= ${srcdir}/Makefile.in
${srcdir}/depend
${srcdir}/alldeps.mak \
303 ${srcdir}/munch
${srcdir}/configure.in \
304 ${srcdir}/ChangeLog
${srcdir}/ChangeLog-9091
${srcdir}/ChangeLog-92 \
305 ${srcdir}/ChangeLog-3.x \
306 ${srcdir}/gdb
.1 ${srcdir}/refcard.ps
${srcdir}/README
${srcdir}/TODO \
307 TAGS
${srcdir}/NEWS
${srcdir}/Projects
${srcdir}/.gdbinit \
308 ${srcdir}/COPYING
$(YYFILES
) ${srcdir}/copying.c \
309 ${srcdir}/copying.awk \
310 ${srcdir}/saber.suppress
${srcdir}/standalone.c
${srcdir}/stuff.c \
311 ${srcdir}/kdb-start.c
${srcdir}/gcc.patch \
312 ${srcdir}/nindy-share
/Makefile
${srcdir}/nindy-share
/VERSION \
313 ${srcdir}/nindy-share
/README
${srcdir}/vx-share
/README \
314 ${srcdir}/29k-share
/README \
315 ${srcdir}/config
/convex
/Convex.notes
317 # All source files that lint should look at
318 LINTFILES
= $(SFILES
) $(YYFILES
) init.c
320 # Any additional files specified on these lines should also be added to
321 # the NONSRC definition, so they go in the tar files.
322 SFILES_STAND
= $(SFILES
) standalone.c
323 SFILES_KGDB
= $(SFILES
) stuff.c kdb-start.c
325 # Header files that are not named in config/*/* Makefile fragments go here.
326 HFILES
= ${srcdir}/breakpoint.h
${srcdir}/buildsym.h
${srcdir}/call-cmds.h \
327 ${srcdir}/command.h
${srcdir}/defs.h
${srcdir}/environ.h \
328 ${srcdir}/expression.h
${srcdir}/frame.h
${srcdir}/gdbcmd.h \
329 ${srcdir}/gdbcore.h
${srcdir}/gdbtypes.h
${srcdir}/gdb-stabs.h \
330 ${srcdir}/inferior.h
${srcdir}/language.h
${srcdir}/minimon.h \
331 ${srcdir}/objfiles.h
${srcdir}/parser-defs.h \
332 ${srcdir}/partial-stab.h
${srcdir}/serial.h
${srcdir}/signals.h \
333 ${srcdir}/solib.h
${srcdir}/symfile.h
${srcdir}/symtab.h \
334 ${srcdir}/stabsread.h
${srcdir}/target.h
${srcdir}/terminal.h \
335 ${srcdir}/typeprint.h
${srcdir}/xcoffsolib.h
${srcdir}/value.h \
336 ${srcdir}/c-lang.h
${srcdir}/ch-lang.h
${srcdir}/m2-lang.h \
337 ${srcdir}/complaints.h
${srcdir}/ns32k-opcode.h
${srcdir}/valprint.h \
338 ${srcdir}/config
/m68k
/tm-m68k.h
${srcdir}/config
/pa
/tm-hppa.h \
339 ${srcdir}/config
/i960
/tm-i960.h
${srcdir}/config
/sparc
/tm-sparc.h \
340 ${srcdir}/config
/tm-sunos.h \
341 ${srcdir}/config
/tm-sysv4.h
${srcdir}/config
/m68k
/xm-m68k.h \
342 ${srcdir}/config
/sparc
/xm-sparc.h \
343 ${srcdir}/config
/xm-sysv4.h
${srcdir}/config
/vax
/xm-vax.h \
344 ${srcdir}/config
/nm-trash.h
${srcdir}/29k-share
/udi
/udiids.h \
345 ${srcdir}/29k-share
/udi
/udiphcfg.h
${srcdir}/29k-share
/udi
/udiphsun.h \
346 ${srcdir}/29k-share
/udi
/udiproc.h
${srcdir}/29k-share
/udi
/udipt29k.h \
347 ${srcdir}/29k-share
/udi
/udiptcfg.h
${srcdir}/29k-share
/udi
/udisoc.h \
348 ${srcdir}/29k-share
/udi_soc
${srcdir}/nindy-share
/b.out.h \
349 ${srcdir}/nindy-share
/block_io.h
${srcdir}/nindy-share
/coff.h \
350 ${srcdir}/nindy-share
/demux.h
${srcdir}/nindy-share
/env.h \
351 ${srcdir}/nindy-share
/stop.h
${srcdir}/nindy-share
/ttycntl.h \
352 ${srcdir}/vx-share
/dbgRpcLib.h
${srcdir}/vx-share
/ptrace.h \
353 ${srcdir}/vx-share
/vxTypes.h
${srcdir}/vx-share
/vxWorks.h \
354 ${srcdir}/vx-share
/wait.h
${srcdir}/vx-share
/xdr_ld.h \
355 ${srcdir}/vx-share
/xdr_ptrace.h
${srcdir}/vx-share
/xdr_rdb.h
357 # GDB "info" files, which should be included in their entirety
358 INFOFILES
= gdb.
info*
360 REMOTE_EXAMPLES
= m68k-stub.c i386-stub.c sparc-stub.c rem-multi.
shar
362 POSSLIBS
= ${srcdir}/regex.c
${srcdir}/regex.h
${srcdir}/alloca.c
364 TESTS
= testbpt.c testfun.c testrec.c testreg.c testregs.c
366 # Subdirectories of gdb, which should be included in their entirety in
368 TARDIRS
= doc sparclite
# tests
370 DEPFILES
= ${TDEPFILES} ${XDEPFILES} ${NATDEPFILES}
372 SOURCES
= $(SFILES
) $(ALLDEPFILES
) $(YYFILES
)
373 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
375 TARFILES
= ${SFILES} ${HFILES} ${NONSRC} ${ALLDEPFILES} $(ALLCONFIG
) \
376 $(ALLPARAM
) $(INFOFILES
) ${POSSLIBS} ${REMOTE_EXAMPLES}
378 OBS
= version.o main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
379 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
380 symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
381 command.o utils.o expprint.o environ.o gdbtypes.o \
382 copying.o
$(DEPFILES
) mem-break.o target.o \
383 putenv.o parse.o language.o
$(YYOBJ
) \
384 buildsym.o objfiles.o minsyms.o maint.o demangle.o \
385 dbxread.o coffread.o elfread.o dwarfread.o mipsread.o \
386 stabsread.o core.o c-lang.o ch-lang.o m2-lang.o complaints.o \
387 typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
388 c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o \
389 serial.o ser-hardwire.o
391 RAPP_OBS
= rgdb.o rudp.o rserial.o serial.o udp.o
$(XDEPFILES
)
395 NTSOBS
= standalone.o
397 TSSTART
= /lib
/crt0.o
399 NTSSTART
= kdb-start.o
401 SUBDIRS
= doc testsuite
403 # For now, shortcut the "configure GDB for fewer languages" stuff.
404 YYFILES
= c-exp.tab.c m2-exp.tab.c ch-exp.tab.c
405 YYOBJ
= c-exp.tab.o m2-exp.tab.o ch-exp.tab.o
407 # Prevent Sun make from putting in the machine type. Setting
408 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
410 ${CC} -c
${INTERNAL_CFLAGS} $<
413 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
417 @rootme
=`pwd`; export rootme
; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) DO
=check DODIRS
=testsuite subdir_do
419 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
421 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=install-info
"DODIRS=$(SUBDIRS)" subdir_do
423 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=clean-info
"DODIRS=$(SUBDIRS)" subdir_do
426 nroff
-man
$(srcdir)/gdb
.1 | col
-b
> gdb.t
427 pack gdb.t
; rm -f gdb.t
431 -parent
=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
432 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
433 -if
[ -d
$(bindir) ] ; then true
; else mkdir
$(bindir) ; fi
434 -parent
=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
435 if
[ -d
$$parent ] ; then true
; else mkdir
$$parent ; fi
436 -if
[ -d
$(man1dir) ] ; then true
; else mkdir
$(man1dir) ; fi
437 -n
=`t='$(program_transform_name)'; echo gdb | sed -e "" $$t`; \
438 $(INSTALL_PROGRAM
) gdb
$(bindir)/$$n; \
439 $(INSTALL_DATA
) $(srcdir)/gdb
.1 $(man1dir)/$$n.1
441 @
$(MAKE
) DO
=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS
) subdir_do
443 init.c
: $(srcdir)/munch
$(OBS
) $(TSOBS
)
444 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(TSOBS
) > init.c
446 gdb
: $(OBS
) $(TSOBS
) ${ADD_DEPS} ${CDEPS} init.o
447 ${CC-LD
} $(GLOBAL_CFLAGS
) $(LDFLAGS
) -o gdb \
448 init.o
$(OBS
) $(TSOBS
) $(ADD_FILES
) $(CLIBS
) $(LOADLIBES
)
450 saber_gdb
: $(SFILES
) $(DEPFILES
) copying.c version.c
451 #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
452 #load ./init.c $(SFILES)
453 #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/ch-exp.y
454 #unload ${srcdir}/vx-share/*.h
455 #unload ${srcdir}/nindy-share/[A-Z]*
456 #load c-exp.tab.c m2-exp.tab.c ch-exp.tab.c
457 #load copying.c version.c
458 #load ../opcodes/libopcodes.a
459 #load ../libiberty/libiberty.a
460 #load ../bfd/libbfd.a
461 #load ../readline/libreadline.a
462 #load ../mmalloc/libmmalloc.a
464 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
465 echo
"Load .c corresponding to:" $(DEPFILES
)
468 # This is useful when debugging GDB, because some Unix's don't let you run GDB
469 # on itself without copying the executable. So "make gdb1" will make
470 # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
471 # Removing gdb1 before the copy is the right thing if gdb1 is open
472 # in another process.
477 # This is a remote stub which runs under unix and starts up an
478 # inferior process. This is at least useful for debugging GDB's
482 ${srcdir}/munch
${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c
483 ${CC-LD
} $(LDFLAGS
) -o
$@ rapp_init.c
$(RAPP_OBS
)
485 # Support for building Makefile out of configured pieces, automatically
486 # generated dependencies, etc. alldeps.mak is a file that contains
487 # "make" variable definitions for all ALLDEPFILES, ALLPARAM, and ALLCONFIG,
488 # all cadged from the current contents of the config subtree.
491 rm -f alldeps.mak alldeps
*.tmp allparam
*.tmp allconfig
*.tmp
492 for i in
`(cd ${srcdir}; find config -name '*.m[ht]' -print)` ; do \
493 echo
$$i >>allconfig.tmp
; \
494 awk
<${srcdir}/$$i ' \
495 $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" \
496 || $$1 == "NATDEPFILES=" { \
497 for (i = 2; i <= NF; i++) \
498 print $$i >> "alldeps.tmp" ; \
500 $$1 == "TM_FILE=" || $$1 == "XM_FILE=" || $$1 == "NAT_FILE=" { \
501 print $$2 >> "allparam.tmp" }' ; \
503 sort <alldeps.tmp | uniq | \
504 sed
-e
's/arm-convert.o/arm-convert.s/' \
505 -e
's!^Onindy.o!nindy-share/Onindy.c!' \
506 -e
's!^nindy.o!nindy-share/nindy.c!' \
507 -e
's!ttybreak.o!nindy-share/ttybreak.c!' \
508 -e
's!ttyflush.o!nindy-share/ttyflush.c!' \
509 -e
's!xdr_ld.o!vx-share/xdr_ld.c!' \
510 -e
's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
511 -e
's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
512 -e
's!udr.o!29k-share/udi/udr.c!' \
513 -e
's!udip2soc.o!29k-share/udi/udip2soc.c!' \
515 -e
'/..\/opcodes\//d' \
518 for i in
`cat allparam.tmp` ; do \
520 find config
-name
$$i -print ) >>allparam2.tmp
; \
522 echo
'# Start of "alldeps.mak" definitions' >>alldeps.mak
;
523 sort <alldeps2.tmp | uniq | awk
'BEGIN {printf "ALLDEPFILES="} \
524 NR == 0 {printf "$${srcdir}/" $$0;} \
525 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
526 END {printf "\n\n"}' >>alldeps.mak
;
527 sort <allparam2.tmp | uniq | awk
'BEGIN {printf "ALLPARAM="} \
528 NR == 0 {printf "$${srcdir}/" $$0;} \
529 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
530 END {printf "\n\n"}' >>alldeps.mak
;
531 sort <allconfig.tmp | uniq | awk
'BEGIN {printf "ALLCONFIG="} \
532 NR == 0 {printf "$${srcdir}/" $$0;} \
533 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
534 END {printf "\n\n"}' >>alldeps.mak
;
535 echo
'# End of "alldeps.mak" definitions' >>alldeps.mak
;
536 rm -f alldeps
*.tmp allparam
*.tmp allconfig
*.tmp
538 depend
: $(SOURCES
) Makefile.in
539 @echo Ignore errors about non-existent system-supplied
include files
540 @echo for systems other than the one you are using.
541 @echo Also ignore any errors in arm-convert.s.
542 -$(GCC
) -MM
-nostdinc
-I
/usr
/include -I
${BFD_DIR} \
543 -I
${READLINE_DIR} $(INTERNAL_CFLAGS
) \
544 `ls $(SOURCES) | grep -v '\.[hy]$$' | \
546 #BEGIN COMMENTED OUT CODE -- this should now be taken care of below.
547 # If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except
548 # for xm.h, tm.h and nm.h. This allows the same "depend" file to be used
549 # by the various subdirectories.
550 # if [ "${srcdir}" = "." ] ; then \
552 # -e 's; ./xm.h; xm.h;g' \
553 # -e 's; ./tm.h; tm.h;g' \
554 # -e 's; ./nm.h; nm.h;g' \
555 # -e 's; \./; $${srcdir}/;g' \
556 # -e 's; vx-share/; $${srcdir}/vx-share/;g' \
557 # -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
558 # -e 's; 29k-share/; $${srcdir}/29k-share/;g' \
561 # mv depend.tm2 depend.tmp; \
563 #END COMMENTED OUT CODE
564 # Make everything which depends on {x,t,n}m.h depend on config.status as
565 # well, in case someone reconfigures gdb out from under an already
568 # Translate SRCDIR/foo.c to $srcdir/foo.c. This allows this "depend" file
569 # to be used by any dir, or included in a distribution. It's possible
570 # we should write the generated copy into SRCDIR like "make headers" does
571 # in bfd. We do not try to quote the regexp, so if SRCDIR/ is "./" it will
572 # also match any single character followed by "/". This is OK.
574 -e
's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
575 -e
's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
576 -e
's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
577 -e
's; \./xm.h; xm.h config.status;g' \
578 -e
's; \./tm.h; tm.h config.status;g' \
579 -e
's; \./nm.h; nm.h config.status;g' \
580 -e
's; ${srcdir}/; $${srcdir}/;g' \
581 -e
's; vx-share/; $${srcdir}/vx-share/;g' \
582 -e
's; nindy-share/; $${srcdir}/nindy-share/;g' \
583 -e
's; 29k-share/; $${srcdir}/29k-share/;g' \
585 # OK, get your sed manual out. This script makes the rules in
586 # depend explicitly state the rule, rather than relying on VPATH
587 # or a .c.o implicit rule. This is needed for Sun make, and should
588 # be portable to any make worthy of the name.
589 # There is one exception: the *.tab.c files can exist either in srcdir
590 # or in ., so make sure not to use an explicit rule for them.
592 # Adding -I${BFD_DIR} is required for all the files which use BFD internals
593 # Adding -I${READLINE_DIR} is required because the readline header files
594 # are in readline not in include. They probably should be moved.
600 -e
'/:.*\.tab\.c/d' \
601 -e
's/.*:\(.*\.c\).*/ $${CC} -c $${INTERNAL_CFLAGS} \1/' \
602 -e
's;$${srcdir}/xcoffread.c;-I$${BFD_DIR} &;' \
603 -e
's;$${srcdir}/stabsread.c;-I$${BFD_DIR} &;' \
604 -e
's;$${srcdir}/dwarfread.c;-I$${BFD_DIR} &;' \
605 -e
's;$${srcdir}/elfread.c;-I$${BFD_DIR} &;' \
606 -e
's;$${srcdir}/mipsread.c;-I$${BFD_DIR} &;' \
607 -e
's;$${srcdir}/coffread.c;-I$${BFD_DIR} &;' \
608 -e
's;$${srcdir}/dbxread.c;-I$${BFD_DIR} &;' \
609 -e
's;$${srcdir}/main.c;-I$${READLINE_DIR} &;' \
616 @echo
"You must configure gdb. Look at the README file for details."
619 # This checks the configure.in file versus the config/ directory.
620 config-check
: config-check-hosts config-check-targets
622 grep gdb_host
= ${srcdir}/configure.in | \
623 sed
-e
's/.*gdb_host=//' -e
's/ ;;$$/.mh/' |
sort -u
>HOSTconf.o
624 (cd
${srcdir}/config
; ls
*.mh
) >HOSTdir.o
625 diff
-u HOSTconf.o HOSTdir.o
627 config-check-targets
:
628 grep gdb_target
= ${srcdir}/configure.in | \
629 sed
-e
's/.*gdb_target=//' -e
's/ ;;$$/.mh/' |
sort -u
>TARGconf.o
630 (cd
${srcdir}/config
; ls
*.mt
) >TARGdir.o
631 diff
-u HOSTconf.o HOSTdir.o
633 # These are not generated by "make depend" because they only are there
635 # But these rules don't do what we want; we want to hack the foo.o: tm.h
636 # dependency to do the right thing.
637 tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h
: tm-m68k.h
638 tm-hp300hpux.h tm-sun2.h tm-3b1.h
: tm-m68k.h
639 xm-news1000.h
: xm-news.h
640 xm-i386-sv32.h
: xm-i386.h
641 tm-i386gas.h
: tm-i386.h
642 xm-sun4os4.h
: xm-sparc.h
643 tm-sun4os4.h
: tm-sparc.h
644 xm-vaxult.h
: xm-vax.h
645 xm-vaxbsd.h
: xm-vax.h
647 kdb
: $(NTSSTART
) $(OBS
) $(NTSOBS
) ${ADD_DEPS} ${CDEPS}
649 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(NTSOBS
) > init.c
650 $(CC
) $(LDFLAGS
) -c init.c
$(CLIBS
)
651 ld -o kdb
$(NTSSTART
) $(OBS
) $(NTSOBS
) init.o
$(ADD_FILES
) \
654 # Put the proper machine-specific files first, so M-. on a machine
655 # specific routine gets the one for the correct machine.
656 # The xyzzy stuff below deals with empty DEPFILES
658 etags
`find ${srcdir}/config -name $(TM_FILE) -print` \
659 `find ${srcdir}/config -name ${XM_FILE} -print` \
660 `find ${srcdir}/config -name ${NAT_FILE} -print` \
661 `for i in yzzy ${DEPFILES}; do \
662 if [ x$$i != xyzzy ]; then \
663 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
669 # Making distributions of GDB and friends.
671 # Make a tar file containing the GDB directory of the distribution.
672 gdb.
tar.Z
: force_update
673 $(MAKE
) $(MFLAGS
) -f Makefile.in setup-to-dist
674 $(MAKE
) $(MFLAGS
) -f Makefile.in gdb-
$(VERSION
).
tar.Z
676 # Make a directory `proto-gdb.dir' that contains an image of the GDB
677 # directory of the distribution, built up with symlinks. Note that this
678 # make target is not directly referenced by any other rules in this makefile,
679 # it is referenced by the makefile in the parent directory.
680 make-proto-gdb.
dir: force_update
681 $(MAKE
) $(MFLAGS
) -f Makefile.in setup-to-dist
682 $(MAKE
) $(MFLAGS
) -f Makefile make-proto-gdb-1
684 # Set up the GDB source directory for distribution, by building all files that
685 # are products of other files.
686 setup-to-dist
: update-depend force_update
688 (cd doc
; $(MAKE
) $(MFLAGS
) GDBvn.texi
)
689 $(MAKE
) $(MFLAGS
) gdb.
info
690 $(MAKE
) $(MFLAGS
) refcard.ps
692 # Update the "depend" and "alldeps.mak" files in a source directory.
693 # We update alldeps.mak first, since it is used to generate the list
694 # of files to be checked for dependencies.
695 update-depend
: update-alldeps force_update
696 ..
/configure none
-norecursion
698 $(MAKE
) $(MFLAGS
) depend
700 # Update the "alldeps.mak" file in a source directory.
701 update-alldeps
: force_update
702 ..
/configure none
-norecursion
704 $(MAKE
) $(MFLAGS
) alldeps.mak
706 # Build a tar file from a proto-gdb.dir.
707 gdb-
$(VERSION
).
tar.Z
: force_update
708 rm -f gdb.
tar gdb-
$(VERSION
).
tar.Z
709 $(MAKE
) $(MFLAGS
) -f Makefile make-proto-gdb-1
710 ln
-s proto-gdb.
dir $(DIST
)
711 tar chf
- $(DIST
) | compress
>gdb-
$(VERSION
).
tar.Z
712 rm -rf
$(DIST
) proto-gdb.
dir
714 # Build a proto-gdb.dir after GDB has been set up for distribution.
715 # This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile
716 # built in the setup-to-dist process, since it defines things like ALLCONFIG
717 # and ALLDEPFILES, that we need.
718 make-proto-gdb-1
: ${TARFILES} ${TARDIRS} gdb.
info
721 rootme
=`pwd`/ ; export rootme
; \
722 for i in
`echo ${TARDIRS}`; do \
723 (cd proto-gdb.
dir ; \
726 ln
-s
$${rootme}/$$i/* .
; \
727 rm -rf SCCS CVS CVS.adm RCS config.status
; \
728 if
test -f Makefile.in
; then
rm Makefile
; else true
; fi
;); \
730 for i in
`echo ${TARFILES}`; do \
731 (cd proto-gdb.
dir ; \
733 if
test -d
$$dir; then true
; else mkdir
-p
$$dir; fi
; \
734 ln
-s
$${rootme}/$$i $$i;); \
736 chmod og
=u
`find . -print`
738 # Build a proto-testsuite.dir.
739 make-proto-testsuite.
dir: force_update
740 rm -rf proto-testsuite.
dir
741 mkdir proto-testsuite.
dir
742 rootme
=`pwd`/ ; export rootme
; \
743 for i in
`find testsuite -type f -print`; do \
744 (cd proto-testsuite.
dir ; \
746 if
test -d
$$dir; then true
; else mkdir
-p
$$dir; fi
; \
747 ln
-s
$${rootme}/$$i $$i;); \
749 find proto-testsuite.
dir -name Makefile
-exec
rm {} \
;
750 find proto-testsuite.
dir -name config.status
-exec
rm {} \
;
753 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=clean "DODIRS=$(SUBDIRS)" subdir_do
754 rm -f
*.o
${ADD_FILES} *~
755 rm -f init.c version.c
756 rm -f gdb core make.log
759 distclean: clean c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
760 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=distclean "DODIRS=$(SUBDIRS)" subdir_do
761 rm -f tm.h xm.h config.status
762 rm -f y.output
yacc.acts
yacc.tmp
763 rm -f
${TESTS} Makefile depend
766 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=realclean "DODIRS=$(SUBDIRS)" subdir_do
767 rm -f c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
768 rm -f tm.h xm.h config.status
769 rm -f Makefile depend
771 STAGESTUFF
=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
774 @for i in
$(DODIRS
); do \
775 if
[ -d .
/$$i ] ; then \
777 $(MAKE
) $(FLAGS_TO_PASS
) $(DO
)) ; then true
; \
782 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
783 $(SHELL
) .
/config.status
788 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
790 ( cd .
/doc
; $(MAKE
) refcard.
dvi $(FLAGS_TO_PASS
) )
791 mv .
/doc
/refcard.
dvi .
793 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
795 ( cd .
/doc
; $(MAKE
) refcard.ps
$(FLAGS_TO_PASS
) )
796 mv .
/doc
/refcard.ps .
798 # GDB MANUAL: TeX dvi file
800 ( cd .
/doc
; $(MAKE
) gdb.
dvi $(FLAGS_TO_PASS
) )
803 # GDB MANUAL: info file
805 ( cd .
/doc
; $(MAKE
) gdb.
info $(FLAGS_TO_PASS
) )
808 # Make copying.c from COPYING
809 copying.c
: ${srcdir}/COPYING
${srcdir}/copying.awk
810 awk
-f
${srcdir}/copying.awk
< ${srcdir}/COPYING
> copying.c
813 echo
'char *version = "$(VERSION)";' >version.c
815 # c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
816 # in srcdir, then compiled in target dir to c-exp.tab.o.
817 # ././c-exp.tab.c is so the command argument will never match $(srcdir)/c-exp.y
818 # (some "makes" rewrite the VPATH into command arguments if they match deps).
819 # Remove bogus decls for malloc/realloc/free which conflict with everything
821 c-exp.tab.o
: c-exp.tab.c
822 c-exp.tab.c
: $(srcdir)/c-exp.y
$(srcdir)/Makefile.in
823 @echo
'Expect 4 shift/reduce conflicts.'
824 ${YACC} ${YFLAGS} $(srcdir)/c-exp.y
825 -sed
-e
'/extern.*malloc/d' \
826 -e
'/extern.*realloc/d' \
827 -e
'/extern.*free/d' \
828 -e
'/include.*malloc.h/d' \
829 -e
's/malloc/xmalloc/g' \
830 -e
's/realloc/xrealloc/g' \
831 < y.tab.c
> .
/.
/c-exp.tab.c
834 # ch-exp.tab.c is generated in target dir from ch-exp.y if it doesn't exist
835 # in srcdir, then compiled in target dir to ch-exp.tab.o.
836 # Remove bogus decls for malloc/realloc/free which conflict with everything
838 ch-exp.tab.o
: ch-exp.tab.c
839 ch-exp.tab.c
: $(srcdir)/ch-exp.y
$(srcdir)/Makefile.in
840 ${YACC} ${YFLAGS} $(srcdir)/ch-exp.y
841 -sed
-e
'/extern.*malloc/d' \
842 -e
'/extern.*realloc/d' \
843 -e
'/extern.*free/d' \
844 -e
'/include.*malloc.h/d' \
845 -e
's/malloc/xmalloc/g' \
846 -e
's/realloc/xrealloc/g' \
847 < y.tab.c
> .
/.
/ch-exp.tab.c
850 # m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
851 # in srcdir, then compiled in target dir to m2-exp.tab.o.
852 # Remove bogus decls for malloc/realloc/free which conflict with everything
854 m2-exp.tab.o
: m2-exp.tab.c
855 m2-exp.tab.c
: $(srcdir)/m2-exp.y
$(srcdir)/Makefile.in
856 ${YACC} ${YFLAGS} $(srcdir)/m2-exp.y
857 -sed
-e
'/extern.*malloc/d' \
858 -e
'/extern.*realloc/d' \
859 -e
'/extern.*free/d' \
860 -e
'/include.*malloc.h/d' \
861 -e
's/malloc/xmalloc/g' \
862 -e
's/realloc/xrealloc/g' \
863 < y.tab.c
> .
/.
/m2-exp.tab.c
866 # Used on HP-PA native.
867 # This rule fails to get automatically generated in depend because gcc -MM
868 # ends up trying to include ../bfd/sysdep.h, which does not exist in an
869 # unconfigured BFD directory, and the resulting error suppresses the
870 # output of dependency information. For now, just punt. (FIXME)
871 paread.o
: ${srcdir}/paread.c
872 ${CC} -c
${INTERNAL_CFLAGS} -I
$(BFD_DIR
) ${srcdir}/paread.c
873 # Used on RS6000 native.
874 # This rule fails to get automatically generated in depend if
875 # sys/ldr.h does not exist. (FIXME)
876 xcoffexec.o
: ${srcdir}/xcoffexec.c
877 ${CC} -c
${INTERNAL_CFLAGS} -I
${BFD_DIR} ${srcdir}/xcoffexec.c
880 $(LINT
) $(INCLUDE_CFLAGS
) $(LINTFLAGS
) $(LINTFILES
) \
881 `echo ${DEPFILES} | sed 's/\.o /\.c /g'
884 cxref -I. $(SFILES) >gdb.cxref
888 # GNU Make has an annoying habit of putting *all* the Makefile variables
889 # into the environment, unless you include this target as a circumvention.
890 # Rumor is that this will be fixed (and this target can be removed)
894 # GNU Make 3.63 has a different problem: it keeps tacking command line
895 # overrides onto the definition of $(MAKE). This variable setting
899 ## This is ugly, but I don't want GNU make to put these variables in
900 ## the environment. Older makes will see this as a set of targets
901 ## with no dependencies and no actions.
902 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
904 # This is the end of "Makefile.in". When built into "Makefile"
905 # by the configure script, two things are added below this point:
906 # alldeps.mak -- definitions of all files that are used in
907 # host- or target-dependent configurations
908 # depend -- what .o files depend on what .c and .h files,
909 # for all configurations.