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