Move gnulib to top level
[deliverable/binutils-gdb.git] / gdb / Makefile.in
index 3b158fa1db5c560c77e51f8756fc7462abaeda7e..7308ea5767424b5bb095b531ed8f99a7d26465a5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1989-2018 Free Software Foundation, Inc.
+# Copyright (C) 1989-2019 Free Software Foundation, Inc.
 
 # This file is part of GDB.
 
@@ -194,6 +194,10 @@ LIBIPT = @LIBIPT@
 # Where is libmpfr?  This will be empty if libmpfr was not available.
 LIBMPFR = @LIBMPFR@
 
+# GNU source highlight library.
+SRCHIGH_LIBS = @SRCHIGH_LIBS@
+SRCHIGH_CFLAGS = @SRCHIGH_CFLAGS@
+
 WARN_CFLAGS = @WARN_CFLAGS@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 GDB_WARN_CFLAGS = $(WARN_CFLAGS)
@@ -220,13 +224,9 @@ CODESIGN_CERT = @CODESIGN_CERT@
 GDBFLAGS =
 
 # Helper code from gnulib.
-GNULIB_BUILDDIR = build-gnulib
+GNULIB_BUILDDIR = ../gnulib
 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
-INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import
-
-# Generated headers in the gnulib directory.  These must be listed
-# so that they are generated before other files are compiled.
-GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
+INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
 
 #
 # CLI sub directory definitons
@@ -237,8 +237,10 @@ SUBDIR_CLI_SRCS = \
        cli/cli-dump.c \
        cli/cli-interp.c \
        cli/cli-logging.c \
+       cli/cli-option.c \
        cli/cli-script.c \
        cli/cli-setshow.c \
+       cli/cli-style.c \
        cli/cli-utils.c
 
 SUBDIR_CLI_OBS = $(patsubst %.c,%.o,$(SUBDIR_CLI_SRCS))
@@ -406,8 +408,10 @@ SUBDIR_PYTHON_CFLAGS =
 
 SUBDIR_UNITTESTS_SRCS = \
        unittests/array-view-selftests.c \
+       unittests/child-path-selftests.c \
        unittests/cli-utils-selftests.c \
        unittests/common-utils-selftests.c \
+       unittests/copy_bitwise-selftests.c \
        unittests/environ-selftests.c \
        unittests/format_pieces-selftests.c \
        unittests/function-view-selftests.c \
@@ -419,11 +423,13 @@ SUBDIR_UNITTESTS_SRCS = \
        unittests/optional-selftests.c \
        unittests/parse-connection-spec-selftests.c \
        unittests/ptid-selftests.c \
+       unittests/mkdir-recursive-selftests.c \
        unittests/rsp-low-selftests.c \
        unittests/scoped_fd-selftests.c \
        unittests/scoped_mmap-selftests.c \
        unittests/scoped_restore-selftests.c \
        unittests/string_view-selftests.c \
+       unittests/style-selftests.c \
        unittests/tracepoint-selftests.c \
        unittests/unpack-selftests.c \
        unittests/utils-selftests.c \
@@ -446,8 +452,7 @@ OPCODES = $(OPCODES_DIR)/libopcodes.a
 # Where are the other opcode tables which only have header file
 # versions?
 OP_INCLUDE = $(INCLUDE_DIR)/opcode
-# Some source files like to use #include "opcodes/file.h"
-OPCODES_CFLAGS = -I$(OP_INCLUDE) -I$(OPCODES_SRC)/..
+OPCODES_CFLAGS = -I$(OP_INCLUDE)
 
 # The simulator is usually nonexistent; targets that include one
 # should set this to list all the .o or .a files to be linked in.
@@ -524,7 +529,8 @@ CONFIG_INSTALL = @CONFIG_INSTALL@
 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
-CONFIG_SRC_SUBDIR = arch cli mi common compile tui unittests guile python target
+CONFIG_SRC_SUBDIR = arch cli mi common compile tui unittests guile python \
+       target nat
 CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 
 # -I. for config files.
@@ -535,7 +541,7 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 # your system doesn't have fcntl.h in /usr/include (which is where it
 # should be according to Posix).
 DEFS = @DEFS@
-GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/common -I$(srcdir)/config \
+GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config \
        -DLOCALEDIR="\"$(localedir)\"" $(DEFS)
 
 # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory.
@@ -562,7 +568,8 @@ INTERNAL_CFLAGS_BASE = \
        $(CXXFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) \
        $(GDB_CFLAGS) $(OPCODES_CFLAGS) $(READLINE_CFLAGS) $(ZLIBINC) \
        $(BFD_CFLAGS) $(INCLUDE_CFLAGS) $(LIBDECNUMBER_CFLAGS) \
-       $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS)
+       $(INTL_CFLAGS) $(INCGNU) $(ENABLE_CFLAGS) $(INTERNAL_CPPFLAGS) \
+       $(SRCHIGH_CFLAGS)
 INTERNAL_WARN_CFLAGS = $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS)
 INTERNAL_CFLAGS = $(INTERNAL_WARN_CFLAGS) $(GDB_WERROR_CFLAGS)
 
@@ -578,9 +585,6 @@ INTERNAL_LDFLAGS = \
        $(CXXFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) \
        $(LDFLAGS) $(CONFIG_LDFLAGS)
 
-# If your system is missing alloca(), or, more likely, it's there but
-# it doesn't work, then refer to libiberty.
-
 # Libraries and corresponding dependencies for compiling gdb.
 # XM_CLIBS, defined in *config files, have host-dependent libs.
 # LIBIBERTY appears twice on purpose.
@@ -588,7 +592,8 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(ZLIB) $(INTL) $(LIBIBERTY) $(LIBD
        $(XM_CLIBS) $(GDBTKLIBS) \
        @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
        $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
-       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR)
+       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
+       $(SRCHIGH_LIBS)
 CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
        $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
 
@@ -627,6 +632,7 @@ ALL_64_TARGET_OBS = \
        aarch64-fbsd-tdep.o \
        aarch64-linux-tdep.o \
        aarch64-newlib-tdep.o \
+       aarch64-ravenscar-thread.o \
        aarch64-tdep.o \
        alpha-bsd-tdep.o \
        alpha-linux-tdep.o \
@@ -665,11 +671,13 @@ ALL_TARGET_OBS = \
        arch/arm-linux.o \
        arch/i386.o \
        arch/ppc-linux-common.o \
+       arch/riscv.o \
        arm-bsd-tdep.o \
        arm-fbsd-tdep.o \
        arm-linux-tdep.o \
        arm-nbsd-tdep.o \
        arm-obsd-tdep.o \
+       arm-pikeos-tdep.o \
        arm-symbian-tdep.o \
        arm-tdep.o \
        arm-wince-tdep.o \
@@ -736,6 +744,7 @@ ALL_TARGET_OBS = \
        nios2-tdep.o \
        nto-tdep.o \
        obsd-tdep.o \
+       or1k-linux-tdep.o \
        or1k-tdep.o \
        ppc-fbsd-tdep.o \
        ppc-linux-tdep.o \
@@ -745,6 +754,7 @@ ALL_TARGET_OBS = \
        ppc-sysv-tdep.o \
        ppc64-tdep.o \
        ravenscar-thread.o \
+       riscv-fbsd-tdep.o \
        riscv-linux-tdep.o \
        riscv-tdep.o \
        rl78-tdep.o \
@@ -752,6 +762,7 @@ ALL_TARGET_OBS = \
        rs6000-lynx178-tdep.o \
        rs6000-tdep.o \
        rx-tdep.o \
+       s12z-tdep.o \
        s390-linux-tdep.o \
        s390-tdep.o \
        score-tdep.o \
@@ -910,6 +921,7 @@ COMMON_SFILES = \
        ada-varobj.c \
        addrmap.c \
        agent.c \
+       alloc.c \
        annotate.c \
        arch-utils.c \
        auto-load.c \
@@ -1048,6 +1060,8 @@ COMMON_SFILES = \
        macrotab.c \
        main.c \
        maint.c \
+       maint-test-options.c \
+       maint-test-settings.c \
        mdebugread.c \
        mem-break.c \
        memattr.c \
@@ -1069,6 +1083,7 @@ COMMON_SFILES = \
        parse.c \
        printcmd.c \
        probe.c \
+       process-stratum-target.c \
        producer.c \
        progspace.c \
        progspace-and-thread.c \
@@ -1093,6 +1108,7 @@ COMMON_SFILES = \
        solib.c \
        solib-target.c \
        source.c \
+       source-cache.c \
        stabsread.c \
        stack.c \
        std-regs.c \
@@ -1104,8 +1120,9 @@ COMMON_SFILES = \
        target-dcache.c \
        target-descriptions.c \
        target-memory.c \
+       test-target.c \
        thread.c \
-       thread-fsm.c \
+       thread-iter.c \
        tid-parse.c \
        top.c \
        tracefile.c \
@@ -1114,9 +1131,11 @@ COMMON_SFILES = \
        trad-frame.c \
        tramp-frame.c \
        target-float.c \
+       type-stack.c \
        typeprint.c \
        ui-file.c \
        ui-out.c \
+       ui-style.c \
        user-regs.c \
        utils.c \
        valarith.c \
@@ -1165,6 +1184,7 @@ SFILES = \
 # right, it is probably easiest just to list .h files here directly.
 
 HFILES_NO_SRCDIR = \
+       aarch64-ravenscar-thread.h \
        aarch64-tdep.h \
        ada-lang.h \
        addrmap.h \
@@ -1339,6 +1359,7 @@ HFILES_NO_SRCDIR = \
        remote.h \
        remote-fileio.h \
        remote-notif.h \
+       riscv-fbsd-tdep.h \
        riscv-tdep.h \
        rs6000-aix-tdep.h \
        rs6000-tdep.h \
@@ -1364,6 +1385,7 @@ HFILES_NO_SRCDIR = \
        solib-target.h \
        solist.h \
        source.h \
+       source-cache.h \
        sparc-nat.h \
        sparc-ravenscar-thread.h \
        sparc-tdep.h \
@@ -1385,9 +1407,11 @@ HFILES_NO_SRCDIR = \
        trad-frame.h \
        target-float.h \
        tramp-frame.h \
+       type-stack.h \
        typeprint.h \
        ui-file.h \
        ui-out.h \
+       ui-style.h \
        user-regs.h \
        utils.h \
        valprint.h \
@@ -1411,10 +1435,12 @@ HFILES_NO_SRCDIR = \
        arch/i386.h \
        arch/ppc-linux-common.h \
        arch/ppc-linux-tdesc.h \
+       arch/riscv.h \
        cli/cli-cmds.h \
        cli/cli-decode.h \
        cli/cli-script.h \
        cli/cli-setshow.h \
+       cli/cli-style.h \
        cli/cli-utils.h \
        common/buffer.h \
        common/cleanups.h \
@@ -1433,6 +1459,7 @@ HFILES_NO_SRCDIR = \
        common/gdb_assert.h \
        common/gdb_tilde_expand.h \
        common/gdb_locale.h \
+       common/gdb_proc_service.h \
        common/gdb_setjmp.h \
        common/gdb_signals.h \
        common/gdb_sys_time.h \
@@ -1466,17 +1493,8 @@ HFILES_NO_SRCDIR = \
        config/nm-nto.h \
        config/djgpp/langinfo.h \
        config/djgpp/nl_types.h \
-       config/i386/nm-fbsd.h \
        config/i386/nm-i386gnu.h \
        config/sparc/nm-sol2.h \
-       gnulib/import/inttypes.in.h \
-       gnulib/import/stddef.in.h \
-       gnulib/import/stdint.in.h \
-       gnulib/import/str-two-way.h \
-       gnulib/import/string.in.h \
-       gnulib/import/extra/snippet/arg-nonnull.h \
-       gnulib/import/extra/snippet/c++defs.h \
-       gnulib/import/extra/snippet/warn-on-use.h \
        mi/mi-cmds.h \
        mi/mi-common.h \
        mi/mi-console.h \
@@ -1538,9 +1556,6 @@ HFILES_WITH_SRCDIR = \
        ../bfd/bfd.h \
        jit-reader.h
 
-# GDB "info" files, which should be included in their entirety
-INFOFILES = gdb.info*
-
 # {X,T,NAT}DEPFILES are something of a pain in that it's hard to
 # default their values the way we do for SER_HARDWIRE; in the future
 # maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other
@@ -1565,14 +1580,14 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        $(SUBDIR_TARGET_OBS) \
        $(SUBDIR_GCC_COMPILE_OBS)
 
-SUBDIRS = doc @subdirs@ data-directory $(GNULIB_BUILDDIR)
+SUBDIRS = doc @subdirs@ data-directory
 CLEANDIRS = $(SUBDIRS)
 
 # List of subdirectories in the build tree that must exist.
 # This is used to force build failures in existing trees when
 # a new directory is added.
 # The format here is for the `case' shell command.
-REQUIRED_SUBDIRS = doc | testsuite | $(GNULIB_BUILDDIR) | data-directory
+REQUIRED_SUBDIRS = doc | testsuite | data-directory
 
 # Parser intermediate files.
 YYFILES = \
@@ -1602,7 +1617,6 @@ generated_files = \
        config.h \
        gcore \
        jit-reader.h \
-       $(GNULIB_H) \
        $(NAT_GENERATED_FILES)
 
 # Flags needed to compile Python code
@@ -1628,10 +1642,6 @@ python/%.o: INTERNAL_CFLAGS += $(PYTHON_CFLAGS)
        $(COMPILE) $(all_gdbtk_cflags) $<
        $(POSTCOMPILE)
 
-%.o: ${srcdir}/nat/%.c
-       $(COMPILE) $<
-       $(POSTCOMPILE)
-
 installcheck:
 
 # The check target can not use subdir_do, because subdir_do does not
@@ -1823,52 +1833,25 @@ test-cp-name-parser$(EXEEXT): test-cp-name-parser.o $(LIBIBERTY)
 #
 # Note that the set of files with init functions might change, or the names
 # of the functions might change, so this files needs to depend on all the
-# object files that will be linked into gdb.
-
-# FIXME: There is a problem with this approach - init.c may force
-# unnecessary files to be linked in.
-
-# FIXME: cagney/2002-06-09: gdb/564: gdb/563: Force the order so that
-# the first call is to _initialize_gdbtypes (implemented by explicitly
-# putting that function's name first in the init.l-tmp file).  This is
-# a hack to ensure that all the architecture dependant global
-# builtin_type_* variables are initialized before anything else
-# (per-architecture code is called in the same order that it is
-# registered).  The ``correct fix'' is to have all the builtin types
-# made part of the architecture and initialize them on-demand (using
-# gdbarch_data) just like everything else.  The catch is that other
-# modules still take the address of these builtin types forcing them
-# to be variables, sigh!
-
-# NOTE: cagney/2003-03-18: The sed pattern ``s|^\([^ /]...'' is
-# anchored on the first column and excludes the ``/'' character so
-# that it doesn't add the $(srcdir) prefix to any file that already
-# has an absolute path.  It turns out that $(DEC)'s True64 make
-# automatically adds the $(srcdir) prefixes when it encounters files
-# in sub-directories such as cli/ and mi/.
-
-INIT_FILES = $(COMMON_OBS)
+# source files that will be linked into gdb.  However, due to the way
+# this Makefile has generally been written, we do this indirectly, by
+# computing the list of source files from the list of object files.
+
+INIT_FILES = \
+       $(patsubst %.o,%.c, \
+         $(patsubst %-exp.o,%-exp.y, \
+           $(filter-out init.o version.o %_S.o %_U.o,\
+             $(COMMON_OBS))))
+
 init.c: stamp-init; @true
 stamp-init: $(INIT_FILES)
        @$(ECHO_INIT_C) echo "Making init.c"
        @rm -f init.c-tmp init.l-tmp
        @touch init.c-tmp
-       @echo gdbtypes > init.l-tmp
-       @-LANG=C ; export LANG ; \
-       LC_ALL=C ; export LC_ALL ; \
-       echo $(INIT_FILES) | \
-       tr ' ' '\012' | \
-       sed \
-           -e '/^gdbtypes.[co]$$/d' \
-           -e '/^init.[co]$$/d' \
-           -e '/version.[co]$$/d' \
-           -e '/^[a-z0-9A-Z_]*_[SU].[co]$$/d' \
-           -e 's/-exp\.o$$/-exp.y/' \
-           -e 's/\.o$$/.c/' \
-           -e 's|^\([^  /][^     ]*\)|$(srcdir)/\1|g' | \
-       while read f; do \
-           sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' $$f 2>/dev/null; \
-       done >> init.l-tmp
+       @-for f in $(INIT_FILES); do \
+           sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/\1/p' \
+               $(srcdir)/$$f 2>/dev/null; \
+       done > init.l-tmp
        @echo '/* Do not modify this file.  */' >>init.c-tmp
        @echo '/* It is created automatically by the Makefile.  */'>>init.c-tmp
        @echo '#include "defs.h"      /* For initialize_file_ftype.  */' >>init.c-tmp
@@ -1904,12 +1887,6 @@ ifneq ($(CODESIGN_CERT),)
        $(ECHO_SIGN) $(CODESIGN) -s $(CODESIGN_CERT) gdb$(EXEEXT)
 endif
 
-# Convenience rule to handle recursion.
-$(LIBGNU) $(GNULIB_H): all-lib
-all-lib: $(GNULIB_BUILDDIR)/Makefile
-       @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do
-.PHONY: all-lib
-
 # Convenience rule to handle recursion.
 .PHONY: all-data-directory
 all-data-directory: data-directory/Makefile
@@ -1966,7 +1943,6 @@ clean mostlyclean: $(CONFIG_CLEAN)
 # always included in SUBDIRS.  Remove the gdbserver files explicitly.
 distclean: clean
        @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
-       rm -rf $(GNULIB_BUILDDIR)
        rm -f gdbserver/config.status gdbserver/config.log
        rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h
        rm -f gdbserver/Makefile gdbserver/config.cache
@@ -1990,7 +1966,7 @@ local-maintainer-clean:
                cp-name-parser.c \
                ada-lex.c ada-exp.c \
                d-exp.c f-exp.c go-exp.c m2-exp.c p-exp.c rust-exp.c
-       rm -f TAGS $(INFOFILES)
+       rm -f TAGS
        rm -f $(YYFILES)
        rm -f nm.h config.status
 
@@ -2024,13 +2000,6 @@ Makefile: Makefile.in config.status
          CONFIG_HEADERS= \
          $(SHELL) config.status
 
-$(GNULIB_BUILDDIR)/Makefile: gnulib/Makefile.in config.status
-       @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
-         CONFIG_COMMANDS="depfiles" \
-         CONFIG_HEADERS= \
-         CONFIG_LINKS= \
-         $(SHELL) config.status
-
 data-directory/Makefile: data-directory/Makefile.in config.status
        CONFIG_FILES="data-directory/Makefile" \
          CONFIG_COMMANDS="depfiles" \
@@ -2169,6 +2138,7 @@ ALLDEPFILES = \
        aarch64-linux-nat.c \
        aarch64-linux-tdep.c \
        aarch64-newlib-tdep.c \
+       aarch64-ravenscar-thread.c \
        aarch64-tdep.c \
        aix-thread.c \
        alpha-bsd-nat.c \
@@ -2306,6 +2276,8 @@ ALLDEPFILES = \
        procfs.c \
        ravenscar-thread.c \
        remote-sim.c \
+       riscv-fbsd-nat.c \
+       riscv-fbsd-tdep.c \
        riscv-linux-nat.c \
        riscv-linux-tdep.c \
        riscv-tdep.c \
@@ -2322,6 +2294,7 @@ ALLDEPFILES = \
        ser-mingw.c \
        ser-pipe.c \
        ser-tcp.c \
+       ser-uds.c \
        sh-nbsd-nat.c \
        sh-nbsd-tdep.c \
        sh-tdep.c \
This page took 0.03085 seconds and 4 git commands to generate.