1 # Copyright (C) 1989-2017 Free Software Foundation, Inc.
3 # This file is part of GDB.
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.
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.
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/>.
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:
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
38 exec_prefix = @exec_prefix@
40 host_alias = @host_alias@
41 target_alias = @target_alias@
42 program_transform_name = @program_transform_name@
45 tooldir = $(libdir)/$(target_alias)
48 localedir = @localedir@
50 man1dir = $(mandir)/man1
51 man2dir = $(mandir)/man2
52 man3dir = $(mandir)/man3
53 man4dir = $(mandir)/man4
54 man5dir = $(mandir)/man5
55 man6dir = $(mandir)/man6
56 man7dir = $(mandir)/man7
57 man8dir = $(mandir)/man8
58 man9dir = $(mandir)/man9
60 datarootdir = @datarootdir@
64 includedir = @includedir@
66 install_sh = @install_sh@
68 # This can be referenced by `LIBINTL' as computed by
69 # ZW_GNU_GETTEXT_SISTER_DIR.
79 INSTALL_PROGRAM = @INSTALL_PROGRAM@
80 INSTALL_SCRIPT = @INSTALL_SCRIPT@
81 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
82 INSTALL_DATA = @INSTALL_DATA@
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.
108 CXX_DIALECT = @CXX_DIALECT@
110 # Dependency tracking information.
111 DEPMODE = @CCDEPMODE@
113 depcomp = $(SHELL) $(srcdir)/../depcomp
115 # Note that these are overridden by GNU make-specific code below if
116 # GNU make is used. The overrides implement dependency tracking.
117 COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
118 COMPILE.post = -c -o $@
119 COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
122 # Directory containing source files.
125 top_srcdir = @top_srcdir@
129 # This is used to rebuild ada-lex.c from ada-lex.l. If the program is
130 # not defined, but ada-lex.c is present, compilation will continue,
131 # possibly with a warning.
134 YLWRAP = $(srcdir)/../ylwrap
136 # where to find makeinfo, preferably one designed for texinfo-2
137 MAKEINFO = @MAKEINFO@
138 MAKEINFOFLAGS = @MAKEINFOFLAGS@
139 MAKEINFO_EXTRA_FLAGS = @MAKEINFO_EXTRA_FLAGS@
140 MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
142 MAKEHTML = $(MAKEINFO_CMD) --html
145 # Set this up with gcc if you have gnu ld and the loader will print out
146 # line numbers for undefined references.
148 CC_LD = $(CXX) $(CXX_DIALECT)
150 # Where is our "include" directory? Typically $(srcdir)/../include.
151 # This is essentially the header file directory for the library
152 # routines in libiberty.
153 INCLUDE_DIR = $(srcdir)/../include
154 INCLUDE_CFLAGS = -I$(INCLUDE_DIR)
156 # Where is the "-liberty" library? Typically in ../libiberty.
157 LIBIBERTY = ../libiberty/libiberty.a
159 # Where is the BFD library? Typically in ../bfd.
161 BFD = $(BFD_DIR)/libbfd.a
162 BFD_SRC = $(srcdir)/$(BFD_DIR)
163 BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
165 # This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
166 # -I../zlib, unless we were configured with --with-system-zlib, in which
167 # case both are empty.
171 # Where is the decnumber library? Typically in ../libdecnumber.
172 LIBDECNUMBER_DIR = ../libdecnumber
173 LIBDECNUMBER = $(LIBDECNUMBER_DIR)/libdecnumber.a
174 LIBDECNUMBER_SRC = $(srcdir)/$(LIBDECNUMBER_DIR)
175 LIBDECNUMBER_CFLAGS = -I$(LIBDECNUMBER_DIR) -I$(LIBDECNUMBER_SRC)
177 # Where is the READLINE library? Typically in ../readline.
178 READLINE_DIR = ../readline
179 READLINE_SRC = $(srcdir)/$(READLINE_DIR)
180 READLINE = @READLINE@
181 READLINE_DEPS = @READLINE_DEPS@
182 READLINE_CFLAGS = @READLINE_CFLAGS@
184 # Where is expat? This will be empty if expat was not available.
185 LIBEXPAT = @LIBEXPAT@
187 # Where is lzma? This will be empty if lzma was not available.
190 # Where is libbabeltrace? This will be empty if lbabeltrace was not
192 LIBBABELTRACE = @LIBBABELTRACE@
194 # Where is libipt? This will be empty if libipt was not available.
197 # Where is libmpfr? This will be empty if libmpfr was not available.
200 WARN_CFLAGS = @WARN_CFLAGS@
201 WERROR_CFLAGS = @WERROR_CFLAGS@
202 GDB_WARN_CFLAGS = $(WARN_CFLAGS)
203 GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
205 GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
206 | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
207 GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
208 | sed "s/ -Wold-style-definition / -Wno-old-style-definition /g"`
210 RDYNAMIC = @RDYNAMIC@
212 # Where is the INTL library? Typically in ../intl.
214 INTL_DEPS = @LIBINTL_DEP@
215 INTL_CFLAGS = @INCINTL@
217 # Where is the ICONV library? This will be empty if in libc or not available.
218 LIBICONV = @LIBICONV@
220 # Did the user give us a --with-gdb-datadir option?
221 GDB_DATADIR = @GDB_DATADIR@
223 # Flags to pass to gdb when invoked with "make run".
226 # Helper code from gnulib.
227 GNULIB_BUILDDIR = build-gnulib
228 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
229 INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import
231 # Generated headers in the gnulib directory. These must be listed
232 # so that they are generated before other files are compiled.
233 GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
236 # CLI sub directory definitons
248 SUBDIR_CLI_OBS = $(patsubst %.c,%.o,$(SUBDIR_CLI_SRCS))
255 # MI sub directory definitons
276 SUBDIR_MI_OBS = $(patsubst %.c,%.o,$(SUBDIR_MI_SRCS))
283 # TUI sub directory definitions
320 tui/tui-wingeneral.c \
325 SUBDIR_TUI_CFLAGS = -DTUI=1
328 # GCC Compile support sub-directory definitions
330 SUBDIR_GCC_COMPILE_SRCS = \
332 compile/compile-c-support.c \
333 compile/compile-c-symbols.c \
334 compile/compile-c-types.c \
335 compile/compile-loc2c.c \
336 compile/compile-object-load.c \
337 compile/compile-object-load.h \
338 compile/compile-object-run.c \
339 compile/compile-object-run.h
341 SUBDIR_GCC_COMPILE_OBS = $(patsubst %.c,%.o,$(filter %.c,$(SUBDIR_GCC_COMPILE_SRCS)))
344 # Guile sub directory definitons for guile support.
373 SUBDIR_GUILE_SRCS = \
376 guile/scm-auto-load.c \
378 guile/scm-breakpoint.c \
381 guile/scm-exception.c \
384 guile/scm-iterator.c \
385 guile/scm-lazy-string.c \
387 guile/scm-objfile.c \
390 guile/scm-pretty-print.c \
391 guile/scm-progspace.c \
392 guile/scm-safe-call.c \
401 SUBDIR_GUILE_LDFLAGS =
402 SUBDIR_GUILE_CFLAGS =
405 # python sub directory definitons
407 SUBDIR_PYTHON_OBS = \
419 py-finishbreakpoint.o \
430 py-newobjfileevent.o \
451 SUBDIR_PYTHON_SRCS = \
453 python/py-auto-load.c \
455 python/py-bpevent.c \
456 python/py-breakpoint.c \
458 python/py-continueevent.c \
460 python/py-evtregistry.c \
462 python/py-exitedevent.c \
463 python/py-finishbreakpoint.c \
465 python/py-framefilter.c \
466 python/py-function.c \
467 python/py-gdb-readline.c \
468 python/py-inferior.c \
469 python/py-infevents.c \
470 python/py-infthread.c \
471 python/py-instruction.c \
472 python/py-lazy-string.c \
473 python/py-linetable.c \
474 python/py-newobjfileevent.c \
475 python/py-objfile.c \
477 python/py-prettyprint.c \
478 python/py-progspace.c \
480 python/py-record-btrace.c \
481 python/py-record-full.c \
482 python/py-signalevent.c \
483 python/py-stopevent.c \
486 python/py-threadevent.c \
492 python/py-xmethods.c \
496 SUBDIR_PYTHON_LDFLAGS =
497 SUBDIR_PYTHON_CFLAGS =
499 SUBDIR_UNITTESTS_SRCS = \
500 unittests/array-view-selftests.c \
501 unittests/common-utils-selftests.c \
502 unittests/environ-selftests.c \
503 unittests/function-view-selftests.c \
504 unittests/lookup_name_info-selftests.c \
505 unittests/memory-map-selftests.c \
506 unittests/memrange-selftests.c \
507 unittests/offset-type-selftests.c \
508 unittests/optional-selftests.c \
509 unittests/ptid-selftests.c \
510 unittests/rsp-low-selftests.c \
511 unittests/scoped_restore-selftests.c \
512 unittests/xml-utils-selftests.c
514 SUBDIR_UNITTESTS_OBS = \
515 array-view-selftests.o \
516 common-utils-selftests.o \
517 environ-selftests.o \
518 function-view-selftests.o \
519 lookup_name_info-selftests.o \
520 memory-map-selftests.o \
521 memrange-selftests.o \
522 offset-type-selftests.o \
523 optional-selftests.o \
525 rsp-low-selftests.o \
526 scoped_restore-selftests.o \
527 xml-utils-selftests.o
529 # Opcodes currently live in one of two places. Either they are in the
530 # opcode library, typically ../opcodes, or they are in a header file
532 # Where is the "-lopcodes" library, with (some of) the opcode tables and
534 OPCODES_DIR = ../opcodes
535 OPCODES_SRC = $(srcdir)/$(OPCODES_DIR)
536 OPCODES = $(OPCODES_DIR)/libopcodes.a
537 # Where are the other opcode tables which only have header file
539 OP_INCLUDE = $(INCLUDE_DIR)/opcode
540 # Some source files like to use #include "opcodes/file.h"
541 OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
543 # The simulator is usually nonexistent; targets that include one
544 # should set this to list all the .o or .a files to be linked in.
547 WIN32LIBS = @WIN32LIBS@
549 # Tcl et al cflags and libraries
551 TCL_CFLAGS = @TCL_INCLUDE@
552 GDBTKLIBS = @GDBTKLIBS@
553 # Extra flags that the GDBTK files need:
554 GDBTK_CFLAGS = @GDBTK_CFLAGS@
557 TK_CFLAGS = @TK_INCLUDE@
559 X11_CFLAGS = @TK_XINCLUDES@
563 WIN32LDAPP = @WIN32LDAPP@
566 GUI_CFLAGS_X = @GUI_CFLAGS_X@
567 IDE_CFLAGS = $(GUI_CFLAGS_X) $(IDE_CFLAGS_X)
569 ALL_TCL_CFLAGS = $(TCL_CFLAGS) $(TK_CFLAGS)
571 # The version of gdbtk we're building. This should be kept
572 # in sync with GDBTK_VERSION and friends in gdbtk.h.
574 GDBTK_LIBRARY = $(datadir)/insight$(GDBTK_VERSION)
576 # Gdbtk requires an absolute path to the source directory or
577 # the testsuite won't run properly.
578 GDBTK_SRC_DIR = @GDBTK_SRC_DIR@
591 SUBDIR_GDBTK_SRCS = \
592 gdbtk/generic/gdbtk.c \
593 gdbtk/generic/gdbtk-bp.c \
594 gdbtk/generic/gdbtk-cmds.c \
595 gdbtk/generic/gdbtk-hooks.c \
596 gdbtk/generic/gdbtk-interp.c \
597 gdbtk/generic/gdbtk-main.c \
598 gdbtk/generic/gdbtk-register.c \
599 gdbtk/generic/gdbtk-stack.c \
600 gdbtk/generic/gdbtk-varobj.c \
601 gdbtk/generic/gdbtk-wrapper.c
603 SUBDIR_GDBTK_DEPS = $(LIBGUI) $(TCL_DEPS) $(TK_DEPS)
604 SUBDIR_GDBTK_LDFLAGS =
605 SUBDIR_GDBTK_CFLAGS = -DGDBTK
607 CONFIG_OBS = @CONFIG_OBS@
608 CONFIG_SRCS = @CONFIG_SRCS@
609 CONFIG_DEPS = @CONFIG_DEPS@
610 CONFIG_LDFLAGS = @CONFIG_LDFLAGS@
611 ENABLE_CFLAGS = @ENABLE_CFLAGS@
612 CONFIG_ALL = @CONFIG_ALL@
613 CONFIG_CLEAN = @CONFIG_CLEAN@
614 CONFIG_INSTALL = @CONFIG_INSTALL@
615 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
616 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
618 CONFIG_SRC_SUBDIR = arch cli mi compile
619 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
621 # -I. for config files.
622 # -I$(srcdir) for gdb internal headers.
623 # -I$(srcdir)/config for more generic config files.
625 # It is also possible that you will need to add -I/usr/include/sys if
626 # your system doesn't have fcntl.h in /usr/include (which is where it
627 # should be according to Posix).
629 GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/common -I$(srcdir)/config \
630 -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
632 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
633 GLOBAL_CFLAGS = $(MH_CFLAGS)
635 PROFILE_CFLAGS = @PROFILE_CFLAGS@
637 # These are specifically reserved for setting from the command line
638 # when running make. I.E.: "make CFLAGS=-Wmissing-prototypes".
640 CXXFLAGS = @CXXFLAGS@
642 # Set by configure, for e.g. expat. Python installations are such that
643 # C headers are included using their basename (for example, we #include
644 # <Python.h> rather than, say, <python/Python.h>). Since the file names
645 # are sometimes a little generic, we think that the risk of collision
646 # with other header files is high. If that happens, we try to mitigate
647 # a bit the consequences by putting the Python includes last in the list.
648 INTERNAL_CPPFLAGS = @CPPFLAGS@ @GUILE_CPPFLAGS@ @PYTHON_CPPFLAGS@
650 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
651 INTERNAL_CFLAGS_BASE = \
652 $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
653 $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
654 $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
655 $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
656 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
657 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
659 # LDFLAGS is specifically reserved for setting from the command line
663 # Profiling options need to go here to work.
664 # I think it's perfectly reasonable for a user to set -pg in CFLAGS
665 # and have it work; that's why CFLAGS is here.
666 # PROFILE_CFLAGS is _not_ included, however, because we use monstartup.
668 $(CXXFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) \
669 $(LDFLAGS) $(CONFIG_LDFLAGS)
671 # If your system is missing alloca(), or, more likely, it's there but
672 # it doesn't work, then refer to libiberty.
674 # Libraries and corresponding dependencies for compiling gdb.
675 # XM_CLIBS, defined in *config files, have host-dependent libs.
676 # LIBIBERTY appears twice on purpose.
677 CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(ZLIB) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \
678 $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) \
679 @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
680 $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
681 $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR)
682 CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
683 $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
685 ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
686 ADD_DEPS = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
690 LINT = /usr/5bin/lint
691 LINTFLAGS = $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) \
692 $(BFD_CFLAGS) $(INCLUDE_CFLAGS) \
698 # XML files to build in to GDB.
700 $(srcdir)/features/btrace.dtd \
701 $(srcdir)/features/btrace-conf.dtd \
702 $(srcdir)/features/gdb-target.dtd \
703 $(srcdir)/features/library-list.dtd \
704 $(srcdir)/features/library-list-aix.dtd \
705 $(srcdir)/features/library-list-svr4.dtd \
706 $(srcdir)/features/osdata.dtd \
707 $(srcdir)/features/threads.dtd \
708 $(srcdir)/features/traceframe-info.dtd \
709 $(srcdir)/features/xinclude.dtd
711 # Build the ser-*.o files the host supports. This includes ser-unix.o
712 # for any system that supports a POSIX interface to the serial port.
714 SER_HARDWIRE = @SER_HARDWIRE@
716 # The `remote' debugging target is supported for most architectures,
717 # but not all (e.g. 960)
730 # This is remote-sim.o if a simulator is to be linked in.
733 # Target-dependent object files.
734 TARGET_OBS = @TARGET_OBS@
736 # All target-dependent objects files that require 64-bit CORE_ADDR
737 # (used with --enable-targets=all --enable-64-bit-bfd).
738 ALL_64_TARGET_OBS = \
739 aarch64-fbsd-tdep.o \
740 aarch64-linux-tdep.o \
741 aarch64-newlib-tdep.o \
745 alpha-mdebug-tdep.o \
749 amd64-darwin-tdep.o \
757 amd64-windows-tdep.o \
759 arch/aarch64-insn.o \
765 sparc64-fbsd-tdep.o \
766 sparc64-linux-tdep.o \
767 sparc64-nbsd-tdep.o \
768 sparc64-obsd-tdep.o \
769 sparc64-sol2-tdep.o \
772 # All other target-dependent objects files (used with --enable-targets=all).
776 arch/arm-get-next-pcs.o \
832 microblaze-linux-tdep.o \
839 mn10300-linux-tdep.o \
854 ppc-ravenscar-thread.o \
860 rs6000-lynx178-tdep.o \
879 sparc-ravenscar-thread.o \
887 tilegx-linux-tdep.o \
896 xtensa-linux-tdep.o \
899 # The following native-target dependent variables are defined on
901 NAT_FILE = @NAT_FILE@
902 NATDEPFILES = @NATDEPFILES@
903 NAT_CDEPS = @NAT_CDEPS@
904 LOADLIBES = @LOADLIBES@
905 MH_CFLAGS = @MH_CFLAGS@
906 XM_CLIBS = @XM_CLIBS@
907 NAT_GENERATED_FILES = @NAT_GENERATED_FILES@
908 HAVE_NATIVE_GCORE_HOST = @HAVE_NATIVE_GCORE_HOST@
910 # Native-target dependent makefile fragment comes in here.
913 # End of native-target dependent variables.
917 "exec_prefix=$(exec_prefix)" \
918 "infodir=$(infodir)" \
919 "datarootdir=$(datarootdir)" \
921 "htmldir=$(htmldir)" \
925 "datadir=$(datadir)" \
926 "includedir=$(includedir)" \
927 "against=$(against)" \
928 "DESTDIR=$(DESTDIR)" \
930 "AR_FLAGS=$(AR_FLAGS)" \
934 "CXX_DIALECT=$(CXX_DIALECT)" \
935 "CXXFLAGS=$(CXXFLAGS)" \
936 "DLLTOOL=$(DLLTOOL)" \
937 "LDFLAGS=$(LDFLAGS)" \
939 "MAKEINFO=$(MAKEINFO)" \
940 "MAKEINFOFLAGS=$(MAKEINFOFLAGS)" \
941 "MAKEINFO_EXTRA_FLAGS=$(MAKEINFO_EXTRA_FLAGS)" \
942 "MAKEHTML=$(MAKEHTML)" \
943 "MAKEHTMLFLAGS=$(MAKEHTMLFLAGS)" \
944 "INSTALL=$(INSTALL)" \
945 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
946 "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
947 "INSTALL_DATA=$(INSTALL_DATA)" \
948 "RUNTEST=$(RUNTEST)" \
949 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
951 # Flags that we pass when building the testsuite.
953 # empty for native, $(target_alias)/ for cross
954 target_subdir = @target_subdir@
957 if [ -f $${rootme}/../gcc/xgcc ] ; then \
958 if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \
959 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/; \
961 echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \
964 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
967 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
972 if [ -f $${rootme}/../gcc/xg++ ] ; then \
973 if [ -f $${rootme}/../$(target_subdir)newlib/Makefile ] ; then \
974 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/; \
976 echo $${rootme}/../gcc/xg++ -B$${rootme}/../gcc/; \
979 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
982 t='$(program_transform_name)'; echo g++ | sed -e '' $$t; \
986 # The use of $$(x_FOR_TARGET) reduces the command line length by not
987 # duplicating the lengthy definition.
988 TARGET_FLAGS_TO_PASS = \
990 "exec_prefix=$(exec_prefix)" \
991 "against=$(against)" \
992 'CC=$$(CC_FOR_TARGET)' \
993 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
995 'CXX=$$(CXX_FOR_TARGET)' \
996 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
997 "CXXFLAGS=$(CXXFLAGS)" \
998 "INSTALL=$(INSTALL)" \
999 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
1000 "INSTALL_DATA=$(INSTALL_DATA)" \
1001 "MAKEINFO=$(MAKEINFO)" \
1002 "MAKEHTML=$(MAKEHTML)" \
1003 "RUNTEST=$(RUNTEST)" \
1004 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
1005 "FORCE_PARALLEL=$(FORCE_PARALLEL)" \
1008 # All source files that go into linking GDB.
1009 # Links made at configuration time should not be specified here, since
1010 # SFILES is used in building the distribution archive.
1033 break-catch-syscall.c \
1034 break-catch-throw.c \
1068 disasm-selftests.c \
1072 dwarf2-frame-tailcall.c \
1101 gdbarch-selftests.c \
1157 progspace-and-thread.c \
1194 target-descriptions.c \
1218 common/btrace-common.c \
1221 common/common-debug.c \
1222 common/common-exceptions.c \
1223 common/common-regcache.c \
1224 common/common-utils.c \
1228 common/filestuff.c \
1230 common/job-control.c \
1231 common/gdb_tilde_expand.c \
1234 common/print-utils.c \
1237 common/run-time-clock.c \
1240 common/signals-state-save-restore.c \
1242 common/xml-utils.c \
1244 target/waitstatus.c \
1245 $(SUBDIR_GCC_COMPILE_SRCS)
1247 LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
1249 # Header files that need to have srcdir added. Note that in the cases
1250 # where we use a macro like $(gdbcmd_h), things are carefully arranged
1251 # so that each .h file is listed exactly once (M-x tags-search works
1252 # wrong if TAGS has files twice). Because this is tricky to get
1253 # right, it is probably easiest just to list .h files here directly.
1255 HFILES_NO_SRCDIR = \
1261 amd64-darwin-tdep.h \
1262 amd64-linux-tdep.h \
1303 dwarf2-frame-tailcall.h \
1328 gdb_proc_service.h \
1345 hppa-linux-offsets.h \
1348 i386-darwin-tdep.h \
1353 ia64-libunwind-tdep.h \
1406 ppc-ravenscar-thread.h \
1413 progspace-and-thread.h \
1417 ravenscar-thread.h \
1451 sparc-ravenscar-thread.h \
1462 target-descriptions.h \
1492 arch/aarch64-insn.h \
1502 common/common-debug.h \
1503 common/common-defs.h \
1504 common/common-exceptions.h \
1505 common/common-gdbthread.h \
1506 common/common-regcache.h \
1507 common/common-types.h \
1508 common/common-utils.h \
1509 common/job-control.h \
1514 common/gdb_assert.h \
1515 common/gdb_tilde_expand.h \
1516 common/gdb_locale.h \
1517 common/gdb_setjmp.h \
1518 common/gdb_signals.h \
1519 common/gdb_sys_time.h \
1522 common/common-inferior.h \
1523 common/host-defs.h \
1524 common/print-utils.h \
1528 common/run-time-clock.h \
1529 common/signals-state-save-restore.h \
1533 common/x86-xstate.h \
1534 common/xml-utils.h \
1538 config/djgpp/langinfo.h \
1539 config/djgpp/nl_types.h \
1540 config/i386/nm-fbsd.h \
1541 config/i386/nm-i386gnu.h \
1542 config/sparc/nm-sol2.h \
1543 gnulib/import/inttypes.in.h \
1544 gnulib/import/stddef.in.h \
1545 gnulib/import/stdint.in.h \
1546 gnulib/import/str-two-way.h \
1547 gnulib/import/string.in.h \
1548 gnulib/import/extra/snippet/arg-nonnull.h \
1549 gnulib/import/extra/snippet/c++defs.h \
1550 gnulib/import/extra/snippet/warn-on-use.h \
1558 nat/aarch64-linux.h \
1559 nat/aarch64-linux-hw-point.h \
1560 nat/amd64-linux-siginfo.h \
1562 nat/gdb_thread_db.h \
1563 nat/fork-inferior.h \
1564 nat/linux-btrace.h \
1565 nat/linux-namespaces.h \
1567 nat/linux-osdata.h \
1568 nat/linux-personality.h \
1569 nat/linux-ptrace.h \
1570 nat/linux-waitpid.h \
1571 nat/mips-linux-watch.h \
1575 nat/x86-gcc-cpuid.h \
1577 nat/x86-linux-dregs.h \
1579 python/py-events.h \
1580 python/py-stopevent.h \
1582 python/python-internal.h \
1583 regformats/regdef.h \
1587 target/waitstatus.h \
1601 tui/tui-wingeneral.h \
1604 # Header files that already have srcdir in them, or which are in objdir.
1606 HFILES_WITH_SRCDIR = \
1610 # GDB "info" files, which should be included in their entirety
1611 INFOFILES = gdb.info*
1613 # {X,T,NAT}DEPFILES are something of a pain in that it's hard to
1614 # default their values the way we do for SER_HARDWIRE; in the future
1615 # maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
1616 # variables analogous to SER_HARDWIRE which get defaulted in this
1619 DEPFILES = $(TARGET_OBS) $(SER_HARDWIRE) $(NATDEPFILES) \
1620 $(REMOTE_OBS) $(SIM_OBS)
1622 SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) $(CONFIG_SRCS)
1623 # Don't include YYFILES (*.c) because we already include *.y in SFILES,
1624 # and it's more useful to see it in the .y file.
1625 TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
1627 TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
1629 COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
1646 break-catch-syscall.o \
1647 break-catch-throw.o \
1665 common-exceptions.o \
1687 disasm-selftests.o \
1690 dwarf2-frame-tailcall.o \
1707 filename-seen-cache.o \
1718 gdb_tilde_expand.o \
1725 gdbarch-selftests.o \
1779 progspace-and-thread.o \
1799 signals-state-save-restore.o \
1813 target-descriptions.o \
1840 $(SUBDIR_GCC_COMPILE_OBS)
1844 SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
1845 CLEANDIRS = $(SUBDIRS)
1847 # List of subdirectories in the build tree that must exist.
1848 # This is used to force build failures in existing trees when
1849 # a new directory is added.
1850 # The format here is for the `case' shell command.
1851 REQUIRED_SUBDIRS = doc | testsuite | $(GNULIB_BUILDDIR) | data-directory
1853 # For now, shortcut the "configure GDB for fewer languages" stuff.
1877 # Things which need to be built when making a distribution.
1879 DISTSTUFF = $(YYFILES)
1882 # All generated files which can be included by another file.
1891 $(NAT_GENERATED_FILES)
1893 # Flags needed to compile Python code
1894 PYTHON_CFLAGS = @PYTHON_CFLAGS@
1896 all: gdb$(EXEEXT) $(CONFIG_ALL)
1897 @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
1899 # Rule for compiling .c files in the top-level gdb directory.
1900 # The order-only dependencies ensure that we create the build subdirectories.
1901 %.o: %.c | $(CONFIG_DEP_SUBDIR)
1905 $(CONFIG_DEP_SUBDIR):
1906 $(SHELL) $(srcdir)/../mkinstalldirs $@
1908 # Rules for compiling .c files in the various source subdirectories.
1909 %.o: ${srcdir}/common/%.c
1913 %.o: $(srcdir)/gdbtk/generic/%.c
1914 $(COMPILE) $(all_gdbtk_cflags) $<
1917 %.o: $(srcdir)/guile/%.c
1921 %.o: ${srcdir}/nat/%.c
1925 %.o: $(srcdir)/python/%.c
1926 $(COMPILE) $(PYTHON_CFLAGS) $<
1929 %.o: ${srcdir}/target/%.c
1933 %.o: $(srcdir)/tui/%.c
1937 %.o: ${srcdir}/unittests/%.c
1941 # Specify an explicit rule for gdb/common/agent.c, to avoid a clash with the
1942 # object file generate by gdb/agent.c.
1943 common-agent.o: $(srcdir)/common/agent.c
1944 $(COMPILE) $(srcdir)/common/agent.c
1949 # The check target can not use subdir_do, because subdir_do does not
1950 # use TARGET_FLAGS_TO_PASS.
1952 @if [ -f testsuite/Makefile ]; then \
1953 rootme=`pwd`; export rootme; \
1954 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1956 $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
1960 @if [ -f testsuite/Makefile ]; then \
1961 rootme=`pwd`; export rootme; \
1962 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1964 $(MAKE) $(TARGET_FLAGS_TO_PASS) check-perf; \
1968 @if [ -f testsuite/Makefile ]; then \
1969 rootme=`pwd`; export rootme; \
1970 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1972 $(MAKE) $(TARGET_FLAGS_TO_PASS) check-read1; \
1975 check-parallel: force
1976 @if [ -f testsuite/Makefile ]; then \
1977 rootme=`pwd`; export rootme; \
1978 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1980 $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
1983 # The idea is to parallelize testing of multilibs, for example:
1984 # make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
1985 # will run 3 concurrent sessions of check, eventually testing all 10
1986 # combinations. GNU make is required for the % pattern to work, as is
1987 # a shell that expands alternations within braces. If GNU make is not
1988 # used, this rule will harmlessly fail to match. Used FORCE_PARALLEL to
1989 # prevent serialized checking due to the passed RUNTESTFLAGS.
1990 # FIXME: use config.status --config not --version, when available.
1992 @if [ -f testsuite/config.status ]; then \
1993 rootme=`pwd`; export rootme; \
1994 rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
1995 target=`echo "$@" | sed 's,//.*,,'`; \
1996 variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
1997 vardots=`echo "$$variant" | sed 's,/,.,g'`; \
1998 testdir=testsuite.$$vardots; \
1999 if [ ! -f $$testdir/Makefile ] && [ -f testsuite/config.status ]; then \
2000 configargs=`cd testsuite && ./config.status --version | \
2001 sed -n -e 's,"$$,,' -e 's,^ *with options ",,p'`; \
2002 $(SHELL) $(srcdir)/../mkinstalldirs $$testdir && \
2004 eval $(SHELL) "\"\$$rootsrc/testsuite/configure\" $$configargs" \
2005 "\"--srcdir=\$$rootsrc/testsuite\"" \
2007 else :; fi && cd $$testdir && \
2008 $(MAKE) $(TARGET_FLAGS_TO_PASS) \
2009 RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
2010 FORCE_PARALLEL=$(if $(FORCE_PARALLEL),1,$(if $(RUNTESTFLAGS),,1)) \
2014 # The set of headers checked by 'check-headers' by default.
2015 CHECK_HEADERS = $(HFILES_NO_SRCDIR)
2017 # Try to compile each header in isolation, thus ensuring headers are
2020 # Defaults to checking all $HFILES_NO_SRCDIR headers.
2024 # make check-headers CHECK_HEADERS="header.h list.h"
2026 # to check specific headers.
2029 @echo Checking headers.
2030 for i in $(CHECK_HEADERS) ; do \
2031 $(CXX) $(CXX_DIALECT) -x c++-header -c -fsyntax-only \
2032 $(INTERNAL_CFLAGS) -include defs.h $(srcdir)/$$i ; \
2034 .PHONY: check-headers
2036 info install-info clean-info dvi pdf install-pdf html install-html: force
2037 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
2039 # Traditionally "install" depends on "all". But it may be useful
2040 # not to; for example, if the user has made some trivial change to a
2041 # source file and doesn't care about rebuilding or just wants to save the
2042 # time it takes for make to check that all is up to date.
2043 # install-only is intended to address that need.
2045 @$(MAKE) $(FLAGS_TO_PASS) install-only
2047 install-only: $(CONFIG_INSTALL)
2048 transformed_name=`t='$(program_transform_name)'; \
2049 echo gdb | sed -e "$$t"` ; \
2050 if test "x$$transformed_name" = x; then \
2051 transformed_name=gdb ; \
2055 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
2056 $(INSTALL_PROGRAM) gdb$(EXEEXT) \
2057 $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
2058 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(includedir)/gdb ; \
2059 $(INSTALL_DATA) jit-reader.h $(DESTDIR)$(includedir)/gdb/jit-reader.h
2060 if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" != x; \
2062 transformed_name=`t='$(program_transform_name)'; \
2063 echo gcore | sed -e "$$t"` ; \
2064 if test "x$$transformed_name" = x; then \
2065 transformed_name=gcore ; \
2069 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
2070 $(INSTALL_SCRIPT) gcore \
2071 $(DESTDIR)$(bindir)/$$transformed_name; \
2073 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
2076 $(MAKE) $(FLAGS_TO_PASS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
2077 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
2078 `test -z '$(STRIP)' || \
2079 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install-only
2082 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/guile/gdb
2085 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
2087 uninstall: force $(CONFIG_UNINSTALL)
2088 transformed_name=`t='$(program_transform_name)'; \
2089 echo gdb | sed -e $$t` ; \
2090 if test "x$$transformed_name" = x; then \
2091 transformed_name=gdb ; \
2095 rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
2096 $(DESTDIR)$(man1dir)/$$transformed_name.1
2097 if test "x$(HAVE_NATIVE_GCORE_TARGET)$(HAVE_NATIVE_GCORE_HOST)" != x; \
2099 transformed_name=`t='$(program_transform_name)'; \
2100 echo gcore | sed -e "$$t"` ; \
2101 if test "x$$transformed_name" = x; then \
2102 transformed_name=gcore ; \
2106 rm -f $(DESTDIR)$(bindir)/$$transformed_name; \
2108 @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
2110 # The C++ name parser can be built standalone for testing.
2111 test-cp-name-parser.o: cp-name-parser.c
2112 $(COMPILE) -DTEST_CPNAMES cp-name-parser.c
2115 test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
2116 $(CC_LD) $(INTERNAL_LDFLAGS) -o test-cp-name-parser$(EXEEXT) \
2117 test-cp-name-parser.o $(LIBIBERTY)
2119 # We do this by grepping through sources. If that turns out to be too slow,
2120 # maybe we could just require every .o file to have an initialization routine
2121 # of a given name (top.o -> _initialize_top, etc.).
2123 # Formatting conventions: The name of the _initialize_* routines must start
2124 # in column zero, and must not be inside #if.
2126 # Note that the set of files with init functions might change, or the names
2127 # of the functions might change, so this files needs to depend on all the
2128 # object files that will be linked into gdb.
2130 # FIXME: There is a problem with this approach - init.c may force
2131 # unnecessary files to be linked in.
2133 # FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that
2134 # the first call is to _initialize_gdbtypes (implemented by explicitly
2135 # putting that function's name first in the init.l-tmp file). This is
2136 # a hack to ensure that all the architecture dependant global
2137 # builtin_type_* variables are initialized before anything else
2138 # (per-architecture code is called in the same order that it is
2139 # registered). The ``correct fix'' is to have all the builtin types
2140 # made part of the architecture and initialize them on-demand (using
2141 # gdbarch_data) just like everything else. The catch is that other
2142 # modules still take the address of these builtin types forcing them
2143 # to be variables, sigh!
2145 # NOTE: cagney/2003-03-18: The sed pattern ``s|^\([^ /]...'' is
2146 # anchored on the first column and excludes the ``/'' character so
2147 # that it doesn't add the $(srcdir) prefix to any file that already
2148 # has an absolute path. It turns out that $(DEC)'s True64 make
2149 # automatically adds the $(srcdir) prefixes when it encounters files
2150 # in sub-directories such as cli/ and mi/.
2152 # NOTE: cagney/2004-02-08: The ``case "$$fs" in'' eliminates
2153 # duplicates. Files in the gdb/ directory can end up appearing in
2154 # COMMON_OBS (as a .o file) and CONFIG_SRCS (as a .c file).
2156 INIT_FILES = $(COMMON_OBS) $(TSOBS) $(CONFIG_SRCS) $(SUBDIR_GCC_COMPILE_SRCS)
2157 init.c: $(INIT_FILES)
2159 @rm -f init.c-tmp init.l-tmp
2161 @echo gdbtypes > init.l-tmp
2162 @-LANG=C ; export LANG ; \
2163 LC_ALL=C ; export LC_ALL ; \
2164 echo $(INIT_FILES) | \
2167 -e '/^gdbtypes.[co]$$/d' \
2168 -e '/^init.[co]$$/d' \
2169 -e '/xdr_ld.[co]$$/d' \
2170 -e '/xdr_ptrace.[co]$$/d' \
2171 -e '/xdr_rdb.[co]$$/d' \
2172 -e '/udr.[co]$$/d' \
2173 -e '/udip2soc.[co]$$/d' \
2174 -e '/udi2go32.[co]$$/d' \
2175 -e '/version.[co]$$/d' \
2176 -e '/^[a-z0-9A-Z_]*_[SU].[co]$$/d' \
2177 -e '/[a-z0-9A-Z_]*-exp.tab.[co]$$/d' \
2178 -e 's/-exp\.o$$/-exp.y/' \
2179 -e 's/\.[co]$$/.c/' \
2180 -e 's,signals\.c,common/signals\.c,' \
2181 -e 's|^\([^ /][^ ]*\)|$(srcdir)/\1|g' | \
2183 sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \
2188 * ) echo $$f ; fs="$$fs $$f";; \
2191 @echo '/* Do not modify this file. */' >>init.c-tmp
2192 @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
2193 @echo '#include "defs.h" /* For initialize_file_ftype. */' >>init.c-tmp
2194 @echo 'extern void initialize_all_files(void);' >>init.c-tmp
2195 @sed -e 's/\(.*\)/extern initialize_file_ftype _initialize_\1;/' <init.l-tmp >>init.c-tmp
2196 @echo 'void' >>init.c-tmp
2197 @echo 'initialize_all_files (void)' >>init.c-tmp
2198 @echo '{' >>init.c-tmp
2199 @sed -e 's/\(.*\)/ _initialize_\1 ();/' <init.l-tmp >>init.c-tmp
2200 @echo '}' >>init.c-tmp
2202 @mv init.c-tmp init.c
2206 # Create a library of the gdb object files and build GDB by linking
2209 # init.o is very important. It pulls in the rest of GDB.
2210 LIBGDB_OBS = $(COMMON_OBS) $(TSOBS) $(ADD_FILES) init.o
2211 libgdb.a: $(LIBGDB_OBS)
2213 $(AR) q libgdb.a $(LIBGDB_OBS)
2216 # Removing the old gdb first works better if it is running, at least on SunOS.
2217 gdb$(EXEEXT): gdb.o $(LIBGDB_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
2219 $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
2220 -o gdb$(EXEEXT) gdb.o $(LIBGDB_OBS) \
2221 $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
2223 # Convenience rule to handle recursion.
2224 $(LIBGNU) $(GNULIB_H): all-lib
2225 all-lib: $(GNULIB_BUILDDIR)/Makefile
2226 @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do
2229 # Convenience rule to handle recursion.
2230 .PHONY: all-data-directory
2231 all-data-directory: data-directory/Makefile
2232 @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=data-directory subdir_do
2234 # This is useful when debugging GDB, because some Unix's don't let you run GDB
2235 # on itself without copying the executable. So "make gdb1" will make
2236 # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
2237 # Removing gdb1 before the copy is the right thing if gdb1 is open
2238 # in another process.
2239 gdb1$(EXEEXT): gdb$(EXEEXT)
2241 cp gdb$(EXEEXT) gdb1$(EXEEXT)
2243 # Put the proper machine-specific files first, so M-. on a machine
2244 # specific routine gets the one for the correct machine. (FIXME: those
2245 # files go in twice; we should be removing them from the main list).
2247 # TAGS depends on all the files that go into it so you can rebuild TAGS
2248 # with `make TAGS' and not have to say `rm TAGS' first.
2250 GDB_NM_FILE = @GDB_NM_FILE@
2251 TAGS: $(TAGFILES_NO_SRCDIR) $(TAGFILES_WITH_SRCDIR)
2253 etags `(test -n "$(GDB_NM_FILE)" && echo "$(srcdir)/$(GDB_NM_FILE)")` \
2254 `(for i in $(DEPFILES) $(TAGFILES_NO_SRCDIR); do \
2255 echo $(srcdir)/$$i ; \
2256 done ; for i in $(TAGFILES_WITH_SRCDIR); do \
2258 done) | sed -e 's/\.o$$/\.c/'` \
2259 `find $(srcdir)/config -name '*.h' -print`
2263 clean mostlyclean: $(CONFIG_CLEAN)
2264 @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(CLEANDIRS)" subdir_do
2265 rm -f *.o *.a $(ADD_FILES) *~ init.c-tmp init.l-tmp version.c-tmp
2266 rm -f init.c version.c observer.h observer.inc
2267 rm -f gdb$(EXEEXT) core make.log
2268 rm -f gdb[0-9]$(EXEEXT)
2269 rm -f test-cp-name-parser$(EXEEXT)
2270 rm -f xml-builtin.c stamp-xml
2272 for i in $(CONFIG_SRC_SUBDIR); do \
2274 rm -f $$i/$(DEPDIR)/*; \
2277 # This used to depend on c-exp.c m2-exp.c TAGS
2278 # I believe this is wrong; the makefile standards for distclean just
2279 # describe removing files; the only sort of "re-create a distribution"
2280 # functionality described is if the distributed files are unmodified.
2281 # NB: While GDBSERVER might be configured on native systems, it isn't
2282 # always included in SUBDIRS. Remove the gdbserver files explicitly.
2284 @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
2285 rm -rf $(GNULIB_BUILDDIR)
2286 rm -f gdbserver/config.status gdbserver/config.log
2287 rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h
2288 rm -f gdbserver/Makefile gdbserver/config.cache
2289 rm -f nm.h config.status config.h stamp-h gdb-gdb.gdb jit-reader.h
2290 rm -f y.output yacc.acts yacc.tmp y.tab.h
2291 rm -f config.log config.cache
2294 for i in $(CONFIG_SRC_SUBDIR); do \
2295 rmdir $$i/$(DEPDIR); \
2298 maintainer-clean: local-maintainer-clean do-maintainer-clean distclean
2299 realclean: maintainer-clean
2301 local-maintainer-clean:
2302 @echo "This command is intended for maintainers to use;"
2303 @echo "it deletes files that may require special tools to rebuild."
2306 ada-lex.c ada-exp.c \
2307 d-exp.c f-exp.c go-exp.c m2-exp.c p-exp.c rust-exp.c
2308 rm -f TAGS $(INFOFILES)
2310 rm -f nm.h config.status
2312 do-maintainer-clean:
2313 @$(MAKE) $(FLAGS_TO_PASS) DO=maintainer-clean "DODIRS=$(CLEANDIRS)" \
2316 diststuff: $(DISTSTUFF) $(PACKAGE).pot $(CATALOGS)
2317 cd doc; $(MAKE) $(MFLAGS) diststuff
2320 @for i in $(DODIRS); do \
2322 $(REQUIRED_SUBDIRS)) \
2323 if [ ! -f ./$$i/Makefile ] ; then \
2324 echo "Missing $$i/Makefile" >&2 ; \
2328 if [ -f ./$$i/Makefile ] ; then \
2330 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
2331 else exit 1 ; fi ; \
2335 Makefile: Makefile.in config.status
2336 # Regenerate the Makefile and the tm.h / nm.h links.
2337 CONFIG_FILES="Makefile" \
2340 $(SHELL) config.status
2342 $(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
2343 @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
2344 CONFIG_COMMANDS="depfiles" \
2347 $(SHELL) config.status
2349 data-directory/Makefile: data-directory/Makefile.in config.status
2350 CONFIG_FILES="data-directory/Makefile" \
2351 CONFIG_COMMANDS="depfiles" \
2354 $(SHELL) config.status
2358 ./gdb$(EXEEXT) --data-directory=`pwd`/data-directory $(GDBFLAGS)
2360 jit-reader.h: $(srcdir)/jit-reader.in
2361 $(SHELL) config.status $@
2363 gcore: $(srcdir)/gcore.in
2364 $(SHELL) config.status $@
2366 config.h: stamp-h ; @true
2367 stamp-h: $(srcdir)/config.in config.status
2368 CONFIG_HEADERS=config.h:config.in \
2369 CONFIG_COMMANDS="default depdir" \
2372 $(SHELL) config.status
2374 config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
2375 $(SHELL) config.status --recheck
2378 ACLOCAL_AMFLAGS = -I ../config
2380 # Keep these in sync with the includes in acinclude.m4.
2383 acx_configure_dir.m4 \
2387 ../config/acinclude.m4 \
2388 ../config/plugins.m4 \
2389 ../config/lead-dot.m4 \
2390 ../config/override.m4 \
2391 ../config/largefile.m4 \
2392 ../config/gettext-sister.m4 \
2393 ../config/lib-ld.m4 \
2394 ../config/lib-prefix.m4 \
2395 ../config/lib-link.m4 \
2398 ../config/depstand.m4 \
2399 ../config/lcmessage.m4 \
2400 ../config/codeset.m4 \
2403 $(srcdir)/aclocal.m4: @MAINTAINER_MODE_TRUE@ $(aclocal_m4_deps)
2404 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
2407 configure_deps = $(srcdir)/configure.ac $(srcdir)/aclocal.m4
2408 $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(configure_deps)
2409 cd $(srcdir) && $(AUTOCONF)
2411 AUTOHEADER = autoheader
2412 $(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(configure_deps)
2413 cd $(srcdir) && $(AUTOHEADER)
2417 # automatic rebuilding in automake-generated Makefiles requires
2418 # this rule in the toplevel Makefile, which, with GNU make, causes
2419 # the desired updates through the implicit regeneration of the Makefile
2420 # and all of its prerequisites.
2427 # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
2429 cd doc; $(MAKE) refcard.dvi $(FLAGS_TO_PASS)
2431 # GDB QUICK REFERENCE (PostScript output, common PS fonts)
2433 cd doc; $(MAKE) refcard.ps $(FLAGS_TO_PASS)
2435 # GDB MANUAL: TeX dvi file
2437 cd doc; $(MAKE) gdb.dvi $(FLAGS_TO_PASS)
2439 # GDB MANUAL: info file
2441 cd doc; $(MAKE) gdb.info $(FLAGS_TO_PASS)
2443 # Make copying.c from COPYING
2444 $(srcdir)/copying.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/../COPYING3 $(srcdir)/copying.awk
2445 awk -f $(srcdir)/copying.awk \
2446 < $(srcdir)/../COPYING3 > $(srcdir)/copying.tmp
2447 mv $(srcdir)/copying.tmp $(srcdir)/copying.c
2449 version.c: Makefile version.in $(srcdir)/../bfd/version.h $(srcdir)/common/create-version.sh
2450 $(SHELL) $(srcdir)/common/create-version.sh $(srcdir) \
2451 $(host_alias) $(target_alias) version.c
2453 observer.h: observer.sh doc/observer.texi
2454 ${srcdir}/observer.sh h ${srcdir}/doc/observer.texi observer.h
2456 observer.inc: observer.sh doc/observer.texi
2457 ${srcdir}/observer.sh inc ${srcdir}/doc/observer.texi observer.inc
2460 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
2461 `echo $(DEPFILES) $(CONFIG_OBS) | sed 's/\.o /\.c /g'`
2463 gdb.cxref: $(SFILES)
2464 cxref -I. $(SFILES) >gdb.cxref
2468 # GNU Make has an annoying habit of putting *all* the Makefile variables
2469 # into the environment, unless you include this target as a circumvention.
2470 # Rumor is that this will be fixed (and this target can be removed)
2474 # GNU Make 3.63 has a different problem: it keeps tacking command line
2475 # overrides onto the definition of $(MAKE). This variable setting
2480 aarch64-fbsd-nat.c \
2481 aarch64-fbsd-tdep.c \
2482 aarch64-linux-nat.c \
2483 aarch64-linux-tdep.c \
2484 aarch64-newlib-tdep.c \
2490 alpha-linux-tdep.c \
2491 alpha-mdebug-tdep.c \
2496 amd64-darwin-tdep.c \
2497 amd64-dicos-tdep.c \
2501 amd64-linux-tdep.c \
2514 arm-get-next-pcs.c \
2521 arm-symbian-tdep.c \
2550 i386-cygwin-tdep.c \
2552 i386-darwin-tdep.c \
2569 ia64-libunwind-tdep.c \
2590 microblaze-linux-tdep.c \
2602 mips64-obsd-tdep.c \
2607 nios2-linux-tdep.c \
2620 ppc-ravenscar-thread.c \
2624 ravenscar-thread.c \
2627 rs6000-lynx178-tdep.c \
2647 sparc-linux-tdep.c \
2652 sparc-ravenscar-thread.c \
2656 sparc64-fbsd-nat.c \
2657 sparc64-fbsd-tdep.c \
2658 sparc64-linux-nat.c \
2659 sparc64-linux-tdep.c \
2661 sparc64-nbsd-nat.c \
2662 sparc64-nbsd-tdep.c \
2663 sparc64-obsd-nat.c \
2664 sparc64-obsd-tdep.c \
2665 sparc64-sol2-tdep.c \
2670 tilegx-linux-nat.c \
2671 tilegx-linux-tdep.c \
2683 xtensa-linux-nat.c \
2684 xtensa-linux-tdep.c \
2687 common/mingw-strerror.c \
2688 common/posix-strerror.c
2690 # Some files need explicit build rules (due to -Werror problems) or due
2691 # to sub-directory fun 'n' games.
2693 # Do not try to build "printcmd.c" with -Wformat-nonliteral. It manually
2694 # checks format strings.
2695 printcmd.o: $(srcdir)/printcmd.c
2696 $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
2697 $(COMPILE.post) $(srcdir)/printcmd.c
2700 # Same for "target-float.c".
2701 target-float.o: $(srcdir)/target-float.c
2702 $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
2703 $(COMPILE.post) $(srcdir)/target-float.c
2705 # ada-exp.c can appear in srcdir, for releases; or in ., for
2706 # development builds.
2707 ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
2709 # Some versions of flex give output that triggers
2710 # -Wold-style-definition.
2711 ada-exp.o: ada-exp.c
2712 $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
2713 $(COMPILE.post) $(ADA_EXP_C)
2716 # Message files. Based on code in gcc/Makefile.in.
2718 # Rules for generating translated message descriptions. Disabled by
2719 # autoconf if the tools are not available.
2721 .PHONY: all-po install-po uninstall-po clean-po update-po $(PACKAGE).pot
2725 # This notation should be acceptable to all Make implementations used
2726 # by people who are interested in updating .po files.
2727 update-po: $(CATALOGS:.gmo=.pox)
2729 # N.B. We do not attempt to copy these into $(srcdir). The snapshot
2732 -test -d po || mkdir po
2733 $(GMSGFMT) --statistics -o $@ $<
2735 # The new .po has to be gone over by hand, so we deposit it into
2736 # build/po with a different extension. If build/po/$(PACKAGE).pot
2737 # exists, use it (it was just created), else use the one in srcdir.
2739 -test -d po || mkdir po
2740 $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
2741 then echo po/$(PACKAGE).pot; \
2742 else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
2744 # This rule has to look for .gmo modules in both srcdir and the cwd,
2745 # and has to check that we actually have a catalog for each language,
2746 # in case they weren't built or included with the distribution.
2748 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(datadir)
2749 cats="$(CATALOGS)"; for cat in $$cats; do \
2750 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
2751 if [ -f $$cat ]; then :; \
2752 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
2755 dir=$(localedir)/$$lang/LC_MESSAGES; \
2756 echo $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir; \
2757 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$$dir || exit 1; \
2758 echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
2759 $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
2762 cats="$(CATALOGS)"; for cat in $$cats; do \
2763 lang=`basename $$cat | sed 's/\.gmo$$//'`; \
2764 if [ -f $$cat ]; then :; \
2765 elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
2768 dir=$(localedir)/$$lang/LC_MESSAGES; \
2769 rm -f $(DESTDIR)$$dir/$(PACKAGE).mo; \
2771 # Delete po/*.gmo only if we are not building in the source directory.
2773 -if [ ! -f Makefile.in ]; then rm -f po/*.gmo; fi
2775 # Rule for regenerating the message template (gdb.pot). Instead of
2776 # forcing everyone to edit POTFILES.in, which proved impractical, this
2777 # rule has no dependencies and always regenerates gdb.pot. This is
2778 # relatively harmless since the .po files do not directly depend on
2779 # it. The .pot file is left in the build directory. Since GDB's
2780 # Makefile lacks a cannonical list of sources (missing xm, tm and nm
2781 # files) force this rule.
2782 $(PACKAGE).pot: po/$(PACKAGE).pot
2783 po/$(PACKAGE).pot: force
2784 -test -d po || mkdir po
2785 sh -e $(srcdir)/po/gdbtext $(XGETTEXT) $(PACKAGE) . $(srcdir)
2789 # YACC/LEX dependencies
2791 # LANG-exp.c is generated in objdir from LANG-exp.y if it doesn't
2792 # exist in srcdir, then compiled in objdir to LANG-exp.o. If we
2793 # said LANG-exp.c rather than ./c-exp.c some makes would
2794 # sometimes re-write it into $(srcdir)/c-exp.c. Remove bogus
2795 # decls for malloc/realloc/free which conflict with everything else.
2796 # Strictly speaking c-exp.c should therefore depend on
2797 # Makefile.in, but that was a pretty big annoyance.
2801 $(SHELL) $(YLWRAP) $< y.tab.c $@ -- $(YACC) $(YFLAGS) && mv $@ $@.tmp \
2802 || (rm -f $@; false)
2803 sed -e '/extern.*malloc/d' \
2804 -e '/extern.*realloc/d' \
2805 -e '/extern.*free/d' \
2806 -e '/include.*malloc.h/d' \
2807 -e 's/\([^x]\)malloc/\1xmalloc/g' \
2808 -e 's/\([^x]\)realloc/\1xrealloc/g' \
2809 -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
2810 -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
2811 -e '/^#line.*y.tab.c/d' \
2812 -e 's/YY_NULL/YY_NULLPTR/g' \
2816 if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
2817 $(FLEX) -o$@ $< && \
2819 sed -e '/extern.*malloc/d' \
2820 -e '/extern.*realloc/d' \
2821 -e '/extern.*free/d' \
2822 -e '/include.*malloc.h/d' \
2823 -e 's/\([^x]\)malloc/\1xmalloc/g' \
2824 -e 's/\([^x]\)realloc/\1xrealloc/g' \
2825 -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
2826 -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
2827 -e 's/yy_flex_xrealloc/yyxrealloc/g' \
2831 elif [ -f $@ ]; then \
2832 echo "Warning: $*.c older than $*.l and flex not available."; \
2834 echo "$@ missing and flex not available."; \
2838 .PRECIOUS: ada-lex.c
2842 xml-builtin.c: stamp-xml; @true
2843 stamp-xml: $(srcdir)/features/feature_to_c.sh Makefile $(XMLFILES)
2844 rm -f xml-builtin.tmp
2846 $(SHELL) $(srcdir)/features/feature_to_c.sh \
2847 xml-builtin.tmp $(XMLFILES)
2848 $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin.c
2849 echo stamp > stamp-xml
2851 .PRECIOUS: xml-builtin.c
2854 # GDBTK sub-directory
2857 all-gdbtk: insight$(EXEEXT)
2860 transformed_name=`t='$(program_transform_name)'; \
2861 echo insight | sed -e $$t` ; \
2862 if test "x$$transformed_name" = x; then \
2863 transformed_name=insight ; \
2867 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
2868 $(INSTALL_PROGRAM) insight$(EXEEXT) \
2869 $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
2870 $(SHELL) $(srcdir)/../mkinstalldirs \
2871 $(DESTDIR)$(GDBTK_LIBRARY) ; \
2872 $(SHELL) $(srcdir)/../mkinstalldirs \
2873 $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION) ; \
2874 $(INSTALL_DATA) $(srcdir)/gdbtk/plugins/plugins.tcl \
2875 $(DESTDIR)$(libdir)/insight$(GDBTK_VERSION)/plugins.tcl ; \
2876 $(SHELL) $(srcdir)/../mkinstalldirs \
2877 $(DESTDIR)$(GDBTK_LIBRARY)/images \
2878 $(DESTDIR)$(GDBTK_LIBRARY)/images2 ; \
2879 $(SHELL) $(srcdir)/../mkinstalldirs \
2880 $(DESTDIR)$(GDBTK_LIBRARY)/help \
2881 $(DESTDIR)$(GDBTK_LIBRARY)/help/images \
2882 $(DESTDIR)$(GDBTK_LIBRARY)/help/trace ; \
2883 cd $(srcdir)/gdbtk/library ; \
2884 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; \
2886 $(INSTALL_DATA) $$i $(DESTDIR)$(GDBTK_LIBRARY)/$$i ; \
2890 transformed_name=`t='$(program_transform_name)'; \
2891 echo insight | sed -e $$t` ; \
2892 if test "x$$transformed_name" = x; then \
2893 transformed_name=insight ; \
2897 rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
2898 rm -rf $(DESTDIR)$(GDBTK_LIBRARY)
2901 rm -f insight$(EXEEXT)
2903 # Removing the old gdb first works better if it is running, at least on SunOS.
2904 insight$(EXEEXT): gdbtk-main.o libgdb.a $(ADD_DEPS) \
2905 $(CDEPS) $(TDEPLIBS)
2906 rm -f insight$(EXEEXT)
2907 $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
2908 -o insight$(EXEEXT) gdbtk-main.o libgdb.a \
2909 $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
2911 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
2912 $(WINDRES) --include $(srcdir)/gdbtk $(srcdir)/gdbtk/gdb.rc gdbres.o
2914 all_gdbtk_cflags = $(IDE_CFLAGS) $(ITCL_CFLAGS) \
2915 $(ITK_CFLAGS) $(TCL_CFLAGS) $(TK_CFLAGS) $(X11_CFLAGS) \
2917 -DGDBTK_LIBRARY=\"$(GDBTK_LIBRARY)\" \
2918 -DSRC_DIR=\"$(GDBTK_SRC_DIR)\"
2921 # Dependency tracking.
2924 ifeq ($(DEPMODE),depmode=gcc3)
2925 # Note that we put the dependencies into a .Tpo file, then move them
2926 # into place if the compile succeeds. We need this because gcc does
2927 # not atomically write the dependency output file.
2928 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
2929 -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
2930 override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
2931 $(@D)/$(DEPDIR)/$(basename $(@F)).Po
2933 override COMPILE.pre = source='$<' object='$@' libtool=no \
2934 DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
2935 $(CXX) -x c++ $(CXX_DIALECT)
2936 # depcomp handles atomicity for us, so we don't need a postcompile
2938 override POSTCOMPILE =
2941 # A list of all the objects we might care about in this build, for
2942 # dependency tracking.
2943 all_object_files = gdb.o $(LIBGDB_OBS) gdbtk-main.o \
2944 test-cp-name-parser.o
2946 # Ensure that generated files are created early. Use order-only
2947 # dependencies if available. They require GNU make 3.80 or newer,
2948 # and the .VARIABLES variable was introduced at the same time.
2950 $(all_object_files): | $(generated_files)
2952 $(all_object_files) : $(generated_files)
2956 -include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
2958 # Disable implicit make rules.
2959 include $(srcdir)/disable-implicit-rules.mk
2961 ### end of the gdb Makefile.in.