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