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