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