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