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