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
44 INSTALL
= $(srcdir)/..
/install.sh
-c
45 INSTALL_PROGRAM
= $(INSTALL
)
46 INSTALL_DATA
= $(INSTALL
)
47 INSTALL_XFORM
= $(INSTALL
) -t
=$(program_transform_name
)
48 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
54 # Flags that describe where you can find the termcap library.
55 # This can be overridden in the host Makefile fragment file.
58 # System V: If you compile gdb with a compiler which uses the coff
59 # encapsulation feature (this is a function of the compiler used, NOT
60 # of the m-?.h file selected by config.gdb), you must make sure that
61 # the GNU nm is the one that is used by munch.
63 # If you are compiling with GCC, make sure that either 1) You use the
64 # -traditional flag, or 2) You have the fixed include files where GCC
65 # can reach them. Otherwise the ioctl calls in inflow.c
66 # will be incorrectly compiled. The "fixincludes" script in the gcc
67 # distribution will fix your include files up.
72 # Directory containing source files. Don't clean up the spacing,
73 # this exact string is matched for by the "configure" script.
76 # It is also possible that you will need to add -I/usr/include/sys to the
77 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
78 # is where it should be according to Posix).
80 # If you use bison instead of yacc, it needs to include the "-y" argument.
85 # where to find texinfo; GDB dist should include a recent one
86 TEXIDIR
=${srcdir}/..
/texinfo
88 # where to find makeinfo, preferably one designed for texinfo-2
91 # Set this up with gcc if you have gnu ld and the loader will print out
92 # line numbers for undefinded refs.
96 # Where is the "include" directory? Traditionally ../include or ./include
97 INCLUDE_DIR
= ${srcdir}/..
/include
98 INCLUDE_DEP
= $$(INCLUDE_DIR
)
100 # Where is the source dir for the MMALLOC library? Traditionally ../mmalloc
101 # or ./mmalloc (When we want the binary library built from it, we use
102 # ${MMALLOC_DIR}${subdir}.)
103 # Note that mmalloc can still be used on systems without mmap().
104 # To use your system malloc, comment out the following defines.
105 MMALLOC_DIR
= ${srcdir}/..
/mmalloc
106 MMALLOC_DEP
= $$(MMALLOC_DIR
)
107 MMALLOC_LIB
= .
/..
/mmalloc
${subdir}/libmmalloc.a
108 # To use your system malloc, uncomment MMALLOC_DISABLE.
109 #MMALLOC_DISABLE = -DNO_MMALLOC
110 # To use mmalloc but disable corruption checking, uncomment MMALLOC_CHECK
111 #MMALLOC_CHECK = -DNO_MMALLOC_CHECK
112 MMALLOC_CFLAGS
= ${MMALLOC_CHECK} ${MMALLOC_DISABLE}
114 # Where are the source and binary directories for the BFD library?
115 BFD_SRC_DIR
= ${srcdir}/..
/bfd
116 BFD_OBJ_DIR
= .
/..
/bfd
${subdir}
117 BFD_DEP
= $$(BFD_SRC_DIR
)
118 BFD_LIB
= $(BFD_OBJ_DIR
)/libbfd.a
120 # Where is the source dir for the READLINE library? Traditionally in .. or .
121 # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
122 READLINE_DIR
= ${srcdir}/..
/readline
123 READLINE_DEP
= $$(READLINE_DIR
)
124 RL_LIB
= .
/..
/readline
${subdir}/libreadline.a
126 # All the includes used for CFLAGS and for lint.
127 # -I. for config files.
128 # -I${srcdir} possibly for regex.h also.
129 # -I${srcdir}/config for more generic config files.
130 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
${srcdir}/config
-I
$(INCLUDE_DIR
)
132 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
133 # from the config/ directory.
134 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
135 #PROFILE_CFLAGS = -pg
137 # CFLAGS is specifically reserved for setting from the command line
138 # when running make. I.E. "make USER_CFLAGS=-Wmissing-prototypes".
140 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
141 INTERNAL_CFLAGS
= ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MMALLOC_CFLAGS} ${INCLUDE_CFLAGS} ${USER_CFLAGS}
142 # None of the things in CFLAGS will do any harm, and on some systems
143 # (e.g. SunOS4) it is important to use the MH_CFLAGS.
146 # Where is the "-liberty" library, containing getopt and obstack?
147 LIBIBERTY_DIR
= ${srcdir}/..
/libiberty
148 LIBIBERTY
= .
/..
/libiberty
${subdir}/libiberty.a
150 # Where is the "-lopcodes" library, with (some of) the opcode tables and
152 OPCODES
= .
/..
/opcodes
${subdir}/libopcodes.a
154 # The config/mh-* file must define REGEX and REGEX1 on USG machines.
155 # If your system is missing alloca(), or, more likely, it's there but
156 # it doesn't work, define ALLOCA & ALLOCA1 too.
158 # Libraries and corresponding dependencies for compiling gdb.
159 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
160 # TERMCAP comes after readline, since readline depends on it.
161 # If you have the Cygnus libraries installed,
162 # you can use 'CLIBS=${INSTALLED_LIBS}' 'CDEPS='
163 INSTALLED_LIBS
=-lbfd
-lreadline
${TERMCAP} -lopcodes
-lmmalloc \
164 -liberty
${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
165 CLIBS
= ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} \
166 ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS}
167 CDEPS
= ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \
168 ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY}
170 ADD_FILES
= ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES} \
172 ADD_DEPS
= ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \
179 LINTFLAGS
= -I
${BFD_SRC_DIR} -I
${BFD_OBJ_DIR}
184 # This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX
185 # interface to the serial port. Hopefully if get ported to OS/2, VMS,
186 # etc., then there will be (as part of the C library or perhaps as
187 # part of libiberty) a POSIX interface. But at least for now the
188 # host-dependent makefile fragment might need to use something else
190 SER_HARDWIRE
=ser-unix.o
192 # Host and target-dependent makefile fragments come in here.
194 # End of host and target-dependent makefile fragments
198 "exec_prefix=$(exec_prefix)" \
199 "against=$(against)" \
201 "AR_FLAGS=$(AR_FLAGS)" \
204 "CHILLFLAGS=$(CHILLFLAGS)" \
206 "CHILL_LIB=$(CHILL_LIB)" \
208 "CXXFLAGS=$(CXXFLAGS)" \
210 "MAKEINFO=$(MAKEINFO)" \
211 "INSTALL=$(INSTALL)" \
212 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
213 "INSTALL_DATA=$(INSTALL_DATA)" \
214 "RUNTEST=$(RUNTEST)" \
215 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
218 # Flags that we pass when building the testsuite.
221 if [ -f $${rootme}/../gcc/Makefile ] ; then \
222 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
224 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
227 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
234 if [ -f $${rootme}/../gcc/Makefile ] ; then \
235 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
237 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
240 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
244 CHILLFLAGS
= $(CFLAGS
)
246 CHILL_FOR_TARGET
= ` \
247 if [ -f $${rootme}/../gcc/Makefile ] ; then \
248 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../chillrt/; \
250 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
253 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
258 # The use of $$(x_FOR_TARGET) reduces the command line length by not
259 # duplicating the lengthy definition.
260 TARGET_FLAGS_TO_PASS
= \
262 "exec_prefix=$(exec_prefix)" \
263 "against=$(against)" \
264 'CC=$$(CC_FOR_TARGET)' \
265 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
267 "CHILLFLAGS=$(CHILLFLAGS)" \
268 'CHILL=$$(CHILL_FOR_TARGET)' \
269 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
270 "CHILL_LIB=$(CHILL_LIB)" \
271 'CXX=$$(CXX_FOR_TARGET)' \
272 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
273 "CXXFLAGS=$(CXXFLAGS)" \
274 "MAKEINFO=$(MAKEINFO)" \
275 "INSTALL=$(INSTALL)" \
276 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
277 "INSTALL_DATA=$(INSTALL_DATA)" \
278 "RUNTEST=$(RUNTEST)" \
279 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
282 # All source files that go into linking GDB.
283 # Source files which are included via a config/*/* Makefile fragment should
284 # *not* be specified here; they're in "ALLDEPFILES".
285 # Neither should links made at configuration time be specified here, since
286 # SFILES is used in building the distribution archive.
288 SFILES
= ${srcdir}/blockframe.c
${srcdir}/breakpoint.c
${srcdir}/buildsym.c \
289 ${srcdir}/c-exp.y
${srcdir}/c-lang.c
${srcdir}/c-typeprint.c \
290 ${srcdir}/c-valprint.c
${srcdir}/ch-exp.y
${srcdir}/ch-lang.c \
291 ${srcdir}/ch-typeprint.c
${srcdir}/ch-valprint.c
${srcdir}/coffread.c \
292 ${srcdir}/command.c
${srcdir}/complaints.c
${srcdir}/core.c \
293 ${srcdir}/cp-valprint.c
${srcdir}/dbxread.c
${srcdir}/demangle.c \
294 ${srcdir}/dwarfread.c
${srcdir}/elfread.c
${srcdir}/environ.c \
295 ${srcdir}/eval.c
${srcdir}/expprint.c
${srcdir}/findvar.c \
296 ${srcdir}/gdbtypes.c \
297 ${srcdir}/infcmd.c
${srcdir}/inflow.c
${srcdir}/infrun.c \
298 ${srcdir}/language.c
${srcdir}/putenv.c
${srcdir}/m2-exp.y \
299 ${srcdir}/m2-lang.c
${srcdir}/m2-typeprint.c \
300 ${srcdir}/m2-valprint.c
${srcdir}/main.c
${srcdir}/maint.c \
301 ${srcdir}/mem-break.c
${srcdir}/minsyms.c
${srcdir}/mipsread.c \
302 ${srcdir}/objfiles.c
${srcdir}/parse.c
${srcdir}/printcmd.c \
303 ${srcdir}/remote.c
${srcdir}/source.c
${srcdir}/stabsread.c \
305 ${srcdir}/symfile.c
${srcdir}/symmisc.c
${srcdir}/symtab.c \
306 ${srcdir}/target.c
${srcdir}/typeprint.c
${srcdir}/utils.c \
307 ${srcdir}/valarith.c \
308 ${srcdir}/valops.c
${srcdir}/valprint.c
${srcdir}/values.c \
309 ${srcdir}/serial.c
${srcdir}/ser-unix.c
311 # Files that are not source code, but need to go into gdb-$(VERSION).tar.Z.
312 NONSRC
= ${srcdir}/Makefile.in
${srcdir}/depend
${srcdir}/alldeps.mak \
313 ${srcdir}/munch
${srcdir}/configure.in \
314 ${srcdir}/ChangeLog
${srcdir}/ChangeLog-9091
${srcdir}/ChangeLog-92 \
315 ${srcdir}/ChangeLog-3.x \
316 ${srcdir}/gdb
.1 ${srcdir}/refcard.ps
${srcdir}/README
${srcdir}/TODO \
317 TAGS
${srcdir}/NEWS
${srcdir}/Projects
${srcdir}/.gdbinit \
318 ${srcdir}/COPYING
$(YYFILES
) ${srcdir}/copying.c \
319 ${srcdir}/copying.awk \
320 ${srcdir}/saber.suppress
${srcdir}/standalone.c
${srcdir}/stuff.c \
321 ${srcdir}/kdb-start.c
${srcdir}/gcc.patch \
322 ${srcdir}/nindy-share
/Makefile
${srcdir}/nindy-share
/VERSION \
323 ${srcdir}/nindy-share
/README
${srcdir}/vx-share
/README \
324 ${srcdir}/29k-share
/README \
325 ${srcdir}/config
/convex
/Convex.notes
327 # All source files that lint should look at
328 LINTFILES
= $(SFILES
) $(YYFILES
) init.c
330 # Any additional files specified on these lines should also be added to
331 # the NONSRC definition, so they go in the tar files.
332 SFILES_STAND
= $(SFILES
) standalone.c
333 SFILES_KGDB
= $(SFILES
) stuff.c kdb-start.c
335 # Header files that are not named in config/*/* Makefile fragments go here.
336 HFILES
= ${srcdir}/breakpoint.h
${srcdir}/buildsym.h
${srcdir}/call-cmds.h \
337 ${srcdir}/command.h
${srcdir}/defs.h
${srcdir}/environ.h \
338 ${srcdir}/expression.h
${srcdir}/frame.h
${srcdir}/gdbcmd.h \
339 ${srcdir}/gdbcore.h
${srcdir}/gdbtypes.h
${srcdir}/gdb-stabs.h \
340 ${srcdir}/inferior.h
${srcdir}/language.h
${srcdir}/minimon.h \
341 ${srcdir}/objfiles.h
${srcdir}/parser-defs.h \
342 ${srcdir}/partial-stab.h
${srcdir}/serial.h
${srcdir}/signals.h \
343 ${srcdir}/solib.h
${srcdir}/symfile.h
${srcdir}/symtab.h \
344 ${srcdir}/stabsread.h
${srcdir}/target.h
${srcdir}/terminal.h \
345 ${srcdir}/typeprint.h
${srcdir}/xcoffsolib.h
${srcdir}/value.h \
346 ${srcdir}/c-lang.h
${srcdir}/ch-lang.h
${srcdir}/m2-lang.h \
347 ${srcdir}/complaints.h
${srcdir}/ns32k-opcode.h
${srcdir}/valprint.h \
348 ${srcdir}/config
/m68k
/tm-m68k.h
${srcdir}/config
/pa
/tm-hppa.h \
349 ${srcdir}/config
/i960
/tm-i960.h
${srcdir}/config
/sparc
/tm-sparc.h \
350 ${srcdir}/config
/tm-sunos.h \
351 ${srcdir}/config
/tm-sysv4.h
${srcdir}/config
/m68k
/xm-m68k.h \
352 ${srcdir}/config
/sparc
/xm-sparc.h \
353 ${srcdir}/config
/xm-sysv4.h
${srcdir}/config
/vax
/xm-vax.h \
354 ${srcdir}/config
/nm-trash.h
${srcdir}/29k-share
/udi
/udiids.h \
355 ${srcdir}/29k-share
/udi
/udiphcfg.h
${srcdir}/29k-share
/udi
/udiphunix.h \
356 ${srcdir}/29k-share
/udi
/udiproc.h
${srcdir}/29k-share
/udi
/udipt29k.h \
357 ${srcdir}/29k-share
/udi
/udiptcfg.h
${srcdir}/29k-share
/udi
/udisoc.h \
358 ${srcdir}/29k-share
/udi_soc
${srcdir}/nindy-share
/b.out.h \
359 ${srcdir}/nindy-share
/block_io.h
${srcdir}/nindy-share
/coff.h \
360 ${srcdir}/nindy-share
/demux.h
${srcdir}/nindy-share
/env.h \
361 ${srcdir}/nindy-share
/stop.h
${srcdir}/nindy-share
/ttycntl.h \
362 ${srcdir}/vx-share
/dbgRpcLib.h
${srcdir}/vx-share
/ptrace.h \
363 ${srcdir}/vx-share
/vxTypes.h
${srcdir}/vx-share
/vxWorks.h \
364 ${srcdir}/vx-share
/wait.h
${srcdir}/vx-share
/xdr_ld.h \
365 ${srcdir}/vx-share
/xdr_ptrace.h
${srcdir}/vx-share
/xdr_rdb.h
367 # GDB "info" files, which should be included in their entirety
368 INFOFILES
= gdb.
info*
370 REMOTE_EXAMPLES
= m68k-stub.c i386-stub.c sparc-stub.c rem-multi.
shar
372 POSSLIBS
= ${srcdir}/regex.c
${srcdir}/regex.h
${srcdir}/alloca.c
374 TESTS
= testbpt.c testfun.c testrec.c testreg.c testregs.c
376 # Subdirectories of gdb, which should be included in their entirety in
378 TARDIRS
= doc sparclite
# tests
380 # {X,T,NAT}DEPFILES are something of a pain in that it's hard to
381 # default their values the way we do for SER_HARDWIRE; in the future
382 # maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
383 # variables analogous to SER_HARDWIRE which get defaulted in this
386 DEPFILES
= ${TDEPFILES} ${XDEPFILES} ${SER_HARDWIRE} ${NATDEPFILES}
388 SOURCES
= $(SFILES
) $(ALLDEPFILES
) $(YYFILES
)
389 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
391 TARFILES
= ${SFILES} ${HFILES} ${NONSRC} ${ALLDEPFILES} $(ALLCONFIG
) \
392 $(ALLPARAM
) $(INFOFILES
) ${POSSLIBS} ${REMOTE_EXAMPLES}
394 OBS
= version.o main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
395 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
396 symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
397 command.o utils.o expprint.o environ.o gdbtypes.o \
398 copying.o
$(DEPFILES
) mem-break.o target.o \
399 putenv.o parse.o language.o
$(YYOBJ
) \
400 buildsym.o objfiles.o minsyms.o maint.o demangle.o \
401 dbxread.o coffread.o elfread.o dwarfread.o mipsread.o \
402 stabsread.o core.o c-lang.o ch-lang.o m2-lang.o complaints.o \
403 typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \
404 c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o \
407 RAPP_OBS
= rgdb.o rudp.o rserial.o serial.o udp.o
$(XDEPFILES
)
411 NTSOBS
= standalone.o
413 TSSTART
= /lib
/crt0.o
415 NTSSTART
= kdb-start.o
417 SUBDIRS
= doc testsuite
419 # For now, shortcut the "configure GDB for fewer languages" stuff.
420 YYFILES
= c-exp.tab.c m2-exp.tab.c ch-exp.tab.c
421 YYOBJ
= c-exp.tab.o m2-exp.tab.o ch-exp.tab.o
423 # Prevent Sun make from putting in the machine type. Setting
424 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
426 ${CC} -c
${INTERNAL_CFLAGS} $<
429 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
433 @rootme
=`pwd`; export rootme
; $(MAKE
) $(TARGET_FLAGS_TO_PASS
) DO
=check DODIRS
=testsuite subdir_do
435 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=$@
"DODIRS=$(SUBDIRS)" subdir_do
437 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=install-info
"DODIRS=$(SUBDIRS)" subdir_do
439 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=clean-info
"DODIRS=$(SUBDIRS)" subdir_do
442 nroff
-man
$(srcdir)/gdb
.1 | col
-b
> gdb.t
443 pack gdb.t
; rm -f gdb.t
446 # Traditionally this depends on "all". But it is probably more useful
447 # not to; for example, if the user has made some trivial change to a
448 # source file and doesn't care about rebuilding or just wants to save the
449 # time it takes for make to check that all is up to date.
451 $(INSTALL_XFORM
) gdb
$(bindir)/gdb
452 $(INSTALL_XFORM1
) $(srcdir)/gdb
.1 $(man1dir)/gdb
.1
453 $(INSTALL_DATA
) $(srcdir)/gdb
.1 $(man1dir)/$$n.1
455 @
$(MAKE
) DO
=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS
) subdir_do
457 init.c
: $(srcdir)/munch
$(OBS
) $(TSOBS
)
458 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(TSOBS
) > init.c
460 gdb
: $(OBS
) $(TSOBS
) ${ADD_DEPS} ${CDEPS} init.o
461 ${CC-LD
} $(GLOBAL_CFLAGS
) $(LDFLAGS
) -o gdb \
462 init.o
$(OBS
) $(TSOBS
) $(ADD_FILES
) $(CLIBS
) $(LOADLIBES
)
464 saber_gdb
: $(SFILES
) $(DEPFILES
) copying.c version.c
465 #setopt load_flags $(CFLAGS) -I$(BFD_SRC_DIR) -I${BFD_OBJ_DIR} -DHOST_SYS=SUN4_SYS
466 #load ./init.c $(SFILES)
467 #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/ch-exp.y
468 #unload ${srcdir}/vx-share/*.h
469 #unload ${srcdir}/nindy-share/[A-Z]*
470 #load c-exp.tab.c m2-exp.tab.c ch-exp.tab.c
471 #load copying.c version.c
472 #load ../opcodes/libopcodes.a
473 #load ../libiberty/libiberty.a
474 #load ../bfd/libbfd.a
475 #load ../readline/libreadline.a
476 #load ../mmalloc/libmmalloc.a
478 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
479 echo
"Load .c corresponding to:" $(DEPFILES
)
482 # This is useful when debugging GDB, because some Unix's don't let you run GDB
483 # on itself without copying the executable. So "make gdb1" will make
484 # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
485 # Removing gdb1 before the copy is the right thing if gdb1 is open
486 # in another process.
491 # This is a remote stub which runs under unix and starts up an
492 # inferior process. This is at least useful for debugging GDB's
496 ${srcdir}/munch
${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c
497 ${CC-LD
} $(LDFLAGS
) -o
$@ rapp_init.c
$(RAPP_OBS
)
499 # Support for building Makefile out of configured pieces, automatically
500 # generated dependencies, etc. alldeps.mak is a file that contains
501 # "make" variable definitions for all ALLDEPFILES, ALLPARAM, and ALLCONFIG,
502 # all cadged from the current contents of the config subtree.
504 # using sort and uniq is not a violation of the GNU coding standards
505 # because this rule is not part of building and installing GDB.
507 rm -f alldeps.mak alldeps
*.tmp allparam
*.tmp allconfig
*.tmp
508 for i in
`(cd ${srcdir}; find config -name '*.m[ht]' -print)` ; do \
509 echo
$$i >>allconfig.tmp
; \
510 awk
<${srcdir}/$$i ' \
511 $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" \
512 || $$1 == "NATDEPFILES=" || $$1 == "SER_HARDWIRE=" { \
513 for (i = 2; i <= NF; i++) \
514 print $$i >> "alldeps.tmp" ; \
516 $$1 == "TM_FILE=" || $$1 == "XM_FILE=" || $$1 == "NAT_FILE=" { \
517 print $$2 >> "allparam.tmp" }' ; \
519 sort <alldeps.tmp | uniq | \
520 sed
-e
's/arm-convert.o/arm-convert.s/' \
521 -e
's!^Onindy.o!nindy-share/Onindy.c!' \
522 -e
's!^nindy.o!nindy-share/nindy.c!' \
523 -e
's!ttybreak.o!nindy-share/ttybreak.c!' \
524 -e
's!ttyflush.o!nindy-share/ttyflush.c!' \
525 -e
's!xdr_ld.o!vx-share/xdr_ld.c!' \
526 -e
's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
527 -e
's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
528 -e
's!udr.o!29k-share/udi/udr.c!' \
529 -e
's!udip2soc.o!29k-share/udi/udip2soc.c!' \
531 -e
'/..\/opcodes\//d' \
534 for i in
`cat allparam.tmp` ; do \
536 find config
-name
$$i -print ) >>allparam2.tmp
; \
538 echo
'# Start of "alldeps.mak" definitions' >>alldeps.mak
;
539 sort <alldeps2.tmp | uniq | awk
'BEGIN {printf "ALLDEPFILES="} \
540 NR == 0 {printf "$${srcdir}/" $$0;} \
541 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
542 END {printf "\n\n"}' >>alldeps.mak
;
543 sort <allparam2.tmp | uniq | awk
'BEGIN {printf "ALLPARAM="} \
544 NR == 0 {printf "$${srcdir}/" $$0;} \
545 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
546 END {printf "\n\n"}' >>alldeps.mak
;
547 sort <allconfig.tmp | uniq | awk
'BEGIN {printf "ALLCONFIG="} \
548 NR == 0 {printf "$${srcdir}/" $$0;} \
549 NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \
550 END {printf "\n\n"}' >>alldeps.mak
;
551 echo
'# End of "alldeps.mak" definitions' >>alldeps.mak
;
552 rm -f alldeps
*.tmp allparam
*.tmp allconfig
*.tmp
554 depend
: $(SOURCES
) Makefile.in
555 @echo Ignore errors about non-existent system-supplied
include files
556 @echo for systems other than the one you are using.
557 @echo Also ignore any errors in arm-convert.s.
558 -$(GCC
) -MM
-nostdinc
-I
/usr
/include -I
${BFD_SRC_DIR} \
559 -I
${BFD_OBJ_DIR} -I
${READLINE_DIR} $(INTERNAL_CFLAGS
) \
560 `ls $(SOURCES) | grep -v '\.[hy]$$' | \
562 #BEGIN COMMENTED OUT CODE -- this should now be taken care of below.
563 # If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except
564 # for xm.h, tm.h and nm.h. This allows the same "depend" file to be used
565 # by the various subdirectories.
566 # if [ "${srcdir}" = "." ] ; then \
568 # -e 's; ./xm.h; xm.h;g' \
569 # -e 's; ./tm.h; tm.h;g' \
570 # -e 's; ./nm.h; nm.h;g' \
571 # -e 's; \./; $${srcdir}/;g' \
572 # -e 's; vx-share/; $${srcdir}/vx-share/;g' \
573 # -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
574 # -e 's; 29k-share/; $${srcdir}/29k-share/;g' \
577 # mv depend.tm2 depend.tmp; \
579 #END COMMENTED OUT CODE
580 # Make everything which depends on {x,t,n}m.h depend on config.status as
581 # well, in case someone reconfigures gdb out from under an already
584 # Translate SRCDIR/foo.c to $srcdir/foo.c. This allows this "depend" file
585 # to be used by any dir, or included in a distribution. It's possible
586 # we should write the generated copy into SRCDIR like "make headers" does
587 # in bfd. We do not try to quote the regexp, so if SRCDIR/ is "./" it will
588 # also match any single character followed by "/". This is OK.
590 -e
's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
591 -e
's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
592 -e
's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
593 -e
's; $(INCLUDE_DEP)/bfd\.h; $$(BFD_OBJ_DIR)/../include/bfd.h;g' \
594 -e
's; \./xm.h; xm.h config.status;g' \
595 -e
's; \./tm.h; tm.h config.status;g' \
596 -e
's; \./nm.h; nm.h config.status;g' \
597 -e
's; ${srcdir}/; $${srcdir}/;g' \
598 -e
's; vx-share/; $${srcdir}/vx-share/;g' \
599 -e
's; nindy-share/; $${srcdir}/nindy-share/;g' \
600 -e
's; 29k-share/; $${srcdir}/29k-share/;g' \
602 # OK, get your sed manual out. This script makes the rules in
603 # depend explicitly state the rule, rather than relying on VPATH
604 # or a .c.o implicit rule. This is needed for Sun make, and should
605 # be portable to any make worthy of the name.
606 # There is one exception: the *.tab.c files can exist either in srcdir
607 # or in ., so make sure not to use an explicit rule for them.
609 # Adding -I${BFD_SRC_DIR} and -I${BFD_OBJ_DIR} is required for all the files
610 # which use BFD internals. This is because some bfd include files are in the
611 # source directory, and some (bfd.h for example) are generated in the bfd
613 # Adding -I${READLINE_DIR} is required because the readline header files
614 # are in readline not in include. They probably should be moved.
620 -e
'/:.*\.tab\.c/d' \
621 -e
's/.*:\(.*\.c\).*/ $${CC} -c $${INTERNAL_CFLAGS} \1/' \
622 -e
's;$${srcdir}/xcoffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
623 -e
's;$${srcdir}/xcoffexec.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
624 -e
's;$${srcdir}/paread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
625 -e
's;$${srcdir}/stabsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
626 -e
's;$${srcdir}/dwarfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
627 -e
's;$${srcdir}/elfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
628 -e
's;$${srcdir}/mipsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
629 -e
's;$${srcdir}/coffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
630 -e
's;$${srcdir}/dbxread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \
631 -e
's;$${srcdir}/main.c;-I$${READLINE_DIR} &;' \
638 @echo
"You must configure gdb. Look at the README file for details."
641 # This checks the configure.in file versus the config/ directory.
642 config-check
: config-check-hosts config-check-targets
644 grep gdb_host
= ${srcdir}/configure.in | \
645 sed
-e
's/.*gdb_host=//' -e
's/ ;;$$/.mh/' |
sort -u
>HOSTconf.o
646 (cd
${srcdir}/config
; ls
*.mh
) >HOSTdir.o
647 diff
-u HOSTconf.o HOSTdir.o
649 config-check-targets
:
650 grep gdb_target
= ${srcdir}/configure.in | \
651 sed
-e
's/.*gdb_target=//' -e
's/ ;;$$/.mh/' |
sort -u
>TARGconf.o
652 (cd
${srcdir}/config
; ls
*.mt
) >TARGdir.o
653 diff
-u HOSTconf.o HOSTdir.o
655 # These are not generated by "make depend" because they only are there
657 # But these rules don't do what we want; we want to hack the foo.o: tm.h
658 # dependency to do the right thing.
659 tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h
: tm-m68k.h
660 tm-hp300hpux.h tm-sun2.h tm-3b1.h
: tm-m68k.h
661 xm-news1000.h
: xm-news.h
662 xm-i386-sv32.h
: xm-i386.h
663 tm-i386gas.h
: tm-i386.h
664 xm-sun4os4.h
: xm-sparc.h
665 tm-sun4os4.h
: tm-sparc.h
666 xm-vaxult.h
: xm-vax.h
667 xm-vaxbsd.h
: xm-vax.h
669 kdb
: $(NTSSTART
) $(OBS
) $(NTSOBS
) ${ADD_DEPS} ${CDEPS}
671 $(srcdir)/munch
${MUNCH_DEFINE} $(OBS
) $(NTSOBS
) > init.c
672 $(CC
) $(LDFLAGS
) -c init.c
$(CLIBS
)
673 ld -o kdb
$(NTSSTART
) $(OBS
) $(NTSOBS
) init.o
$(ADD_FILES
) \
676 # Put the proper machine-specific files first, so M-. on a machine
677 # specific routine gets the one for the correct machine.
678 # The xyzzy stuff below deals with empty DEPFILES
680 etags
`find ${srcdir}/config -name $(TM_FILE) -print` \
681 `find ${srcdir}/config -name ${XM_FILE} -print` \
682 `find ${srcdir}/config -name ${NAT_FILE} -print` \
683 `for i in yzzy ${DEPFILES}; do \
684 if [ x$$i != xyzzy ]; then \
685 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
691 # Making distributions of GDB and friends.
693 # Make a tar file containing the GDB directory of the distribution.
694 gdb.
tar.Z
: force_update
695 $(MAKE
) $(MFLAGS
) -f Makefile.in setup-to-dist
696 $(MAKE
) $(MFLAGS
) -f Makefile.in gdb-
$(VERSION
).
tar.Z
698 # Make a directory `proto-gdb.dir' that contains an image of the GDB
699 # directory of the distribution, built up with symlinks. Note that this
700 # make target is not directly referenced by any other rules in this makefile,
701 # it is referenced by the makefile in the parent directory.
702 make-proto-gdb.
dir: force_update
703 $(MAKE
) $(MFLAGS
) -f Makefile.in setup-to-dist
704 $(MAKE
) $(MFLAGS
) -f Makefile make-proto-gdb-1
706 # Set up the GDB source directory for distribution, by building all files that
707 # are products of other files.
708 setup-to-dist
: update-depend force_update
710 (cd doc
; $(MAKE
) $(MFLAGS
) GDBvn.texi
)
711 $(MAKE
) $(MFLAGS
) gdb.
info
712 $(MAKE
) $(MFLAGS
) refcard.ps
714 # Update the "depend" and "alldeps.mak" files in a source directory.
715 # We update alldeps.mak first, since it is used to generate the list
716 # of files to be checked for dependencies.
717 update-depend
: update-alldeps force_update
718 ..
/configure none
-norecursion
719 (cd ..
/bfd
; ..
/configure sun4
-norecursion
; rm -f stmp-bfd.h
)
720 (cd ..
/bfd
; $(MAKE
) $(MFLAGS
) bfd.h
)
722 $(MAKE
) $(MFLAGS
) depend
724 # Update the "alldeps.mak" file in a source directory.
725 update-alldeps
: force_update
726 ..
/configure none
-norecursion
728 $(MAKE
) $(MFLAGS
) alldeps.mak
730 # Build a tar file from a proto-gdb.dir.
731 gdb-
$(VERSION
).
tar.Z
: force_update
732 rm -f gdb.
tar gdb-
$(VERSION
).
tar.Z
733 $(MAKE
) $(MFLAGS
) -f Makefile make-proto-gdb-1
734 ln
-s proto-gdb.
dir $(DIST
)
735 tar chf
- $(DIST
) | compress
>gdb-
$(VERSION
).
tar.Z
736 rm -rf
$(DIST
) proto-gdb.
dir
738 # Build a proto-gdb.dir after GDB has been set up for distribution.
739 # This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile
740 # built in the setup-to-dist process, since it defines things like ALLCONFIG
741 # and ALLDEPFILES, that we need.
742 make-proto-gdb-1
: ${TARFILES} ${TARDIRS} gdb.
info
745 rootme
=`pwd`/ ; export rootme
; \
746 for i in
`echo ${TARDIRS}`; do \
747 (cd proto-gdb.
dir ; \
750 ln
-s
$${rootme}/$$i/* .
; \
751 rm -rf SCCS CVS CVS.adm RCS config.status
; \
752 if
test -f Makefile.in
; then
rm Makefile
; else true
; fi
;); \
754 for i in
`echo ${TARFILES}`; do \
755 (cd proto-gdb.
dir ; \
757 if
test -d
$$dir; then true
; else mkdir
-p
$$dir; fi
; \
758 ln
-s
$${rootme}/$$i $$i;); \
760 chmod og
=u
`find . -print`
762 # Build a proto-testsuite.dir.
763 make-proto-testsuite.
dir: force_update
764 rm -rf proto-testsuite.
dir
765 mkdir proto-testsuite.
dir
766 rootme
=`pwd`/ ; export rootme
; \
767 for i in
`find testsuite -type f -print`; do \
768 (cd proto-testsuite.
dir ; \
770 if
test -d
$$dir; then true
; else mkdir
-p
$$dir; fi
; \
771 ln
-s
$${rootme}/$$i $$i;); \
773 find proto-testsuite.
dir -name Makefile
-exec
rm {} \
;
774 find proto-testsuite.
dir -name config.status
-exec
rm {} \
;
777 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=clean "DODIRS=$(SUBDIRS)" subdir_do
778 rm -f
*.o
${ADD_FILES} *~
779 rm -f init.c version.c
780 rm -f gdb core make.log
783 # This used to depend on c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
784 # I believe this is wrong; the makefile standards for distclean just
785 # describe removing files; the only sort of "re-create a distribution"
786 # functionality described is if the distributed files are unmodified.
788 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=distclean "DODIRS=$(SUBDIRS)" subdir_do
789 rm -f nm.h tm.h xm.h config.status
790 rm -f y.output
yacc.acts
yacc.tmp
791 rm -f
${TESTS} Makefile depend
794 @
$(MAKE
) $(FLAGS_TO_PASS
) DO
=realclean "DODIRS=$(SUBDIRS)" subdir_do
795 rm -f c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS
796 rm -f nm.h tm.h xm.h config.status
797 rm -f y.output
yacc.acts
yacc.tmp
798 rm -f
${TESTS} Makefile depend
800 STAGESTUFF
=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
803 @for i in
$(DODIRS
); do \
804 if
[ -f .
/$$i/Makefile
] ; then \
806 $(MAKE
) $(FLAGS_TO_PASS
) $(DO
)) ; then true
; \
811 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
812 $(SHELL
) .
/config.status
817 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
819 ( cd .
/doc
; $(MAKE
) refcard.
dvi $(FLAGS_TO_PASS
) )
820 mv .
/doc
/refcard.
dvi .
822 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
824 ( cd .
/doc
; $(MAKE
) refcard.ps
$(FLAGS_TO_PASS
) )
825 mv .
/doc
/refcard.ps .
827 # GDB MANUAL: TeX dvi file
829 ( cd .
/doc
; $(MAKE
) gdb.
dvi $(FLAGS_TO_PASS
) )
832 # GDB MANUAL: info file
834 ( cd .
/doc
; $(MAKE
) gdb.
info $(FLAGS_TO_PASS
) )
837 # Make copying.c from COPYING
838 copying.c
: ${srcdir}/COPYING
${srcdir}/copying.awk
839 awk
-f
${srcdir}/copying.awk
< ${srcdir}/COPYING
> copying.c
842 echo
'char *version = "$(VERSION)";' >version.c
843 echo
'char *host_canonical = "$(host_canonical)";' >> version.c
844 echo
'char *target_canonical = "$(target_canonical)";' >> version.c
846 # c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
847 # in srcdir, then compiled in target dir to c-exp.tab.o.
848 # ././c-exp.tab.c is so the command argument will never match $(srcdir)/c-exp.y
849 # (some "makes" rewrite the VPATH into command arguments if they match deps).
850 # Remove bogus decls for malloc/realloc/free which conflict with everything
852 c-exp.tab.o
: c-exp.tab.c
853 c-exp.tab.c
: $(srcdir)/c-exp.y
$(srcdir)/Makefile.in
854 @echo
'Expect 4 shift/reduce conflicts.'
855 ${YACC} ${YFLAGS} $(srcdir)/c-exp.y
856 -sed
-e
'/extern.*malloc/d' \
857 -e
'/extern.*realloc/d' \
858 -e
'/extern.*free/d' \
859 -e
'/include.*malloc.h/d' \
860 -e
's/malloc/xmalloc/g' \
861 -e
's/realloc/xrealloc/g' \
862 < y.tab.c
> c-exp.new
864 mv c-exp.new .
/.
/c-exp.tab.c
866 # ch-exp.tab.c is generated in target dir from ch-exp.y if it doesn't exist
867 # in srcdir, then compiled in target dir to ch-exp.tab.o.
868 # Remove bogus decls for malloc/realloc/free which conflict with everything
870 ch-exp.tab.o
: ch-exp.tab.c
871 ch-exp.tab.c
: $(srcdir)/ch-exp.y
$(srcdir)/Makefile.in
872 ${YACC} ${YFLAGS} $(srcdir)/ch-exp.y
873 -sed
-e
'/extern.*malloc/d' \
874 -e
'/extern.*realloc/d' \
875 -e
'/extern.*free/d' \
876 -e
'/include.*malloc.h/d' \
877 -e
's/malloc/xmalloc/g' \
878 -e
's/realloc/xrealloc/g' \
879 < y.tab.c
> ch-exp.new
881 mv ch-exp.new .
/.
/ch-exp.tab.c
883 # m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
884 # in srcdir, then compiled in target dir to m2-exp.tab.o.
885 # Remove bogus decls for malloc/realloc/free which conflict with everything
887 m2-exp.tab.o
: m2-exp.tab.c
888 m2-exp.tab.c
: $(srcdir)/m2-exp.y
$(srcdir)/Makefile.in
889 ${YACC} ${YFLAGS} $(srcdir)/m2-exp.y
890 -sed
-e
'/extern.*malloc/d' \
891 -e
'/extern.*realloc/d' \
892 -e
'/extern.*free/d' \
893 -e
'/include.*malloc.h/d' \
894 -e
's/malloc/xmalloc/g' \
895 -e
's/realloc/xrealloc/g' \
896 < y.tab.c
> m2-exp.new
898 mv m2-exp.new .
/.
/m2-exp.tab.c
900 # These files are updated atomically, so make never has to remove them
901 .PRECIOUS
: m2-exp.tab.c ch-exp.tab.c c-exp.tab.c
904 $(LINT
) $(INCLUDE_CFLAGS
) $(LINTFLAGS
) $(LINTFILES
) \
905 `echo ${DEPFILES} | sed 's/\.o /\.c /g'
908 cxref -I. $(SFILES) >gdb.cxref
912 # GNU Make has an annoying habit of putting *all* the Makefile variables
913 # into the environment, unless you include this target as a circumvention.
914 # Rumor is that this will be fixed (and this target can be removed)
918 # GNU Make 3.63 has a different problem: it keeps tacking command line
919 # overrides onto the definition of $(MAKE). This variable setting
923 ## This is ugly, but I don't want GNU make to put these variables in
924 ## the environment. Older makes will see this as a set of targets
925 ## with no dependencies and no actions.
926 unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET :
928 # This is the end of "Makefile.in". When built into "Makefile"
929 # by the configure script, two things are added below this point:
930 # alldeps.mak -- definitions of all files that are used in
931 # host- or target-dependent configurations
932 # depend -- what .o files depend on what .c and .h files,
933 # for all configurations.