Set GDB version number to 8.2.1.
[external/binutils.git] / gdb / Makefile.in
1 # Copyright (C) 1989-2018 Free Software Foundation, Inc.
2
3 # This file is part of GDB.
4
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 3 of the License, or
8 # (at your option) any later version.
9 #
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.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 # Please keep lists in this file sorted alphabetically, with one item per line.
19 # Here are the general guidelines for ordering files and directories:
20 #
21 #   - Files come before directories.
22 #   - The extensions are not taken into account when comparing filenames, except
23 #     if the filenames are otherwise equal.
24 #   - A filename that is a prefix of another one comes before.
25 #   - Underscores and dashes are treated equally, and come before alphanumeric
26 #     characters.
27 #
28 # For example:
29 #
30 # SOME_FILES = \
31 #       foo.c \
32 #       foo.h \
33 #       foo-bar.c \
34 #       foobar.c \
35 #       foo/bar.c
36
37 prefix = @prefix@
38 exec_prefix = @exec_prefix@
39
40 host_alias = @host_alias@
41 target_alias = @target_alias@
42 program_transform_name = @program_transform_name@
43 bindir = @bindir@
44 libdir = @libdir@
45 tooldir = $(libdir)/$(target_alias)
46
47 datadir = @datadir@
48 localedir = @localedir@
49 mandir = @mandir@
50 man1dir = $(mandir)/man1
51 man2dir = $(mandir)/man2
52 man3dir = $(mandir)/man3
53 man4dir = $(mandir)/man4
54 man5dir = $(mandir)/man5
55 man6dir = $(mandir)/man6
56 man7dir = $(mandir)/man7
57 man8dir = $(mandir)/man8
58 man9dir = $(mandir)/man9
59 infodir = @infodir@
60 datarootdir = @datarootdir@
61 docdir = @docdir@
62 htmldir = @htmldir@
63 pdfdir = @pdfdir@
64 includedir = @includedir@
65
66 install_sh = @install_sh@
67
68 # This can be referenced by `LIBINTL' as computed by
69 # ZW_GNU_GETTEXT_SISTER_DIR.
70 top_builddir = .
71
72 SHELL = @SHELL@
73 EXEEXT = @EXEEXT@
74
75 AWK = @AWK@
76 LN_S = @LN_S@
77
78 INSTALL = @INSTALL@
79 INSTALL_PROGRAM = @INSTALL_PROGRAM@
80 INSTALL_SCRIPT = @INSTALL_SCRIPT@
81 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
82 INSTALL_DATA = @INSTALL_DATA@
83
84 DESTDIR =
85
86 AR = @AR@
87 AR_FLAGS = qv
88 RANLIB = @RANLIB@
89 DLLTOOL = @DLLTOOL@
90 WINDRES = @WINDRES@
91 MIG = @MIG@
92 STRIP = @STRIP@
93
94 XGETTEXT = @XGETTEXT@
95 GMSGFMT = @GMSGFMT@
96 MSGMERGE = msgmerge
97
98 PACKAGE = @PACKAGE@
99 CATALOGS = @CATALOGS@
100
101 # If you are compiling with GCC, make sure that either 1) You have the
102 # fixed include files where GCC can reach them, or 2) You use the
103 # -traditional flag.  Otherwise the ioctl calls in inflow.c
104 # will be incorrectly compiled.  The "fixincludes" script in the gcc
105 # distribution will fix your include files up.
106 CC = @CC@
107 CXX = @CXX@
108 CXX_DIALECT = @CXX_DIALECT@
109
110 # Dependency tracking information.
111 DEPMODE = @CCDEPMODE@
112 DEPDIR = @DEPDIR@
113 depcomp = $(SHELL) $(srcdir)/../depcomp
114
115 # Directory containing source files.
116 srcdir = @srcdir@
117 VPATH = @srcdir@
118 top_srcdir = @top_srcdir@
119
120 include $(srcdir)/silent-rules.mk
121
122 # Note that these are overridden by GNU make-specific code below if
123 # GNU make is used.  The overrides implement dependency tracking.
124 COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
125 COMPILE.post = -c -o $@
126 COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
127 POSTCOMPILE = @true
128
129 YACC = @YACC@
130
131 # This is used to rebuild ada-lex.c from ada-lex.l.  If the program is
132 # not defined, but ada-lex.c is present, compilation will continue,
133 # possibly with a warning.
134 FLEX = flex
135
136 YLWRAP = $(srcdir)/../ylwrap
137
138 # where to find makeinfo, preferably one designed for texinfo-2
139 MAKEINFO = @MAKEINFO@
140 MAKEINFOFLAGS = @MAKEINFOFLAGS@
141 MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
142 MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
143
144 MAKEHTML = $(MAKEINFO_CMD) --html
145 MAKEHTMLFLAGS =
146
147 # Set this up with gcc if you have gnu ld and the loader will print out
148 # line numbers for undefined references.
149 #CC_LD = g++ -static
150 CC_LD = $(CXX) $(CXX_DIALECT)
151
152 # Where is our "include" directory?  Typically $(srcdir)/../include.
153 # This is essentially the header file directory for the library
154 # routines in libiberty.
155 INCLUDE_DIR = $(srcdir)/../include
156 INCLUDE_CFLAGS = -I$(INCLUDE_DIR)
157
158 # Where is the "-liberty" library?  Typically in ../libiberty.
159 LIBIBERTY = ../libiberty/libiberty.a
160
161 # Where is the BFD library?  Typically in ../bfd.
162 BFD_DIR = ../bfd
163 BFD = $(BFD_DIR)/libbfd.a
164 BFD_SRC = $(srcdir)/$(BFD_DIR)
165 BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
166
167 # This is where we get zlib from.  zlibdir is -L../zlib and zlibinc is
168 # -I../zlib, unless we were configured with --with-system-zlib, in which
169 # case both are empty.
170 ZLIB = @zlibdir@ -lz
171 ZLIBINC = @zlibinc@
172
173 # Where is the decnumber library?  Typically in ../libdecnumber.
174 LIBDECNUMBER_DIR = ../libdecnumber
175 LIBDECNUMBER = $(LIBDECNUMBER_DIR)/libdecnumber.a
176 LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUMBER_DIR)
177 LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
178
179 # Where is the READLINE library?  Typically in ../readline.
180 READLINE_DIR = ../readline
181 READLINE_SRC = $(srcdir)/$(READLINE_DIR)
182 READLINE = @READLINE@
183 READLINE_DEPS = @READLINE_DEPS@
184 READLINE_CFLAGS = @READLINE_CFLAGS@
185
186 # Where is expat?  This will be empty if expat was not available.
187 LIBEXPAT = @LIBEXPAT@
188
189 # Where is lzma?  This will be empty if lzma was not available.
190 LIBLZMA = @LIBLZMA@
191
192 # Where is libbabeltrace? This will be empty if lbabeltrace was not
193 # available.
194 LIBBABELTRACE = @LIBBABELTRACE@
195
196 # Where is libipt?  This will be empty if libipt was not available.
197 LIBIPT = @LIBIPT@
198
199 # Where is libmpfr?  This will be empty if libmpfr was not available.
200 LIBMPFR = @LIBMPFR@
201
202 WARN_CFLAGS = @WARN_CFLAGS@
203 WERROR_CFLAGS = @WERROR_CFLAGS@
204 GDB_WARN_CFLAGS = $(WARN_CFLAGS)
205 GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
206
207 GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
208                    | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
209 GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
210                    | sed "s/ -Wold-style-definition / -Wno-old-style-definition /g"`
211
212 RDYNAMIC = @RDYNAMIC@
213
214 # Where is the INTL library?  Typically in ../intl.
215 INTL = @LIBINTL@
216 INTL_DEPS = @LIBINTL_DEP@
217 INTL_CFLAGS = @INCINTL@
218
219 # Where is the ICONV library?  This will be empty if in libc or not available.
220 LIBICONV = @LIBICONV@
221
222 # Did the user give us a --with-gdb-datadir option?
223 GDB_DATADIR = @GDB_DATADIR@
224
225 # Code signing.
226 CODESIGN = codesign
227 CODESIGN_CERT = @CODESIGN_CERT@
228
229 # Flags to pass to gdb when invoked with "make run".
230 GDBFLAGS =
231
232 # Helper code from gnulib.
233 GNULIB_BUILDDIR = build-gnulib
234 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
235 INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import
236
237 # Generated headers in the gnulib directory.  These must be listed
238 # so that they are generated before other files are compiled.
239 GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
240
241 #
242 # CLI sub directory definitons
243 #
244 SUBDIR_CLI_SRCS = \
245         cli/cli-cmds.c \
246         cli/cli-decode.c \
247         cli/cli-dump.c \
248         cli/cli-interp.c \
249         cli/cli-logging.c \
250         cli/cli-script.c \
251         cli/cli-setshow.c \
252         cli/cli-utils.c
253
254 SUBDIR_CLI_OBS = $(patsubst %.c,%.o,$(SUBDIR_CLI_SRCS))
255
256 SUBDIR_CLI_DEPS =
257 SUBDIR_CLI_LDFLAGS =
258 SUBDIR_CLI_CFLAGS =
259
260 #
261 # MI sub directory definitons
262 #
263 SUBDIR_MI_SRCS = \
264         mi/mi-cmd-break.c \
265         mi/mi-cmd-catch.c \
266         mi/mi-cmd-disas.c \
267         mi/mi-cmd-env.c \
268         mi/mi-cmd-file.c \
269         mi/mi-cmd-info.c \
270         mi/mi-cmd-stack.c \
271         mi/mi-cmd-target.c \
272         mi/mi-cmd-var.c \
273         mi/mi-cmds.c \
274         mi/mi-console.c \
275         mi/mi-getopt.c \
276         mi/mi-interp.c \
277         mi/mi-main.c \
278         mi/mi-out.c \
279         mi/mi-parse.c \
280         mi/mi-symbol-cmds.c
281
282 SUBDIR_MI_OBS = $(patsubst %.c,%.o,$(SUBDIR_MI_SRCS))
283
284 SUBDIR_MI_DEPS =
285 SUBDIR_MI_LDFLAGS =
286 SUBDIR_MI_CFLAGS =
287
288 #
289 # TUI sub directory definitions
290 #
291 SUBDIR_TUI_SRCS = \
292         tui/tui.c \
293         tui/tui-command.c \
294         tui/tui-data.c \
295         tui/tui-disasm.c \
296         tui/tui-file.c \
297         tui/tui-hooks.c \
298         tui/tui-interp.c \
299         tui/tui-io.c \
300         tui/tui-layout.c \
301         tui/tui-out.c \
302         tui/tui-regs.c \
303         tui/tui-source.c \
304         tui/tui-stack.c \
305         tui/tui-win.c \
306         tui/tui-windata.c \
307         tui/tui-wingeneral.c \
308         tui/tui-winsource.c
309
310 SUBDIR_TUI_OBS = $(patsubst %.c,%.o,$(SUBDIR_TUI_SRCS))
311
312 SUBDIR_TUI_DEPS =
313 SUBDIR_TUI_LDFLAGS =
314 SUBDIR_TUI_CFLAGS = -DTUI=1
315
316 #
317 # GCC Compile support sub-directory definitions
318 #
319 SUBDIR_GCC_COMPILE_SRCS = \
320         compile/compile.c \
321         compile/compile-c-support.c \
322         compile/compile-c-symbols.c \
323         compile/compile-c-types.c \
324         compile/compile-loc2c.c \
325         compile/compile-object-load.c \
326         compile/compile-object-load.h \
327         compile/compile-object-run.c \
328         compile/compile-object-run.h
329
330 SUBDIR_GCC_COMPILE_OBS = $(patsubst %.c,%.o,$(filter %.c,$(SUBDIR_GCC_COMPILE_SRCS)))
331
332 #
333 # Guile sub directory definitons for guile support.
334 #
335 SUBDIR_GUILE_SRCS = \
336         guile/guile.c \
337         guile/scm-arch.c \
338         guile/scm-auto-load.c \
339         guile/scm-block.c \
340         guile/scm-breakpoint.c \
341         guile/scm-cmd.c \
342         guile/scm-disasm.c \
343         guile/scm-exception.c \
344         guile/scm-frame.c \
345         guile/scm-gsmob.c \
346         guile/scm-iterator.c \
347         guile/scm-lazy-string.c \
348         guile/scm-math.c \
349         guile/scm-objfile.c \
350         guile/scm-param.c \
351         guile/scm-ports.c \
352         guile/scm-pretty-print.c \
353         guile/scm-progspace.c \
354         guile/scm-safe-call.c \
355         guile/scm-string.c \
356         guile/scm-symbol.c \
357         guile/scm-symtab.c \
358         guile/scm-type.c \
359         guile/scm-utils.c \
360         guile/scm-value.c
361
362 SUBDIR_GUILE_OBS = $(patsubst %.c,%.o,$(SUBDIR_GUILE_SRCS))
363
364 SUBDIR_GUILE_DEPS =
365 SUBDIR_GUILE_LDFLAGS =
366 SUBDIR_GUILE_CFLAGS =
367
368 #
369 # python sub directory definitons
370 #
371 SUBDIR_PYTHON_SRCS = \
372         python/py-arch.c \
373         python/py-auto-load.c \
374         python/py-block.c \
375         python/py-bpevent.c \
376         python/py-breakpoint.c \
377         python/py-cmd.c \
378         python/py-continueevent.c \
379         python/py-event.c \
380         python/py-evtregistry.c \
381         python/py-evts.c \
382         python/py-exitedevent.c \
383         python/py-finishbreakpoint.c \
384         python/py-frame.c \
385         python/py-framefilter.c \
386         python/py-function.c \
387         python/py-gdb-readline.c \
388         python/py-inferior.c \
389         python/py-infevents.c \
390         python/py-infthread.c \
391         python/py-instruction.c \
392         python/py-lazy-string.c \
393         python/py-linetable.c \
394         python/py-newobjfileevent.c \
395         python/py-objfile.c \
396         python/py-param.c \
397         python/py-prettyprint.c \
398         python/py-progspace.c \
399         python/py-record.c \
400         python/py-record-btrace.c \
401         python/py-record-full.c \
402         python/py-signalevent.c \
403         python/py-stopevent.c \
404         python/py-symbol.c \
405         python/py-symtab.c \
406         python/py-threadevent.c \
407         python/py-type.c \
408         python/py-unwind.c \
409         python/py-utils.c \
410         python/py-value.c \
411         python/py-varobj.c \
412         python/py-xmethods.c \
413         python/python.c
414
415 SUBDIR_PYTHON_OBS = $(patsubst %.c,%.o,$(SUBDIR_PYTHON_SRCS))
416
417 SUBDIR_PYTHON_DEPS =
418 SUBDIR_PYTHON_LDFLAGS =
419 SUBDIR_PYTHON_CFLAGS =
420
421 SUBDIR_UNITTESTS_SRCS = \
422         unittests/array-view-selftests.c \
423         unittests/common-utils-selftests.c \
424         unittests/environ-selftests.c \
425         unittests/format_pieces-selftests.c \
426         unittests/function-view-selftests.c \
427         unittests/lookup_name_info-selftests.c \
428         unittests/memory-map-selftests.c \
429         unittests/memrange-selftests.c \
430         unittests/offset-type-selftests.c \
431         unittests/observable-selftests.c \
432         unittests/optional-selftests.c \
433         unittests/ptid-selftests.c \
434         unittests/rsp-low-selftests.c \
435         unittests/scoped_fd-selftests.c \
436         unittests/scoped_mmap-selftests.c \
437         unittests/scoped_restore-selftests.c \
438         unittests/string_view-selftests.c \
439         unittests/tracepoint-selftests.c \
440         unittests/unpack-selftests.c \
441         unittests/utils-selftests.c \
442         unittests/xml-utils-selftests.c
443
444 SUBDIR_UNITTESTS_OBS = $(patsubst %.c,%.o,$(SUBDIR_UNITTESTS_SRCS))
445
446 SUBDIR_TARGET_SRCS = target/waitstatus.c
447 SUBDIR_TARGET_OBS = $(patsubst %.c,%.o,$(SUBDIR_TARGET_SRCS))
448
449
450 # Opcodes currently live in one of two places.  Either they are in the
451 # opcode library, typically ../opcodes, or they are in a header file
452 # in INCLUDE_DIR.
453 # Where is the "-lopcodes" library, with (some of) the opcode tables and
454 # disassemblers?
455 OPCODES_DIR = ../opcodes
456 OPCODES_SRC = $(srcdir)/$(OPCODES_DIR)
457 OPCODES = $(OPCODES_DIR)/libopcodes.a
458 # Where are the other opcode tables which only have header file
459 # versions?
460 OP_INCLUDE = $(INCLUDE_DIR)/opcode
461 # Some source files like to use #include "opcodes/file.h"
462 OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
463
464 # The simulator is usually nonexistent; targets that include one
465 # should set this to list all the .o or .a files to be linked in.
466 SIM = @SIM@
467
468 WIN32LIBS = @WIN32LIBS@
469
470 # Tcl et al cflags and libraries
471 TCL = @TCL_LIBRARY@
472 TCL_CFLAGS = @TCL_INCLUDE@
473 GDBTKLIBS = @GDBTKLIBS@
474 # Extra flags that the GDBTK files need:
475 GDBTK_CFLAGS = @GDBTK_CFLAGS@
476
477 TK = @TK_LIBRARY@
478 TK_CFLAGS = @TK_INCLUDE@
479
480 X11_CFLAGS = @TK_XINCLUDES@
481 X11_LDFLAGS =
482 X11_LIBS =
483
484 WIN32LDAPP = @WIN32LDAPP@
485
486 LIBGUI = @LIBGUI@
487 GUI_CFLAGS_X = @GUI_CFLAGS_X@
488 IDE_CFLAGS = $(GUI_CFLAGS_X) $(IDE_CFLAGS_X)
489
490 ALL_TCL_CFLAGS = $(TCL_CFLAGS) $(TK_CFLAGS)
491
492 # The version of gdbtk we're building. This should be kept
493 # in sync with GDBTK_VERSION and friends in gdbtk.h.
494 GDBTK_VERSION = 1.0
495 GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION)
496
497 # Gdbtk requires an absolute path to the source directory or
498 # the testsuite won't run properly.
499 GDBTK_SRC_DIR = @GDBTK_SRC_DIR@
500
501 SUBDIR_GDBTK_OBS = \
502         gdbtk.o \
503         gdbtk-bp.o \
504         gdbtk-cmds.o \
505         gdbtk-hooks.o \
506         gdbtk-interp.o \
507         gdbtk-register.o \
508         gdbtk-stack.o \
509         gdbtk-varobj.o \
510         gdbtk-wrapper.o
511
512 SUBDIR_GDBTK_SRCS = \
513         gdbtk/generic/gdbtk.c \
514         gdbtk/generic/gdbtk-bp.c \
515         gdbtk/generic/gdbtk-cmds.c \
516         gdbtk/generic/gdbtk-hooks.c \
517         gdbtk/generic/gdbtk-interp.c \
518         gdbtk/generic/gdbtk-main.c \
519         gdbtk/generic/gdbtk-register.c \
520         gdbtk/generic/gdbtk-stack.c \
521         gdbtk/generic/gdbtk-varobj.c \
522         gdbtk/generic/gdbtk-wrapper.c
523
524 SUBDIR_GDBTK_DEPS = $(LIBGUI) $(TCL_DEPS) $(TK_DEPS)
525 SUBDIR_GDBTK_LDFLAGS =
526 SUBDIR_GDBTK_CFLAGS = -DGDBTK
527
528 CONFIG_OBS = @CONFIG_OBS@
529 CONFIG_SRCS = @CONFIG_SRCS@
530 CONFIG_DEPS = @CONFIG_DEPS@
531 CONFIG_LDFLAGS = @CONFIG_LDFLAGS@
532 ENABLE_CFLAGS = @ENABLE_CFLAGS@
533 CONFIG_ALL = @CONFIG_ALL@
534 CONFIG_CLEAN = @CONFIG_CLEAN@
535 CONFIG_INSTALL = @CONFIG_INSTALL@
536 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
537 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
538
539 CONFIG_SRC_SUBDIR = arch cli mi common compile tui unittests guile python target
540 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
541
542 # -I. for config files.
543 # -I$(srcdir) for gdb internal headers.
544 # -I$(srcdir)/config for more generic config files.
545
546 # It is also possible that you will need to add -I/usr/include/sys if
547 # your system doesn't have fcntl.h in /usr/include (which is where it
548 # should be according to Posix).
549 DEFS = @DEFS@
550 GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/common -I$(srcdir)/config \
551         -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
552
553 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
554 GLOBAL_CFLAGS = $(MH_CFLAGS)
555
556 PROFILE_CFLAGS = @PROFILE_CFLAGS@
557
558 # These are specifically reserved for setting from the command line
559 # when running make.  I.E.: "make CFLAGS=-Wmissing-prototypes".
560 CFLAGS = @CFLAGS@
561 CXXFLAGS = @CXXFLAGS@
562
563 # Set by configure, for e.g. expat.  Python installations are such that
564 # C headers are included using their basename (for example, we #include
565 # <Python.h> rather than, say, <python/Python.h>).  Since the file names
566 # are sometimes a little generic, we think that the risk of collision
567 # with other header files is high.  If that happens, we try to mitigate
568 # a bit the consequences by putting the Python includes last in the list.
569 INTERNAL_CPPFLAGS = @CPPFLAGS@ @GUILE_CPPFLAGS@ @PYTHON_CPPFLAGS@
570
571 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
572 INTERNAL_CFLAGS_BASE = \
573         $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
574         $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
575         $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
576         $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
577 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
578 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
579
580 # LDFLAGS is specifically reserved for setting from the command line
581 # when running make.
582 LDFLAGS = @LDFLAGS@
583
584 # Profiling options need to go here to work.
585 # I think it's perfectly reasonable for a user to set -pg in CFLAGS
586 # and have it work; that's why CFLAGS is here.
587 # PROFILE_CFLAGS is _not_ included, however, because we use monstartup.
588 INTERNAL_LDFLAGS = \
589         $(CXXFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) \
590         $(LDFLAGS) $(CONFIG_LDFLAGS)
591
592 # If your system is missing alloca(), or, more likely, it's there but
593 # it doesn't work, then refer to libiberty.
594
595 # Libraries and corresponding dependencies for compiling gdb.
596 # XM_CLIBS, defined in *config files, have host-dependent libs.
597 # LIBIBERTY appears twice on purpose.
598 CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(ZLIB) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
599         $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) \
600         @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
601         $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
602         $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR)
603 CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
604         $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
605
606 ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
607 ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
608
609 DIST = gdb
610
611 LINT = /usr/5bin/lint
612 LINTFLAGS = $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
613         $(BFD_CFLAGS) $(INCLUDE_CFLAGS) \
614         $(INTL_CFLAGS)
615
616 RUNTEST = runtest
617 RUNTESTFLAGS =
618
619 # XML files to build in to GDB.
620 XMLFILES = \
621         $(srcdir)/features/btrace.dtd \
622         $(srcdir)/features/btrace-conf.dtd \
623         $(srcdir)/features/gdb-target.dtd \
624         $(srcdir)/features/library-list.dtd \
625         $(srcdir)/features/library-list-aix.dtd \
626         $(srcdir)/features/library-list-svr4.dtd \
627         $(srcdir)/features/osdata.dtd \
628         $(srcdir)/features/threads.dtd \
629         $(srcdir)/features/traceframe-info.dtd \
630         $(srcdir)/features/xinclude.dtd
631
632 # Build the ser-*.o files the host supports.  This includes ser-unix.o
633 # for any system that supports a POSIX interface to the serial port.
634 # See configure.ac.
635 SER_HARDWIRE = @SER_HARDWIRE@
636
637 # This is remote-sim.o if a simulator is to be linked in.
638 SIM_OBS = @SIM_OBS@
639
640 # Target-dependent object files.
641 TARGET_OBS = @TARGET_OBS@
642
643 # All target-dependent objects files that require 64-bit CORE_ADDR
644 # (used with --enable-targets=all --enable-64-bit-bfd).
645 ALL_64_TARGET_OBS = \
646         aarch64-fbsd-tdep.o \
647         aarch64-linux-tdep.o \
648         aarch64-newlib-tdep.o \
649         aarch64-tdep.o \
650         alpha-bsd-tdep.o \
651         alpha-linux-tdep.o \
652         alpha-mdebug-tdep.o \
653         alpha-nbsd-tdep.o \
654         alpha-obsd-tdep.o \
655         alpha-tdep.o \
656         amd64-darwin-tdep.o \
657         amd64-dicos-tdep.o \
658         amd64-fbsd-tdep.o \
659         amd64-linux-tdep.o \
660         amd64-nbsd-tdep.o \
661         amd64-obsd-tdep.o \
662         amd64-sol2-tdep.o \
663         amd64-tdep.o \
664         amd64-windows-tdep.o \
665         arch/aarch64.o \
666         arch/aarch64-insn.o \
667         arch/amd64.o \
668         ia64-linux-tdep.o \
669         ia64-tdep.o \
670         ia64-vms-tdep.o \
671         mips64-obsd-tdep.o \
672         sparc64-fbsd-tdep.o \
673         sparc64-linux-tdep.o \
674         sparc64-nbsd-tdep.o \
675         sparc64-obsd-tdep.o \
676         sparc64-sol2-tdep.o \
677         sparc64-tdep.o
678
679 # All other target-dependent objects files (used with --enable-targets=all).
680 ALL_TARGET_OBS = \
681         arc-tdep.o \
682         arch/arm.o \
683         arch/arm-get-next-pcs.o \
684         arch/arm-linux.o \
685         arch/i386.o \
686         arch/ppc-linux-common.o \
687         arm-bsd-tdep.o \
688         arm-fbsd-tdep.o \
689         arm-linux-tdep.o \
690         arm-nbsd-tdep.o \
691         arm-obsd-tdep.o \
692         arm-symbian-tdep.o \
693         arm-tdep.o \
694         arm-wince-tdep.o \
695         avr-tdep.o \
696         bfin-linux-tdep.o \
697         bfin-tdep.o \
698         bsd-uthread.o \
699         cris-linux-tdep.o \
700         cris-tdep.o \
701         dicos-tdep.o \
702         fbsd-tdep.o \
703         frv-linux-tdep.o \
704         frv-tdep.o \
705         ft32-tdep.o \
706         glibc-tdep.o \
707         h8300-tdep.o \
708         hppa-bsd-tdep.o \
709         hppa-linux-tdep.o \
710         hppa-nbsd-tdep.o \
711         hppa-obsd-tdep.o \
712         hppa-tdep.o \
713         i386-bsd-tdep.o \
714         i386-cygwin-tdep.o \
715         i386-darwin-tdep.o \
716         i386-dicos-tdep.o \
717         i386-fbsd-tdep.o \
718         i386-gnu-tdep.o \
719         i386-go32-tdep.o \
720         i386-linux-tdep.o \
721         i386-nbsd-tdep.o \
722         i386-nto-tdep.o \
723         i386-obsd-tdep.o \
724         i386-sol2-tdep.o \
725         i386-tdep.o \
726         i387-tdep.o \
727         iq2000-tdep.o \
728         linux-record.o \
729         linux-tdep.o \
730         lm32-tdep.o \
731         m32c-tdep.o \
732         m32r-linux-tdep.o \
733         m32r-tdep.o \
734         m68hc11-tdep.o \
735         m68k-bsd-tdep.o \
736         m68k-linux-tdep.o \
737         m68k-tdep.o \
738         mep-tdep.o \
739         microblaze-linux-tdep.o \
740         microblaze-tdep.o \
741         mips-fbsd-tdep.o \
742         mips-linux-tdep.o \
743         mips-nbsd-tdep.o \
744         mips-sde-tdep.o \
745         mips-tdep.o \
746         mn10300-linux-tdep.o \
747         mn10300-tdep.o \
748         moxie-tdep.o \
749         msp430-tdep.o \
750         nbsd-tdep.o \
751         nds32-tdep.o \
752         nios2-linux-tdep.o \
753         nios2-tdep.o \
754         nto-tdep.o \
755         obsd-tdep.o \
756         or1k-tdep.o \
757         ppc-fbsd-tdep.o \
758         ppc-linux-tdep.o \
759         ppc-nbsd-tdep.o \
760         ppc-obsd-tdep.o \
761         ppc-ravenscar-thread.o \
762         ppc-sysv-tdep.o \
763         ppc64-tdep.o \
764         ravenscar-thread.o \
765         riscv-tdep.o \
766         rl78-tdep.o \
767         rs6000-aix-tdep.o \
768         rs6000-lynx178-tdep.o \
769         rs6000-tdep.o \
770         rx-tdep.o \
771         s390-linux-tdep.o \
772         s390-tdep.o \
773         score-tdep.o \
774         sh-linux-tdep.o \
775         sh-nbsd-tdep.o \
776         sh-tdep.o \
777         sol2-tdep.o \
778         solib-aix.o \
779         solib-darwin.o \
780         solib-dsbt.o \
781         solib-frv.o \
782         solib-spu.o \
783         solib-svr4.o \
784         sparc-linux-tdep.o \
785         sparc-nbsd-tdep.o \
786         sparc-obsd-tdep.o \
787         sparc-ravenscar-thread.o \
788         sparc-sol2-tdep.o \
789         sparc-tdep.o \
790         spu-multiarch.o \
791         spu-tdep.o \
792         symfile-mem.o \
793         tic6x-linux-tdep.o \
794         tic6x-tdep.o \
795         tilegx-linux-tdep.o \
796         tilegx-tdep.o \
797         v850-tdep.o \
798         vax-nbsd-tdep.o \
799         vax-tdep.o \
800         windows-tdep.o \
801         x86-tdep.o \
802         xcoffread.o \
803         xstormy16-tdep.o \
804         xtensa-config.o \
805         xtensa-linux-tdep.o \
806         xtensa-tdep.o
807
808 # The following native-target dependent variables are defined on
809 # configure.nat.
810 NAT_FILE = @NAT_FILE@
811 NATDEPFILES = @NATDEPFILES@
812 NAT_CDEPS = @NAT_CDEPS@
813 LOADLIBES = @LOADLIBES@
814 MH_CFLAGS = @MH_CFLAGS@
815 XM_CLIBS = @XM_CLIBS@
816 NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
817 HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
818
819 # Native-target dependent makefile fragment comes in here.
820 @nat_makefile_frag@
821
822 # End of native-target dependent variables.
823
824 FLAGS_TO_PASS = \
825         "prefix=$(prefix)" \
826         "exec_prefix=$(exec_prefix)" \
827         "infodir=$(infodir)" \
828         "datarootdir=$(datarootdir)" \
829         "docdir=$(docdir)" \
830         "htmldir=$(htmldir)" \
831         "pdfdir=$(pdfdir)" \
832         "libdir=$(libdir)" \
833         "mandir=$(mandir)" \
834         "datadir=$(datadir)" \
835         "includedir=$(includedir)" \
836         "against=$(against)" \
837         "DESTDIR=$(DESTDIR)" \
838         "AR=$(AR)" \
839         "AR_FLAGS=$(AR_FLAGS)" \
840         "CC=$(CC)" \
841         "CFLAGS=$(CFLAGS)" \
842         "CXX=$(CXX)" \
843         "CXX_DIALECT=$(CXX_DIALECT)" \
844         "CXXFLAGS=$(CXXFLAGS)" \
845         "DLLTOOL=$(DLLTOOL)" \
846         "LDFLAGS=$(LDFLAGS)" \
847         "RANLIB=$(RANLIB)" \
848         "MAKEINFO=$(MAKEINFO)" \
849         "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
850         "MAKEINFO_EXTRA_FLAGS=$(MAKEINFO_EXTRA_FLAGS)" \
851         "MAKEHTML=$(MAKEHTML)" \
852         "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
853         "INSTALL=$(INSTALL)" \
854         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
855         "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
856         "INSTALL_DATA=$(INSTALL_DATA)" \
857         "RUNTEST=$(RUNTEST)" \
858         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
859
860 # Flags that we pass when building the testsuite.
861
862 # empty for native, $(target_alias)/ for cross
863 target_subdir = @target_subdir@
864
865 CC_FOR_TARGET = ` \
866   if [ -f $${rootme}/../gcc/xgcc ] ; then \
867     if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \
868       echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -idirafter $${rootme}/$(target_subdir)newlib/targ-include -idirafter $${rootsrc}/../$(target_subdir)newlib/libc/include -nostdinc -B$${rootme}/../$(target_subdir)newlib/; \
869     else \
870       echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
871     fi; \
872   else \
873     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
874       echo $(CC); \
875     else \
876       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
877     fi; \
878   fi`
879
880 CXX_FOR_TARGET = ` \
881   if [ -f $${rootme}/../gcc/xg++ ] ; then \
882     if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \
883       echo $${rootme}/../gcc/xg++ -B$${rootme}/../gcc/ -idirafter $${rootme}/$(target_subdir)newlib/targ-include -idirafter $${rootsrc}/../$(target_subdir)newlib/libc/include -nostdinc -B$${rootme}/../$(target_subdir)newlib/; \
884     else \
885       echo $${rootme}/../gcc/xg++ -B$${rootme}/../gcc/; \
886     fi; \
887   else \
888     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
889       echo $(CXX); \
890     else \
891       t='$(program_transform_name)'; echo g++ | sed -e '' $$t; \
892     fi; \
893   fi`
894
895 # The use of $$(x_FOR_TARGET) reduces the command line length by not
896 # duplicating the lengthy definition.
897 TARGET_FLAGS_TO_PASS = \
898         "prefix=$(prefix)" \
899         "exec_prefix=$(exec_prefix)" \
900         "against=$(against)" \
901         'CC=$$(CC_FOR_TARGET)' \
902         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
903         "CFLAGS=$(CFLAGS)" \
904         'CXX=$$(CXX_FOR_TARGET)' \
905         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
906         "CXXFLAGS=$(CXXFLAGS)" \
907         "INSTALL=$(INSTALL)" \
908         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
909         "INSTALL_DATA=$(INSTALL_DATA)" \
910         "MAKEINFO=$(MAKEINFO)" \
911         "MAKEHTML=$(MAKEHTML)" \
912         "RUNTEST=$(RUNTEST)" \
913         "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
914         "FORCE_PARALLEL=$(FORCE_PARALLEL)" \
915         "TESTS=$(TESTS)"
916
917 # All source files that go into linking GDB.
918
919 # Files that should wind up in SFILES and whose corresponding .o
920 # should be in COMMON_OBS.
921 COMMON_SFILES = \
922         ada-lang.c \
923         ada-tasks.c \
924         ada-typeprint.c \
925         ada-valprint.c \
926         ada-varobj.c \
927         addrmap.c \
928         agent.c \
929         annotate.c \
930         arch-utils.c \
931         auto-load.c \
932         auxv.c \
933         ax-gdb.c \
934         ax-general.c \
935         bcache.c \
936         bfd-target.c \
937         block.c \
938         blockframe.c \
939         break-catch-sig.c \
940         break-catch-syscall.c \
941         break-catch-throw.c \
942         breakpoint.c \
943         btrace.c \
944         build-id.c \
945         buildsym.c \
946         c-lang.c \
947         c-typeprint.c \
948         c-valprint.c \
949         c-varobj.c \
950         charset.c \
951         cli-out.c \
952         coff-pe-read.c \
953         coffread.c \
954         common/agent.c \
955         common/btrace-common.c \
956         common/buffer.c \
957         common/cleanups.c \
958         common/common-debug.c \
959         common/common-exceptions.c \
960         common/common-regcache.c \
961         common/common-utils.c \
962         common/errors.c \
963         common/environ.c \
964         common/fileio.c \
965         common/filestuff.c \
966         common/format.c \
967         common/job-control.c \
968         common/gdb_tilde_expand.c \
969         common/gdb_vecs.c \
970         common/new-op.c \
971         common/pathstuff.c \
972         common/print-utils.c \
973         common/ptid.c \
974         common/rsp-low.c \
975         common/run-time-clock.c \
976         common/signals.c \
977         common/signals-state-save-restore.c \
978         common/tdesc.c \
979         common/vec.c \
980         common/xml-utils.c \
981         complaints.c \
982         completer.c \
983         continuations.c \
984         copying.c \
985         corefile.c \
986         corelow.c \
987         cp-abi.c \
988         cp-namespace.c \
989         cp-support.c \
990         cp-valprint.c \
991         ctf.c \
992         d-lang.c \
993         d-namespace.c \
994         d-valprint.c \
995         dbxread.c \
996         dcache.c \
997         debug.c \
998         demangle.c \
999         dictionary.c \
1000         disasm.c \
1001         disasm-selftests.c \
1002         dummy-frame.c \
1003         dwarf-index-common.c \
1004         dwarf-index-write.c \
1005         dwarf2-frame.c \
1006         dwarf2-frame-tailcall.c \
1007         dwarf2expr.c \
1008         dwarf2loc.c \
1009         dwarf2read.c \
1010         eval.c \
1011         event-loop.c \
1012         event-top.c \
1013         exceptions.c \
1014         expprint.c \
1015         extension.c \
1016         f-lang.c \
1017         f-typeprint.c \
1018         f-valprint.c \
1019         filename-seen-cache.c \
1020         filesystem.c \
1021         findcmd.c \
1022         findvar.c \
1023         frame.c \
1024         frame-base.c \
1025         frame-unwind.c \
1026         gcore.c \
1027         gdb_bfd.c \
1028         gdb-dlfcn.c \
1029         gdb_obstack.c \
1030         gdb_regex.c \
1031         gdb_usleep.c \
1032         gdbarch.c \
1033         gdbarch-selftests.c \
1034         gdbtypes.c \
1035         gnu-v2-abi.c \
1036         gnu-v3-abi.c \
1037         go-lang.c \
1038         go-typeprint.c \
1039         go-valprint.c \
1040         inf-child.c \
1041         inf-loop.c \
1042         infcall.c \
1043         infcmd.c \
1044         inferior.c \
1045         infrun.c \
1046         inline-frame.c \
1047         interps.c \
1048         jit.c \
1049         language.c \
1050         linespec.c \
1051         location.c \
1052         m2-lang.c \
1053         m2-typeprint.c \
1054         m2-valprint.c \
1055         macrocmd.c \
1056         macroexp.c \
1057         macroscope.c \
1058         macrotab.c \
1059         main.c \
1060         maint.c \
1061         mdebugread.c \
1062         mem-break.c \
1063         memattr.c \
1064         memory-map.c \
1065         memrange.c \
1066         minidebug.c \
1067         minsyms.c \
1068         mipsread.c \
1069         namespace.c \
1070         objc-lang.c \
1071         objfiles.c \
1072         observable.c \
1073         opencl-lang.c \
1074         osabi.c \
1075         osdata.c \
1076         p-lang.c \
1077         p-typeprint.c \
1078         p-valprint.c \
1079         parse.c \
1080         printcmd.c \
1081         probe.c \
1082         producer.c \
1083         progspace.c \
1084         progspace-and-thread.c \
1085         prologue-value.c \
1086         psymtab.c \
1087         record.c \
1088         record-btrace.c \
1089         record-full.c \
1090         regcache.c \
1091         regcache-dump.c \
1092         reggroups.c \
1093         registry.c \
1094         remote.c \
1095         remote-fileio.c \
1096         remote-notif.c \
1097         reverse.c \
1098         rust-lang.c \
1099         sentinel-frame.c \
1100         ser-event.c \
1101         serial.c \
1102         skip.c \
1103         solib.c \
1104         solib-target.c \
1105         source.c \
1106         stabsread.c \
1107         stack.c \
1108         std-regs.c \
1109         symfile.c \
1110         symfile-debug.c \
1111         symmisc.c \
1112         symtab.c \
1113         target.c \
1114         target-dcache.c \
1115         target-descriptions.c \
1116         target-memory.c \
1117         thread.c \
1118         thread-fsm.c \
1119         tid-parse.c \
1120         top.c \
1121         tracefile.c \
1122         tracefile-tfile.c \
1123         tracepoint.c \
1124         trad-frame.c \
1125         tramp-frame.c \
1126         target-float.c \
1127         typeprint.c \
1128         ui-file.c \
1129         ui-out.c \
1130         user-regs.c \
1131         utils.c \
1132         valarith.c \
1133         valops.c \
1134         valprint.c \
1135         value.c \
1136         varobj.c \
1137         xml-support.c \
1138         xml-syscall.c \
1139         xml-tdesc.c
1140
1141 # Links made at configuration time should not be specified here, since
1142 # SFILES is used in building the distribution archive.
1143 SFILES = \
1144         ada-exp.y \
1145         arch/i386.c \
1146         c-exp.y \
1147         cp-name-parser.y \
1148         d-exp.y \
1149         dtrace-probe.c \
1150         elfread.c \
1151         f-exp.y \
1152         gdb.c \
1153         go-exp.y \
1154         inflow.c \
1155         m2-exp.y \
1156         p-exp.y \
1157         proc-service.list \
1158         rust-exp.y \
1159         ser-base.c \
1160         ser-unix.c \
1161         sol-thread.c \
1162         stap-probe.c \
1163         stub-termcap.c \
1164         symfile-mem.c \
1165         ui-file.h \
1166         mi/mi-common.c \
1167         $(SUBDIR_TARGET_SRCS) \
1168         $(COMMON_SFILES) \
1169         $(SUBDIR_GCC_COMPILE_SRCS)
1170
1171 LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
1172
1173 # Header files that need to have srcdir added.  Note that in the cases
1174 # where we use a macro like $(gdbcmd_h), things are carefully arranged
1175 # so that each .h file is listed exactly once (M-x tags-search works
1176 # wrong if TAGS has files twice).  Because this is tricky to get
1177 # right, it is probably easiest just to list .h files here directly.
1178
1179 HFILES_NO_SRCDIR = \
1180         aarch64-tdep.h \
1181         ada-lang.h \
1182         addrmap.h \
1183         alpha-bsd-tdep.h \
1184         alpha-tdep.h \
1185         amd64-darwin-tdep.h \
1186         amd64-linux-tdep.h \
1187         amd64-nat.h \
1188         amd64-tdep.h \
1189         annotate.h \
1190         arc-tdep.h \
1191         arch-utils.h \
1192         arm-linux-tdep.h \
1193         arm-tdep.h \
1194         auto-load.h \
1195         auxv.h \
1196         ax.h \
1197         ax-gdb.h \
1198         bcache.h \
1199         bfd-target.h \
1200         bfin-tdep.h \
1201         block.h \
1202         breakpoint.h \
1203         bsd-kvm.h \
1204         bsd-uthread.h \
1205         build-id.h \
1206         buildsym.h \
1207         c-lang.h \
1208         charset.h \
1209         charset-list.h \
1210         cli-out.h \
1211         coff-pe-read.h \
1212         command.h \
1213         complaints.h \
1214         completer.h \
1215         cp-abi.h \
1216         cp-support.h \
1217         ctf.h \
1218         d-lang.h \
1219         darwin-nat.h \
1220         dcache.h \
1221         defs.h \
1222         dicos-tdep.h \
1223         dictionary.h \
1224         disasm.h \
1225         dummy-frame.h \
1226         dwarf-index-common.h \
1227         dwarf2-frame.h \
1228         dwarf2-frame-tailcall.h \
1229         dwarf2expr.h \
1230         dwarf2loc.h \
1231         dwarf2read.h \
1232         event-loop.h \
1233         event-top.h \
1234         exceptions.h \
1235         exec.h \
1236         expression.h \
1237         extension.h \
1238         extension-priv.h \
1239         f-lang.h \
1240         fbsd-nat.h \
1241         fbsd-tdep.h \
1242         filesystem.h \
1243         frame.h \
1244         frame-base.h \
1245         frame-unwind.h \
1246         frv-tdep.h \
1247         ft32-tdep.h \
1248         gcore.h \
1249         gdb_bfd.h \
1250         gdb_curses.h \
1251         gdb-dlfcn.h \
1252         gdb_expat.h \
1253         gdb_obstack.h \
1254         gdb_proc_service.h \
1255         gdb_regex.h \
1256         gdb_select.h \
1257         gdb-stabs.h \
1258         gdb_usleep.h \
1259         gdb_vfork.h \
1260         gdb_wchar.h \
1261         gdbarch.h \
1262         gdbcmd.h \
1263         gdbcore.h \
1264         gdbthread.h \
1265         gdbtypes.h \
1266         glibc-tdep.h \
1267         gnu-nat.h \
1268         go-lang.h \
1269         gregset.h \
1270         hppa-bsd-tdep.h \
1271         hppa-linux-offsets.h \
1272         hppa-tdep.h \
1273         i386-bsd-nat.h \
1274         i386-darwin-tdep.h \
1275         i386-linux-nat.h \
1276         i386-linux-tdep.h \
1277         i386-tdep.h \
1278         i387-tdep.h \
1279         ia64-libunwind-tdep.h \
1280         ia64-tdep.h \
1281         inf-child.h \
1282         inf-loop.h \
1283         inf-ptrace.h \
1284         infcall.h \
1285         inferior.h \
1286         inflow.h \
1287         inline-frame.h \
1288         interps.h \
1289         jit.h \
1290         language.h \
1291         linespec.h \
1292         linux-fork.h \
1293         linux-nat.h \
1294         linux-record.h \
1295         linux-tdep.h \
1296         location.h \
1297         m2-lang.h \
1298         m32r-tdep.h \
1299         m68k-tdep.h \
1300         macroexp.h \
1301         macroscope.h \
1302         macrotab.h \
1303         main.h \
1304         mdebugread.h \
1305         memattr.h \
1306         memory-map.h \
1307         memrange.h \
1308         microblaze-tdep.h \
1309         mips-linux-tdep.h \
1310         mips-nbsd-tdep.h \
1311         mips-tdep.h \
1312         mn10300-tdep.h \
1313         moxie-tdep.h \
1314         nbsd-nat.h \
1315         nbsd-tdep.h \
1316         nds32-tdep.h \
1317         nios2-tdep.h \
1318         nto-tdep.h \
1319         objc-lang.h \
1320         objfiles.h \
1321         obsd-nat.h \
1322         obsd-tdep.h \
1323         osabi.h \
1324         osdata.h \
1325         p-lang.h \
1326         parser-defs.h \
1327         ppc-fbsd-tdep.h \
1328         ppc-linux-tdep.h \
1329         ppc-nbsd-tdep.h \
1330         ppc-obsd-tdep.h \
1331         ppc-ravenscar-thread.h \
1332         ppc-tdep.h \
1333         ppc64-tdep.h \
1334         probe.h \
1335         proc-utils.h \
1336         procfs.h \
1337         progspace.h \
1338         progspace-and-thread.h \
1339         prologue-value.h \
1340         psympriv.h \
1341         psymtab.h \
1342         ravenscar-thread.h \
1343         record.h \
1344         record-full.h \
1345         regcache.h \
1346         reggroups.h \
1347         regset.h \
1348         remote.h \
1349         remote-fileio.h \
1350         remote-notif.h \
1351         riscv-tdep.h \
1352         rs6000-aix-tdep.h \
1353         rs6000-tdep.h \
1354         s390-linux-tdep.h \
1355         s390-tdep.h \
1356         score-tdep.h \
1357         selftest-arch.h \
1358         sentinel-frame.h \
1359         ser-base.h \
1360         ser-event.h \
1361         ser-tcp.h \
1362         ser-unix.h \
1363         serial.h \
1364         sh-tdep.h \
1365         sim-regno.h \
1366         skip.h \
1367         sol2-tdep.h \
1368         solib.h \
1369         solib-aix.h \
1370         solib-darwin.h \
1371         solib-spu.h \
1372         solib-svr4.h \
1373         solib-target.h \
1374         solist.h \
1375         source.h \
1376         sparc-nat.h \
1377         sparc-ravenscar-thread.h \
1378         sparc-tdep.h \
1379         sparc64-tdep.h \
1380         spu-tdep.h \
1381         stabsread.h \
1382         stack.h \
1383         stap-probe.h \
1384         symfile.h \
1385         symtab.h \
1386         target.h \
1387         target-dcache.h \
1388         target-descriptions.h \
1389         terminal.h \
1390         tid-parse.h \
1391         top.h \
1392         tracefile.h \
1393         tracepoint.h \
1394         trad-frame.h \
1395         target-float.h \
1396         tramp-frame.h \
1397         typeprint.h \
1398         ui-file.h \
1399         ui-out.h \
1400         user-regs.h \
1401         utils.h \
1402         valprint.h \
1403         value.h \
1404         varobj.h \
1405         varobj-iter.h \
1406         vax-tdep.h \
1407         windows-nat.h \
1408         windows-tdep.h \
1409         x86-bsd-nat.h \
1410         x86-linux-nat.h \
1411         x86-nat.h \
1412         xcoffread.h \
1413         xml-support.h \
1414         xml-syscall.h \
1415         xml-tdesc.h \
1416         xtensa-tdep.h \
1417         arch/aarch64.h \
1418         arch/aarch64-insn.h \
1419         arch/arm.h \
1420         arch/i386.h \
1421         arch/ppc-linux-common.h \
1422         arch/ppc-linux-tdesc.h \
1423         cli/cli-cmds.h \
1424         cli/cli-decode.h \
1425         cli/cli-script.h \
1426         cli/cli-setshow.h \
1427         cli/cli-utils.h \
1428         common/buffer.h \
1429         common/cleanups.h \
1430         common/common-debug.h \
1431         common/common-defs.h \
1432         common/common-exceptions.h \
1433         common/common-gdbthread.h \
1434         common/common-regcache.h \
1435         common/common-types.h \
1436         common/common-utils.h \
1437         common/job-control.h \
1438         common/errors.h \
1439         common/environ.h \
1440         common/fileio.h \
1441         common/format.h \
1442         common/gdb_assert.h \
1443         common/gdb_tilde_expand.h \
1444         common/gdb_locale.h \
1445         common/gdb_setjmp.h \
1446         common/gdb_signals.h \
1447         common/gdb_sys_time.h \
1448         common/gdb_vecs.h \
1449         common/gdb_wait.h \
1450         common/common-inferior.h \
1451         common/host-defs.h \
1452         common/pathstuff.h \
1453         common/print-utils.h \
1454         common/ptid.h \
1455         common/queue.h \
1456         common/rsp-low.h \
1457         common/run-time-clock.h \
1458         common/signals-state-save-restore.h \
1459         common/symbol.h \
1460         common/tdesc.h \
1461         common/vec.h \
1462         common/version.h \
1463         common/x86-xstate.h \
1464         common/xml-utils.h \
1465         compile/compile.h \
1466         config/nm-linux.h \
1467         config/nm-nto.h \
1468         config/djgpp/langinfo.h \
1469         config/djgpp/nl_types.h \
1470         config/i386/nm-fbsd.h \
1471         config/i386/nm-i386gnu.h \
1472         config/sparc/nm-sol2.h \
1473         gnulib/import/inttypes.in.h \
1474         gnulib/import/stddef.in.h \
1475         gnulib/import/stdint.in.h \
1476         gnulib/import/str-two-way.h \
1477         gnulib/import/string.in.h \
1478         gnulib/import/extra/snippet/arg-nonnull.h \
1479         gnulib/import/extra/snippet/c++defs.h \
1480         gnulib/import/extra/snippet/warn-on-use.h \
1481         mi/mi-cmds.h \
1482         mi/mi-common.h \
1483         mi/mi-console.h \
1484         mi/mi-getopt.h \
1485         mi/mi-main.h \
1486         mi/mi-out.h \
1487         mi/mi-parse.h \
1488         nat/aarch64-linux.h \
1489         nat/aarch64-linux-hw-point.h \
1490         nat/aarch64-sve-linux-ptrace.h \
1491         nat/amd64-linux-siginfo.h \
1492         nat/gdb_ptrace.h \
1493         nat/gdb_thread_db.h \
1494         nat/fork-inferior.h \
1495         nat/linux-btrace.h \
1496         nat/linux-namespaces.h \
1497         nat/linux-nat.h \
1498         nat/linux-osdata.h \
1499         nat/linux-personality.h \
1500         nat/linux-ptrace.h \
1501         nat/linux-waitpid.h \
1502         nat/mips-linux-watch.h \
1503         nat/ppc-linux.h \
1504         nat/x86-cpuid.h \
1505         nat/x86-dregs.h \
1506         nat/x86-gcc-cpuid.h \
1507         nat/x86-linux.h \
1508         nat/x86-linux-dregs.h \
1509         python/py-event.h \
1510         python/py-events.h \
1511         python/py-stopevent.h \
1512         python/python.h \
1513         python/python-internal.h \
1514         regformats/regdef.h \
1515         target/resume.h \
1516         target/target.h \
1517         target/wait.h \
1518         target/waitstatus.h \
1519         tui/tui.h \
1520         tui/tui-command.h \
1521         tui/tui-data.h \
1522         tui/tui-disasm.h \
1523         tui/tui-file.h \
1524         tui/tui-hooks.h \
1525         tui/tui-io.h \
1526         tui/tui-layout.h \
1527         tui/tui-regs.h \
1528         tui/tui-source.h \
1529         tui/tui-stack.h \
1530         tui/tui-win.h \
1531         tui/tui-windata.h \
1532         tui/tui-wingeneral.h \
1533         tui/tui-winsource.h \
1534         x86-tdep.h
1535
1536 # Header files that already have srcdir in them, or which are in objdir.
1537
1538 HFILES_WITH_SRCDIR = \
1539         ../bfd/bfd.h \
1540         jit-reader.h
1541
1542 # GDB "info" files, which should be included in their entirety
1543 INFOFILES = gdb.info*
1544
1545 # {X,T,NAT}DEPFILES are something of a pain in that it's hard to
1546 # default their values the way we do for SER_HARDWIRE; in the future
1547 # maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
1548 # variables analogous to SER_HARDWIRE which get defaulted in this
1549 # Makefile.in
1550
1551 DEPFILES = $(TARGET_OBS) $(SER_HARDWIRE) $(NATDEPFILES) $(SIM_OBS)
1552
1553 SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS)
1554 # Don't include YYFILES (*.c) because we already include *.y in SFILES,
1555 # and it's more useful to see it in the .y file.
1556 TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
1557         $(CONFIG_SRCS)
1558 TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
1559
1560 COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
1561         exec.o \
1562         mi/mi-common.o \
1563         version.o \
1564         xml-builtin.o \
1565         $(patsubst %.c,%.o,$(COMMON_SFILES)) \
1566         $(SUBDIR_TARGET_OBS) \
1567         $(SUBDIR_GCC_COMPILE_OBS)
1568
1569 TSOBS = inflow.o
1570
1571 SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
1572 CLEANDIRS = $(SUBDIRS)
1573
1574 # List of subdirectories in the build tree that must exist.
1575 # This is used to force build failures in existing trees when
1576 # a new directory is added.
1577 # The format here is for the `case' shell command.
1578 REQUIRED_SUBDIRS = doc | testsuite | $(GNULIB_BUILDDIR) | data-directory
1579
1580 # Parser intermediate files.
1581 YYFILES = \
1582         ada-exp.c \
1583         ada-lex.c \
1584         c-exp.c \
1585         cp-name-parser.c \
1586         d-exp.c \
1587         f-exp.c \
1588         go-exp.c \
1589         m2-exp.c \
1590         p-exp.c \
1591         rust-exp.c
1592
1593 # ada-lex.c is included by another file, so it shouldn't wind up as a
1594 # .o itself.
1595 YYOBJ = $(filter-out ada-lex.o,$(patsubst %.c,%.o,$(YYFILES)))
1596
1597 # Things which need to be built when making a distribution.
1598
1599 DISTSTUFF = $(YYFILES)
1600
1601
1602 # All generated files which can be included by another file.
1603 generated_files = \
1604         ada-lex.c \
1605         config.h \
1606         gcore \
1607         jit-reader.h \
1608         $(GNULIB_H) \
1609         $(NAT_GENERATED_FILES)
1610
1611 # Flags needed to compile Python code
1612 PYTHON_CFLAGS = @PYTHON_CFLAGS@
1613
1614 all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb
1615         @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
1616
1617 # Rule for compiling .c files in the top-level gdb directory.
1618 # The order-only dependencies ensure that we create the build subdirectories.
1619 %.o: %.c | $(CONFIG_DEP_SUBDIR)
1620         $(COMPILE) $<
1621         $(POSTCOMPILE)
1622
1623 $(CONFIG_DEP_SUBDIR):
1624         $(SHELL) $(srcdir)/../mkinstalldirs $@
1625
1626 # Python files need special flags.
1627 python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
1628
1629 # Rules for compiling .c files in the various source subdirectories.
1630 %.o: $(srcdir)/gdbtk/generic/%.c
1631         $(COMPILE) $(all_gdbtk_cflags) $<
1632         $(POSTCOMPILE)
1633
1634 %.o: ${srcdir}/nat/%.c
1635         $(COMPILE) $<
1636         $(POSTCOMPILE)
1637
1638 installcheck:
1639
1640 # The check target can not use subdir_do, because subdir_do does not
1641 # use TARGET_FLAGS_TO_PASS.
1642 check: force
1643         @if [ -f testsuite/Makefile ]; then \
1644           rootme=`pwd`; export rootme; \
1645           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1646           cd testsuite; \
1647           $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
1648         else true; fi
1649
1650 check-perf: force
1651         @if [ -f testsuite/Makefile ]; then \
1652           rootme=`pwd`; export rootme; \
1653           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1654           cd testsuite; \
1655           $(MAKE) $(TARGET_FLAGS_TO_PASS) check-perf; \
1656         else true; fi
1657
1658 check-read1: force
1659         @if [ -f testsuite/Makefile ]; then \
1660           rootme=`pwd`; export rootme; \
1661           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1662           cd testsuite; \
1663           $(MAKE) $(TARGET_FLAGS_TO_PASS) check-read1; \
1664         else true; fi
1665
1666 check-parallel: force
1667         @if [ -f testsuite/Makefile ]; then \
1668           rootme=`pwd`; export rootme; \
1669           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1670           cd testsuite; \
1671           $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
1672         else true; fi
1673
1674 # The idea is to parallelize testing of multilibs, for example:
1675 #   make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
1676 # will run 3 concurrent sessions of check, eventually testing all 10
1677 # combinations.  GNU make is required for the % pattern to work, as is
1678 # a shell that expands alternations within braces.  If GNU make is not
1679 # used, this rule will harmlessly fail to match.  Used FORCE_PARALLEL to
1680 # prevent serialized checking due to the passed RUNTESTFLAGS.
1681 # FIXME: use config.status --config not --version, when available.
1682 check//%: force
1683         @if [ -f testsuite/config.status ]; then \
1684           rootme=`pwd`; export rootme; \
1685           rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1686           target=`echo "$@" | sed 's,//.*,,'`; \
1687           variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
1688           vardots=`echo "$$variant" | sed 's,/,.,g'`; \
1689           testdir=testsuite.$$vardots; \
1690           if [ ! -f $$testdir/Makefile ] && [ -f testsuite/config.status ]; then \
1691             configargs=`cd testsuite && ./config.status --version | \
1692               sed -n -e 's,"$$,,' -e 's,^ *with options ",,p'`; \
1693             $(SHELL) $(srcdir)/../mkinstalldirs $$testdir && \
1694             (cd $$testdir && \
1695              eval $(SHELL) "\"\$$rootsrc/testsuite/configure\" $$configargs" \
1696                            "\"--srcdir=\$$rootsrc/testsuite\"" \
1697              ); \
1698           else :; fi && cd $$testdir && \
1699           $(MAKE) $(TARGET_FLAGS_TO_PASS) \
1700             RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
1701             FORCE_PARALLEL=$(if $(FORCE_PARALLEL),1,$(if $(RUNTESTFLAGS),,1)) \
1702             "$$target"; \
1703         else true; fi
1704
1705 # The set of headers checked by 'check-headers' by default.
1706 CHECK_HEADERS = $(HFILES_NO_SRCDIR)
1707
1708 # Try to compile each header in isolation, thus ensuring headers are
1709 # self-contained.
1710 #
1711 # Defaults to checking all $HFILES_NO_SRCDIR headers.
1712 #
1713 # Do:
1714 #
1715 #    make check-headers CHECK_HEADERS="header.h list.h"
1716 #
1717 # to check specific headers.
1718 #
1719 check-headers:
1720         @echo Checking headers.
1721         for i in $(CHECK_HEADERS) ; do \
1722                 $(CXX) $(CXX_DIALECT) -x c++-header -c -fsyntax-only \
1723                 $(INTERNAL_CFLAGS) -include defs.h $(srcdir)/$$i ; \
1724         done
1725 .PHONY: check-headers
1726
1727 info install-info clean-info dvi pdf install-pdf html install-html: force
1728         @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
1729
1730 # Traditionally "install" depends on "all".  But it may be useful
1731 # not to; for example, if the user has made some trivial change to a
1732 # source file and doesn't care about rebuilding or just wants to save the
1733 # time it takes for make to check that all is up to date.
1734 # install-only is intended to address that need.
1735 install: all
1736         @$(MAKE) $(FLAGS_TO_PASS) install-only
1737
1738 install-only: $(CONFIG_INSTALL)
1739         transformed_name=`t='$(program_transform_name)'; \
1740                           echo gdb | sed -e "$$t"` ; \
1741                 if test "x$$transformed_name" = x; then \
1742                   transformed_name=gdb ; \
1743                 else \
1744                   true ; \
1745                 fi ; \
1746                 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
1747                 $(INSTALL_PROGRAM) gdb$(EXEEXT) \
1748                         $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
1749                 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(includedir)/gdb ; \
1750                 $(INSTALL_DATA) jit-reader.h $(DESTDIR)$(includedir)/gdb/jit-reader.h
1751         if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" != x; \
1752         then \
1753           transformed_name=`t='$(program_transform_name)'; \
1754                             echo gcore | sed -e "$$t"` ; \
1755                   if test "x$$transformed_name" = x; then \
1756                     transformed_name=gcore ; \
1757                   else \
1758                     true ; \
1759                   fi ; \
1760                   $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
1761                   $(INSTALL_SCRIPT) gcore \
1762                           $(DESTDIR)$(bindir)/$$transformed_name; \
1763         fi
1764         transformed_name=`t='$(program_transform_name)'; \
1765                           echo gdb-add-index | sed -e "$$t"` ; \
1766         if test "x$$transformed_name" = x; then \
1767           transformed_name=gdb-add-index ; \
1768         else \
1769           true ; \
1770         fi ; \
1771         $(INSTALL_SCRIPT) $(srcdir)/contrib/gdb-add-index.sh \
1772                 $(DESTDIR)$(bindir)/$$transformed_name
1773         @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
1774
1775 install-strip:
1776         $(MAKE) $(FLAGS_TO_PASS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1777           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1778           `test -z '$(STRIP)' || \
1779             echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
1780
1781 install-guile:
1782         $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/guile/gdb
1783
1784 install-python:
1785         $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
1786
1787 uninstall: force $(CONFIG_UNINSTALL)
1788         transformed_name=`t='$(program_transform_name)'; \
1789                           echo gdb | sed -e $$t` ; \
1790                 if test "x$$transformed_name" = x; then \
1791                   transformed_name=gdb ; \
1792                 else \
1793                   true ; \
1794                 fi ; \
1795                 rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
1796                       $(DESTDIR)$(man1dir)/$$transformed_name.1
1797         if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" != x; \
1798         then \
1799           transformed_name=`t='$(program_transform_name)'; \
1800                             echo gcore | sed -e "$$t"` ; \
1801                   if test "x$$transformed_name" = x; then \
1802                     transformed_name=gcore ; \
1803                   else \
1804                     true ; \
1805                   fi ; \
1806                   rm -f $(DESTDIR)$(bindir)/$$transformed_name; \
1807         fi
1808         @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
1809
1810 # The C++ name parser can be built standalone for testing.
1811 test-cp-name-parser.o: cp-name-parser.c
1812         $(COMPILE) -DTEST_CPNAMES cp-name-parser.c
1813         $(POSTCOMPILE)
1814
1815 test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
1816         $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) \
1817                 -o test-cp-name-parser$(EXEEXT) test-cp-name-parser.o \
1818                 $(LIBIBERTY)
1819
1820 # We do this by grepping through sources.  If that turns out to be too slow,
1821 # maybe we could just require every .o file to have an initialization routine
1822 # of a given name (top.o -> _initialize_top, etc.).
1823 #
1824 # Formatting conventions:  The name of the _initialize_* routines must start
1825 # in column zero, and must not be inside #if.
1826 #
1827 # Note that the set of files with init functions might change, or the names
1828 # of the functions might change, so this files needs to depend on all the
1829 # object files that will be linked into gdb.
1830
1831 # FIXME: There is a problem with this approach - init.c may force
1832 # unnecessary files to be linked in.
1833
1834 # FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that
1835 # the first call is to _initialize_gdbtypes (implemented by explicitly
1836 # putting that function's name first in the init.l-tmp file).  This is
1837 # a hack to ensure that all the architecture dependant global
1838 # builtin_type_* variables are initialized before anything else
1839 # (per-architecture code is called in the same order that it is
1840 # registered).  The ``correct fix'' is to have all the builtin types
1841 # made part of the architecture and initialize them on-demand (using
1842 # gdbarch_data) just like everything else.  The catch is that other
1843 # modules still take the address of these builtin types forcing them
1844 # to be variables, sigh!
1845
1846 # NOTE: cagney/2003-03-18: The sed pattern ``s|^\([^ /]...'' is
1847 # anchored on the first column and excludes the ``/'' character so
1848 # that it doesn't add the $(srcdir) prefix to any file that already
1849 # has an absolute path.  It turns out that $(DEC)'s True64 make
1850 # automatically adds the $(srcdir) prefixes when it encounters files
1851 # in sub-directories such as cli/ and mi/.
1852
1853 # NOTE: cagney/2004-02-08: The ``case "$$fs" in'' eliminates
1854 # duplicates.  Files in the gdb/ directory can end up appearing in
1855 # COMMON_OBS (as a .o file) and CONFIG_SRCS (as a .c file).
1856
1857 INIT_FILES = $(COMMON_OBS) $(TSOBS) $(CONFIG_SRCS) $(SUBDIR_GCC_COMPILE_SRCS)
1858 init.c: $(INIT_FILES)
1859         @$(ECHO_INIT_C) echo "Making init.c"
1860         @rm -f init.c-tmp init.l-tmp
1861         @touch init.c-tmp
1862         @echo gdbtypes > init.l-tmp
1863         @-LANG=C ; export LANG ; \
1864         LC_ALL=C ; export LC_ALL ; \
1865         echo $(INIT_FILES) | \
1866         tr ' ' '\012' | \
1867         sed \
1868             -e '/^gdbtypes.[co]$$/d' \
1869             -e '/^init.[co]$$/d' \
1870             -e '/xdr_ld.[co]$$/d' \
1871             -e '/xdr_ptrace.[co]$$/d' \
1872             -e '/xdr_rdb.[co]$$/d' \
1873             -e '/udr.[co]$$/d' \
1874             -e '/udip2soc.[co]$$/d' \
1875             -e '/udi2go32.[co]$$/d' \
1876             -e '/version.[co]$$/d' \
1877             -e '/^[a-z0-9A-Z_]*_[SU].[co]$$/d' \
1878             -e '/[a-z0-9A-Z_]*-exp.tab.[co]$$/d' \
1879             -e 's/-exp\.o$$/-exp.y/' \
1880             -e 's/\.[co]$$/.c/' \
1881             -e 's,signals\.c,common/signals\.c,' \
1882             -e 's|^\([^  /][^     ]*\)|$(srcdir)/\1|g' | \
1883         while read f; do \
1884             sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \
1885         done | \
1886         while read f; do \
1887             case " $$fs " in \
1888                 *" $$f "* ) ;; \
1889                 * ) echo $$f ; fs="$$fs $$f";; \
1890             esac; \
1891         done >> init.l-tmp
1892         @echo '/* Do not modify this file.  */' >>init.c-tmp
1893         @echo '/* It is created automatically by the Makefile.  */'>>init.c-tmp
1894         @echo '#include "defs.h"      /* For initialize_file_ftype.  */' >>init.c-tmp
1895         @echo 'extern void initialize_all_files(void);' >>init.c-tmp
1896         @sed -e 's/\(.*\)/extern initialize_file_ftype _initialize_\1;/' <init.l-tmp >>init.c-tmp
1897         @echo 'void' >>init.c-tmp
1898         @echo 'initialize_all_files (void)' >>init.c-tmp
1899         @echo '{' >>init.c-tmp
1900         @sed -e 's/\(.*\)/  _initialize_\1 ();/' <init.l-tmp >>init.c-tmp
1901         @echo '}' >>init.c-tmp
1902         @rm init.l-tmp
1903         @mv init.c-tmp init.c
1904
1905 .PRECIOUS: init.c
1906
1907 # Create a library of the gdb object files and build GDB by linking
1908 # against that.
1909 #
1910 # init.o is very important.  It pulls in the rest of GDB.
1911 LIBGDB_OBS = $(COMMON_OBS) $(TSOBS) $(ADD_FILES) init.o
1912 libgdb.a: $(LIBGDB_OBS)
1913         -rm -f libgdb.a
1914         $(AR) q libgdb.a $(LIBGDB_OBS)
1915         $(RANLIB) libgdb.a
1916
1917 # Removing the old gdb first works better if it is running, at least on SunOS.
1918 gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
1919         $(SILENCE) rm -f gdb$(EXEEXT)
1920         $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
1921                 -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
1922                 $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
1923 ifneq ($(CODESIGN_CERT),)
1924         $(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT)
1925 endif
1926
1927 # Convenience rule to handle recursion.
1928 $(LIBGNU) $(GNULIB_H): all-lib
1929 all-lib: $(GNULIB_BUILDDIR)/Makefile
1930         @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do
1931 .PHONY: all-lib
1932
1933 # Convenience rule to handle recursion.
1934 .PHONY: all-data-directory
1935 all-data-directory: data-directory/Makefile
1936         @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=data-directory subdir_do
1937
1938 # This is useful when debugging GDB, because some Unix's don't let you run GDB
1939 # on itself without copying the executable.  So "make gdb1" will make
1940 # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
1941 # Removing gdb1 before the copy is the right thing if gdb1 is open
1942 # in another process.
1943 gdb1$(EXEEXT): gdb$(EXEEXT)
1944         rm -f gdb1$(EXEEXT)
1945         cp gdb$(EXEEXT) gdb1$(EXEEXT)
1946
1947 # Put the proper machine-specific files first, so M-. on a machine
1948 # specific routine gets the one for the correct machine.  (FIXME: those
1949 # files go in twice; we should be removing them from the main list).
1950
1951 # TAGS depends on all the files that go into it so you can rebuild TAGS
1952 # with `make TAGS' and not have to say `rm TAGS' first.
1953
1954 GDB_NM_FILE = @GDB_NM_FILE@
1955 TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
1956         @echo Making TAGS
1957         etags `(test -n "$(GDB_NM_FILE)" && echo "$(srcdir)/$(GDB_NM_FILE)")` \
1958         `(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \
1959                 echo $(srcdir)/$$i ; \
1960         done ; for i in $(TAGFILES_WITH_SRCDIR); do \
1961                 echo $$i ; \
1962         done) | sed -e 's/\.o$$/\.c/'` \
1963         `find $(srcdir)/config -name '*.h' -print`
1964
1965 tags: TAGS
1966
1967 clean mostlyclean: $(CONFIG_CLEAN)
1968         @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do
1969         rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp
1970         rm -f init.c version.c
1971         rm -f gdb$(EXEEXT) core make.log
1972         rm -f gdb[0-9]$(EXEEXT)
1973         rm -f test-cp-name-parser$(EXEEXT)
1974         rm -f xml-builtin.c stamp-xml
1975         rm -f $(DEPDIR)/*
1976         for i in $(CONFIG_SRC_SUBDIR); do \
1977                 rm -f $$i/*.o;  \
1978                 rm -f $$i/$(DEPDIR)/*; \
1979         done
1980
1981 # This used to depend on c-exp.c m2-exp.c TAGS
1982 # I believe this is wrong; the makefile standards for distclean just
1983 # describe removing files; the only sort of "re-create a distribution"
1984 # functionality described is if the distributed files are unmodified.
1985 # NB: While GDBSERVER might be configured on native systems, it isn't
1986 # always included in SUBDIRS.  Remove the gdbserver files explicitly.
1987 distclean: clean
1988         @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
1989         rm -rf $(GNULIB_BUILDDIR)
1990         rm -f gdbserver/config.status gdbserver/config.log
1991         rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h
1992         rm -f gdbserver/Makefile gdbserver/config.cache
1993         rm -f nm.h config.status config.h stamp-h b jit-reader.h
1994         rm -f gdb-gdb.py gdb-gdb.gdb
1995         rm -f y.output yacc.acts yacc.tmp y.tab.h
1996         rm -f config.log config.cache
1997         rm -f Makefile
1998         rm -rf $(DEPDIR)
1999         for i in $(CONFIG_SRC_SUBDIR); do \
2000                 if test -d $$i/$(DEPDIR); then rmdir $$i/$(DEPDIR); fi \
2001         done
2002
2003 maintainer-clean: local-maintainer-clean do-maintainer-clean distclean
2004 realclean: maintainer-clean
2005
2006 local-maintainer-clean:
2007         @echo "This command is intended for maintainers to use;"
2008         @echo "it deletes files that may require special tools to rebuild."
2009         rm -f c-exp.c \
2010                 cp-name-parser.c \
2011                 ada-lex.c ada-exp.c \
2012                 d-exp.c f-exp.c go-exp.c m2-exp.c p-exp.c rust-exp.c
2013         rm -f TAGS $(INFOFILES)
2014         rm -f $(YYFILES)
2015         rm -f nm.h config.status
2016
2017 do-maintainer-clean:
2018         @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(CLEANDIRS)" \
2019                 subdir_do
2020
2021 diststuff: $(DISTSTUFF) $(PACKAGE).pot $(CATALOGS)
2022         cd doc; $(MAKE) $(MFLAGS) diststuff
2023
2024 subdir_do: force
2025         @for i in $(DODIRS); do \
2026                 case $$i in \
2027                 $(REQUIRED_SUBDIRS)) \
2028                         if [ ! -f ./$$i/Makefile ] ; then \
2029                                 echo "Missing $$i/Makefile" >&2 ; \
2030                                 exit 1 ; \
2031                         fi ;; \
2032                 esac ; \
2033                 if [ -f ./$$i/Makefile ] ; then \
2034                         if (cd ./$$i; \
2035                                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
2036                         else exit 1 ; fi ; \
2037                 else true ; fi ; \
2038         done
2039
2040 Makefile: Makefile.in config.status
2041         # Regenerate the Makefile and the tm.h / nm.h links.
2042         CONFIG_FILES="Makefile" \
2043           CONFIG_COMMANDS= \
2044           CONFIG_HEADERS= \
2045           $(SHELL) config.status
2046
2047 $(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
2048         @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
2049           CONFIG_COMMANDS="depfiles" \
2050           CONFIG_HEADERS= \
2051           CONFIG_LINKS= \
2052           $(SHELL) config.status
2053
2054 data-directory/Makefile: data-directory/Makefile.in config.status
2055         CONFIG_FILES="data-directory/Makefile" \
2056           CONFIG_COMMANDS="depfiles" \
2057           CONFIG_HEADERS= \
2058           CONFIG_LINKS= \
2059           $(SHELL) config.status
2060
2061 .PHONY: run
2062 run: Makefile
2063         ./gdb$(EXEEXT) --data-directory=`pwd`/data-directory $(GDBFLAGS)
2064
2065 jit-reader.h: $(srcdir)/jit-reader.in
2066         $(SHELL) config.status $@
2067
2068 gcore: $(srcdir)/gcore.in
2069         $(SHELL) config.status $@
2070
2071 gdb-gdb.py: $(srcdir)/gdb-gdb.py.in
2072         $(SHELL) config.status $@
2073
2074 gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in
2075         $(SHELL) config.status $@
2076
2077 config.h: stamp-h ; @true
2078 stamp-h: $(srcdir)/config.in config.status
2079         CONFIG_HEADERS=config.h:config.in \
2080           CONFIG_COMMANDS="default depdir" \
2081           CONFIG_FILES= \
2082           CONFIG_LINKS= \
2083           $(SHELL) config.status
2084
2085 config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh
2086         $(SHELL) config.status --recheck
2087
2088 ACLOCAL = aclocal
2089 ACLOCAL_AMFLAGS = -I ../config
2090
2091 # Keep these in sync with the includes in acinclude.m4.
2092 aclocal_m4_deps = \
2093         configure.ac \
2094         acx_configure_dir.m4 \
2095         libmcheck.m4 \
2096         transform.m4 \
2097         ../bfd/bfd.m4 \
2098         ../config/acinclude.m4 \
2099         ../config/plugins.m4 \
2100         ../config/lead-dot.m4 \
2101         ../config/override.m4 \
2102         ../config/largefile.m4 \
2103         ../config/gettext-sister.m4 \
2104         ../config/lib-ld.m4 \
2105         ../config/lib-prefix.m4 \
2106         ../config/lib-link.m4 \
2107         ../config/acx.m4 \
2108         ../config/tcl.m4 \
2109         ../config/depstand.m4 \
2110         ../config/lcmessage.m4 \
2111         ../config/codeset.m4 \
2112         ../config/zlib.m4
2113
2114 $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps)
2115         cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
2116
2117 AUTOCONF = autoconf
2118 configure_deps = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
2119 $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(configure_deps)
2120         cd $(srcdir) && $(AUTOCONF)
2121
2122 AUTOHEADER = autoheader
2123 $(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(configure_deps)
2124         cd $(srcdir) && $(AUTOHEADER)
2125         rm -f stamp-h
2126         touch $@
2127
2128 # automatic rebuilding in automake-generated Makefiles requires
2129 # this rule in the toplevel Makefile, which, with GNU make, causes
2130 # the desired updates through the implicit regeneration of the Makefile
2131 # and all of its prerequisites.
2132 am--refresh:
2133         @:
2134
2135 force:
2136
2137 # Documentation!
2138 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
2139 doc/refcard.dvi:
2140         cd doc; $(MAKE) refcard.dvi $(FLAGS_TO_PASS)
2141
2142 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
2143 doc/refcard.ps:
2144         cd doc; $(MAKE) refcard.ps $(FLAGS_TO_PASS)
2145
2146 # GDB MANUAL: TeX dvi file
2147 doc/gdb.dvi:
2148         cd doc; $(MAKE) gdb.dvi $(FLAGS_TO_PASS)
2149
2150 # GDB MANUAL: info file
2151 doc/gdb.info:
2152         cd doc; $(MAKE) gdb.info $(FLAGS_TO_PASS)
2153
2154 # Make copying.c from COPYING
2155 $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copying.awk
2156         awk -f $(srcdir)/copying.awk \
2157                 < $(srcdir)/../COPYING3 > $(srcdir)/copying.tmp
2158         mv $(srcdir)/copying.tmp $(srcdir)/copying.c
2159
2160 version.c: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/common/create-version.sh
2161         $(ECHO_GEN) $(SHELL) $(srcdir)/common/create-version.sh $(srcdir) \
2162             $(host_alias) $(target_alias) version.c
2163
2164 lint: $(LINTFILES)
2165         $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
2166            `echo $(DEPFILES) $(CONFIG_OBS) | sed 's/\.o /\.c /g'`
2167
2168 gdb.cxref: $(SFILES)
2169         cxref -I. $(SFILES) >gdb.cxref
2170
2171 force_update:
2172
2173 # GNU Make has an annoying habit of putting *all* the Makefile variables
2174 # into the environment, unless you include this target as a circumvention.
2175 # Rumor is that this will be fixed (and this target can be removed)
2176 # in GNU Make 4.0.
2177 .NOEXPORT:
2178
2179 # GNU Make 3.63 has a different problem: it keeps tacking command line
2180 # overrides onto the definition of $(MAKE).  This variable setting
2181 # will remove them.
2182 MAKEOVERRIDES =
2183
2184 ALLDEPFILES = \
2185         aarch64-fbsd-nat.c \
2186         aarch64-fbsd-tdep.c \
2187         aarch64-linux-nat.c \
2188         aarch64-linux-tdep.c \
2189         aarch64-newlib-tdep.c \
2190         aarch64-tdep.c \
2191         aix-thread.c \
2192         alpha-bsd-nat.c \
2193         alpha-bsd-tdep.c \
2194         alpha-linux-nat.c \
2195         alpha-linux-tdep.c \
2196         alpha-mdebug-tdep.c \
2197         alpha-nbsd-tdep.c \
2198         alpha-obsd-tdep.c \
2199         alpha-tdep.c \
2200         amd64-bsd-nat.c \
2201         amd64-darwin-tdep.c \
2202         amd64-dicos-tdep.c \
2203         amd64-fbsd-nat.c \
2204         amd64-fbsd-tdep.c \
2205         amd64-linux-nat.c \
2206         amd64-linux-tdep.c \
2207         amd64-nat.c \
2208         amd64-nbsd-nat.c \
2209         amd64-nbsd-tdep.c \
2210         amd64-obsd-nat.c \
2211         amd64-obsd-tdep.c \
2212         amd64-sol2-tdep.c \
2213         amd64-tdep.c \
2214         arc-tdep.c \
2215         arm.c \
2216         arm-bsd-tdep.c \
2217         arm-fbsd-nat.c \
2218         arm-fbsd-tdep.c \
2219         arm-get-next-pcs.c \
2220         arm-linux.c \
2221         arm-linux-nat.c \
2222         arm-linux-tdep.c \
2223         arm-nbsd-nat.c \
2224         arm-nbsd-tdep.c \
2225         arm-obsd-tdep.c \
2226         arm-symbian-tdep.c \
2227         arm-tdep.c \
2228         avr-tdep.c \
2229         bfin-linux-tdep.c \
2230         bfin-tdep.c \
2231         bsd-kvm.c \
2232         bsd-uthread.c \
2233         darwin-nat.c \
2234         dicos-tdep.c \
2235         exec.c \
2236         fbsd-nat.c \
2237         fbsd-tdep.c \
2238         fork-child.c \
2239         ft32-tdep.c \
2240         glibc-tdep.c \
2241         go32-nat.c \
2242         h8300-tdep.c \
2243         hppa-bsd-tdep.c \
2244         hppa-linux-nat.c \
2245         hppa-linux-tdep.c \
2246         hppa-nbsd-nat.c \
2247         hppa-nbsd-tdep.c \
2248         hppa-obsd-nat.c \
2249         hppa-obsd-tdep.c \
2250         hppa-tdep.c \
2251         i386-bsd-nat.c \
2252         i386-bsd-tdep.c \
2253         i386-cygwin-tdep.c \
2254         i386-darwin-nat.c \
2255         i386-darwin-tdep.c \
2256         i386-dicos-tdep.c \
2257         i386-fbsd-nat.c \
2258         i386-fbsd-tdep.c \
2259         i386-gnu-nat.c \
2260         i386-gnu-tdep.c \
2261         i386-linux-nat.c \
2262         i386-linux-tdep.c \
2263         i386-nbsd-nat.c \
2264         i386-nbsd-tdep.c \
2265         i386-obsd-nat.c \
2266         i386-obsd-tdep.c \
2267         i386-sol2-nat.c \
2268         i386-sol2-tdep.c \
2269         i386-tdep.c \
2270         i386-v4-nat.c \
2271         i387-tdep.c \
2272         ia64-libunwind-tdep.c \
2273         ia64-linux-nat.c \
2274         ia64-linux-tdep.c \
2275         ia64-tdep.c \
2276         ia64-vms-tdep.c \
2277         inf-ptrace.c \
2278         linux-fork.c \
2279         linux-record.c \
2280         linux-tdep.c \
2281         lm32-tdep.c \
2282         m32r-linux-nat.c \
2283         m32r-linux-tdep.c \
2284         m32r-tdep.c \
2285         m68hc11-tdep.c \
2286         m68k-bsd-nat.c \
2287         m68k-bsd-tdep.c \
2288         m68k-linux-nat.c \
2289         m68k-linux-tdep.c \
2290         m68k-tdep.c \
2291         microblaze-linux-tdep.c \
2292         microblaze-tdep.c \
2293         mingw-hdep.c \
2294         mips-fbsd-nat.c \
2295         mips-fbsd-tdep.c \
2296         mips-linux-nat.c \
2297         mips-linux-tdep.c \
2298         mips-nbsd-nat.c \
2299         mips-nbsd-tdep.c \
2300         mips-sde-tdep.c \
2301         mips-tdep.c \
2302         mips64-obsd-nat.c \
2303         mips64-obsd-tdep.c \
2304         msp430-tdep.c \
2305         nbsd-nat.c \
2306         nbsd-tdep.c \
2307         nds32-tdep.c \
2308         nios2-linux-tdep.c \
2309         nios2-tdep.c \
2310         obsd-nat.c \
2311         obsd-tdep.c \
2312         posix-hdep.c \
2313         ppc-fbsd-nat.c \
2314         ppc-fbsd-tdep.c \
2315         ppc-linux-nat.c \
2316         ppc-linux-tdep.c \
2317         ppc-nbsd-nat.c \
2318         ppc-nbsd-tdep.c \
2319         ppc-obsd-nat.c \
2320         ppc-obsd-tdep.c \
2321         ppc-ravenscar-thread.c \
2322         ppc-sysv-tdep.c \
2323         ppc64-tdep.c \
2324         procfs.c \
2325         ravenscar-thread.c \
2326         remote-sim.c \
2327         riscv-tdep.c \
2328         rl78-tdep.c \
2329         rs6000-lynx178-tdep.c \
2330         rs6000-nat.c \
2331         rs6000-tdep.c \
2332         rx-tdep.c \
2333         s390-linux-nat.c \
2334         s390-linux-tdep.c \
2335         s390-tdep.c \
2336         score-tdep.c \
2337         ser-go32.c \
2338         ser-mingw.c \
2339         ser-pipe.c \
2340         ser-tcp.c \
2341         sh-nbsd-nat.c \
2342         sh-nbsd-tdep.c \
2343         sh-tdep.c \
2344         sol2-tdep.c \
2345         solib-aix.c \
2346         solib-spu.c \
2347         solib-svr4.c \
2348         sparc-linux-nat.c \
2349         sparc-linux-tdep.c \
2350         sparc-nat.c \
2351         sparc-nbsd-nat.c \
2352         sparc-nbsd-tdep.c \
2353         sparc-obsd-tdep.c \
2354         sparc-ravenscar-thread.c \
2355         sparc-sol2-nat.c \
2356         sparc-sol2-tdep.c \
2357         sparc-tdep.c \
2358         sparc64-fbsd-nat.c \
2359         sparc64-fbsd-tdep.c \
2360         sparc64-linux-nat.c \
2361         sparc64-linux-tdep.c \
2362         sparc64-nat.c \
2363         sparc64-nbsd-nat.c \
2364         sparc64-nbsd-tdep.c \
2365         sparc64-obsd-nat.c \
2366         sparc64-obsd-tdep.c \
2367         sparc64-sol2-tdep.c \
2368         sparc64-tdep.c \
2369         spu-linux-nat.c \
2370         spu-multiarch.c \
2371         spu-tdep.c \
2372         tilegx-linux-nat.c \
2373         tilegx-linux-tdep.c \
2374         tilegx-tdep.c \
2375         v850-tdep.c \
2376         vax-bsd-nat.c \
2377         vax-nbsd-tdep.c \
2378         vax-tdep.c \
2379         windows-nat.c \
2380         windows-tdep.c \
2381         x86-nat.c \
2382         x86-tdep.c \
2383         xcoffread.c \
2384         xstormy16-tdep.c \
2385         xtensa-config.c \
2386         xtensa-linux-nat.c \
2387         xtensa-linux-tdep.c \
2388         xtensa-tdep.c \
2389         xtensa-xtregs.c \
2390         common/mingw-strerror.c \
2391         common/posix-strerror.c
2392
2393 # Some files need explicit build rules (due to -Werror problems) or due
2394 # to sub-directory fun 'n' games.
2395
2396 # Do not try to build "printcmd.c" with -Wformat-nonliteral.  It manually
2397 # checks format strings.
2398 printcmd.o: $(srcdir)/printcmd.c
2399         $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
2400                 $(GDB_WARN_CFLAGS_NO_FORMAT) $(COMPILE.post) \
2401                 $(srcdir)/printcmd.c
2402         $(POSTCOMPILE)
2403
2404 # Same for "target-float.c".
2405 target-float.o: $(srcdir)/target-float.c
2406         $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
2407                 $(GDB_WARN_CFLAGS_NO_FORMAT) $(COMPILE.post) \
2408                 $(srcdir)/target-float.c
2409
2410 # ada-exp.c can appear in srcdir, for releases; or in ., for
2411 # development builds.
2412 ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
2413
2414 # Some versions of flex give output that triggers
2415 # -Wold-style-definition.
2416 ada-exp.o: ada-exp.c
2417         $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) \
2418                 $(GDB_WARN_CFLAGS_NO_DEFS) $(COMPILE.post) $(ADA_EXP_C)
2419         $(POSTCOMPILE)
2420
2421 # Message files.  Based on code in gcc/Makefile.in.
2422
2423 # Rules for generating translated message descriptions.  Disabled by
2424 # autoconf if the tools are not available.
2425
2426 .PHONY: all-po install-po uninstall-po clean-po update-po $(PACKAGE).pot
2427
2428 all-po: $(CATALOGS)
2429
2430 # This notation should be acceptable to all Make implementations used
2431 # by people who are interested in updating .po files.
2432 update-po: $(CATALOGS:.gmo=.pox)
2433
2434 # N.B. We do not attempt to copy these into $(srcdir).  The snapshot
2435 # script does that.
2436 %.gmo: %.po
2437         -test -d po || mkdir po
2438         $(GMSGFMT) --statistics -o $@ $<
2439
2440 # The new .po has to be gone over by hand, so we deposit it into
2441 # build/po with a different extension.  If build/po/$(PACKAGE).pot
2442 # exists, use it (it was just created), else use the one in srcdir.
2443 %.pox: %.po
2444         -test -d po || mkdir po
2445         $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
2446                         then echo po/$(PACKAGE).pot; \
2447                         else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
2448
2449 # This rule has to look for .gmo modules in both srcdir and the cwd,
2450 # and has to check that we actually have a catalog for each language,
2451 # in case they weren't built or included with the distribution.
2452 install-po:
2453         $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(datadir)
2454         cats="$(CATALOGS)"; for cat in $$cats; do \
2455           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
2456           if [ -f $$cat ]; then :; \
2457           elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
2458           else continue; \
2459           fi; \
2460           dir=$(localedir)/$$lang/LC_MESSAGES; \
2461           echo $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir; \
2462           $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir || exit 1; \
2463           echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
2464           $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
2465         done
2466 uninstall-po:
2467         cats="$(CATALOGS)"; for cat in $$cats; do \
2468           lang=`basename $$cat | sed 's/\.gmo$$//'`; \
2469           if [ -f $$cat ]; then :; \
2470           elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
2471           else continue; \
2472           fi; \
2473           dir=$(localedir)/$$lang/LC_MESSAGES; \
2474           rm -f $(DESTDIR)$$dir/$(PACKAGE).mo; \
2475         done
2476 # Delete po/*.gmo only if we are not building in the source directory.
2477 clean-po:
2478         -if [ ! -f Makefile.in ]; then rm -f po/*.gmo; fi
2479
2480 # Rule for regenerating the message template (gdb.pot).  Instead of
2481 # forcing everyone to edit POTFILES.in, which proved impractical, this
2482 # rule has no dependencies and always regenerates gdb.pot.  This is
2483 # relatively harmless since the .po files do not directly depend on
2484 # it.  The .pot file is left in the build directory.  Since GDB's
2485 # Makefile lacks a cannonical list of sources (missing xm, tm and nm
2486 # files) force this rule.
2487 $(PACKAGE).pot: po/$(PACKAGE).pot
2488 po/$(PACKAGE).pot: force
2489         -test -d po || mkdir po
2490         sh -e $(srcdir)/po/gdbtext $(XGETTEXT) $(PACKAGE) . $(srcdir)
2491
2492
2493 #
2494 # YACC/LEX dependencies
2495 #
2496 # LANG-exp.c is generated in objdir from LANG-exp.y if it doesn't
2497 # exist in srcdir, then compiled in objdir to LANG-exp.o.  If we
2498 # said LANG-exp.c rather than ./c-exp.c some makes would
2499 # sometimes re-write it into $(srcdir)/c-exp.c.  Remove bogus
2500 # decls for malloc/realloc/free which conflict with everything else.
2501 # Strictly speaking c-exp.c should therefore depend on
2502 # Makefile.in, but that was a pretty big annoyance.
2503
2504 %.c: %.y
2505         $(SHELL) $(YLWRAP) $< y.tab.c $@.tmp -- $(YACC) $(YFLAGS) \
2506                 || (rm -f $@.tmp; false)
2507         sed -e '/extern.*malloc/d' \
2508              -e '/extern.*realloc/d' \
2509              -e '/extern.*free/d' \
2510              -e '/include.*malloc.h/d' \
2511              -e 's/\([^x]\)malloc/\1xmalloc/g' \
2512              -e 's/\([^x]\)realloc/\1xrealloc/g' \
2513              -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
2514              -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
2515              -e '/^#line.*y.tab.c/d' \
2516              -e 's/YY_NULL/YY_NULLPTR/g' \
2517           < $@.tmp > $@.new && \
2518           rm -f $@.tmp && \
2519           mv $@.new $@
2520 %.c: %.l
2521         if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
2522             $(FLEX) -t $<  \
2523             | sed -e '/extern.*malloc/d' \
2524                 -e '/extern.*realloc/d' \
2525                 -e '/extern.*free/d' \
2526                 -e '/include.*malloc.h/d' \
2527                 -e 's/\([^x]\)malloc/\1xmalloc/g' \
2528                 -e 's/\([^x]\)realloc/\1xrealloc/g' \
2529                 -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
2530                 -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
2531                 -e 's/yy_flex_xrealloc/yyxrealloc/g' \
2532               > $@.new && \
2533             mv $@.new $@; \
2534         elif [ -f $@ ]; then \
2535             echo "Warning: $*.c older than $*.l and flex not available."; \
2536         else \
2537             echo "$@ missing and flex not available."; \
2538             false; \
2539         fi
2540
2541 .PRECIOUS: ada-lex.c
2542
2543 # XML rules
2544
2545 xml-builtin.c: stamp-xml; @true
2546 stamp-xml: $(srcdir)/features/feature_to_c.sh Makefile $(XMLFILES)
2547         $(SILENCE) rm -f xml-builtin.tmp
2548         $(ECHO_GEN_XML_BUILTIN) AWK="$(AWK)" \
2549           $(SHELL) $(srcdir)/features/feature_to_c.sh \
2550           xml-builtin.tmp $(XMLFILES)
2551         $(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin.c
2552         $(SILENCE) echo stamp > stamp-xml
2553
2554 .PRECIOUS: xml-builtin.c
2555
2556 #
2557 # GDBTK sub-directory
2558 #
2559
2560 all-gdbtk: insight$(EXEEXT)
2561
2562 install-gdbtk:
2563         transformed_name=`t='$(program_transform_name)'; \
2564                   echo insight | sed -e $$t` ; \
2565         if test "x$$transformed_name" = x; then \
2566           transformed_name=insight ; \
2567         else \
2568           true ; \
2569         fi ; \
2570         $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
2571         $(INSTALL_PROGRAM) insight$(EXEEXT) \
2572                 $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
2573         $(SHELL) $(srcdir)/../mkinstalldirs \
2574                 $(DESTDIR)$(GDBTK_LIBRARY) ; \
2575         $(SHELL) $(srcdir)/../mkinstalldirs \
2576                 $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION) ; \
2577         $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl \
2578                 $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
2579         $(SHELL) $(srcdir)/../mkinstalldirs \
2580                 $(DESTDIR)$(GDBTK_LIBRARY)/images \
2581                 $(DESTDIR)$(GDBTK_LIBRARY)/images2 ; \
2582         $(SHELL) $(srcdir)/../mkinstalldirs \
2583                 $(DESTDIR)$(GDBTK_LIBRARY)/help \
2584                 $(DESTDIR)$(GDBTK_LIBRARY)/help/images \
2585                 $(DESTDIR)$(GDBTK_LIBRARY)/help/trace ; \
2586         cd $(srcdir)/gdbtk/library ; \
2587         for i in *.tcl *.itcl *.ith *.itb images/*.gif images2/*.gif images/icons.txt images2/icons.txt tclIndex help/*.html  help/trace/*.html help/trace/index.toc help/images/*.gif help/images/*.png; \
2588           do \
2589                 $(INSTALL_DATA) $$i $(DESTDIR)$(GDBTK_LIBRARY)/$$i ; \
2590           done ;
2591
2592 uninstall-gdbtk:
2593         transformed_name=`t='$(program_transform_name)'; \
2594                   echo insight | sed -e $$t` ; \
2595         if test "x$$transformed_name" = x; then \
2596                 transformed_name=insight ; \
2597         else \
2598                 true ; \
2599         fi ; \
2600         rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
2601         rm -rf $(DESTDIR)$(GDBTK_LIBRARY)
2602
2603 clean-gdbtk:
2604         rm -f insight$(EXEEXT)
2605
2606 # Removing the old gdb first works better if it is running, at least on SunOS.
2607 insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \
2608                 $(CDEPS) $(TDEPLIBS)
2609         rm -f insight$(EXEEXT)
2610         $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
2611                 -o insight$(EXEEXT) gdbtk-main.o libgdb.a \
2612                 $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
2613
2614 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
2615         $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
2616
2617 all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \
2618                 $(ITK_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
2619                 $(GDBTK_CFLAGS) \
2620                 -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" \
2621                 -DSRC_DIR=\"$(GDBTK_SRC_DIR)\"
2622
2623 #
2624 # Dependency tracking.
2625 #
2626
2627 ifeq ($(DEPMODE),depmode=gcc3)
2628 # Note that we put the dependencies into a .Tpo file, then move them
2629 # into place if the compile succeeds.  We need this because gcc does
2630 # not atomically write the dependency output file.
2631 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
2632         -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
2633 override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
2634         $(@D)/$(DEPDIR)/$(basename $(@F)).Po
2635 else
2636 override COMPILE.pre = source='$<' object='$@' libtool=no \
2637         DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
2638         $(CXX) -x c++ $(CXX_DIALECT)
2639 # depcomp handles atomicity for us, so we don't need a postcompile
2640 # step.
2641 override POSTCOMPILE =
2642 endif
2643
2644 # A list of all the objects we might care about in this build, for
2645 # dependency tracking.
2646 all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \
2647         test-cp-name-parser.o
2648
2649 # All the .deps files to include.
2650 all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
2651     $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
2652
2653 # Ensure that generated files are created early.  Use order-only
2654 # dependencies if available.  They require GNU make 3.80 or newer,
2655 # and the .VARIABLES variable was introduced at the same time.
2656 ifdef .VARIABLES
2657 $(all_object_files): | $(generated_files)
2658 else
2659 $(all_object_files) : $(generated_files)
2660 endif
2661
2662 # Dependencies.
2663 -include $(all_deps_files)
2664
2665 # Disable implicit make rules.
2666 include $(srcdir)/disable-implicit-rules.mk
2667
2668 ### end of the gdb Makefile.in.