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