Move cli object files to cli subdirectory
[deliverable/binutils-gdb.git] / gdb / Makefile.in
index 5e5fcaae7abafef67d290227dc3caabc303c6130..b9e1e4059645007296d1dec828147cd198ed7b34 100644 (file)
@@ -114,7 +114,7 @@ depcomp = $(SHELL) $(srcdir)/../depcomp
 
 # Note that these are overridden by GNU make-specific code below if
 # GNU make is used.  The overrides implement dependency tracking.
-COMPILE.pre = $(CXX) $(CXX_DIALECT)
+COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
 COMPILE.post = -c -o $@
 COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
 POSTCOMPILE = @true
@@ -194,6 +194,9 @@ LIBBABELTRACE = @LIBBABELTRACE@
 # Where is libipt?  This will be empty if libipt was not available.
 LIBIPT = @LIBIPT@
 
+# Where is libmpfr?  This will be empty if libmpfr was not available.
+LIBMPFR = @LIBMPFR@
+
 WARN_CFLAGS = @WARN_CFLAGS@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 GDB_WARN_CFLAGS = $(WARN_CFLAGS)
@@ -232,16 +235,6 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 #
 # CLI sub directory definitons
 #
-SUBDIR_CLI_OBS = \
-       cli-cmds.o \
-       cli-decode.o \
-       cli-dump.o \
-       cli-interp.o \
-       cli-logging.o \
-       cli-script.o \
-       cli-setshow.o \
-       cli-utils.o
-
 SUBDIR_CLI_SRCS = \
        cli/cli-cmds.c \
        cli/cli-decode.c \
@@ -252,6 +245,8 @@ SUBDIR_CLI_SRCS = \
        cli/cli-setshow.c \
        cli/cli-utils.c
 
+SUBDIR_CLI_OBS = $(patsubst %.c,%.o,$(SUBDIR_CLI_SRCS))
+
 SUBDIR_CLI_DEPS =
 SUBDIR_CLI_LDFLAGS =
 SUBDIR_CLI_CFLAGS =
@@ -526,18 +521,34 @@ SUBDIR_PYTHON_LDFLAGS =
 SUBDIR_PYTHON_CFLAGS =
 
 SUBDIR_UNITTESTS_SRCS = \
+       unittests/array-view-selftests.c \
+       unittests/common-utils-selftests.c \
+       unittests/environ-selftests.c \
        unittests/function-view-selftests.c \
+       unittests/lookup_name_info-selftests.c \
+       unittests/memory-map-selftests.c \
+       unittests/memrange-selftests.c \
        unittests/offset-type-selftests.c \
        unittests/optional-selftests.c \
        unittests/ptid-selftests.c \
-       unittests/scoped_restore-selftests.c
+       unittests/rsp-low-selftests.c \
+       unittests/scoped_restore-selftests.c \
+       unittests/xml-utils-selftests.c
 
 SUBDIR_UNITTESTS_OBS = \
+       array-view-selftests.o \
+       common-utils-selftests.o \
+       environ-selftests.o \
        function-view-selftests.o \
+       lookup_name_info-selftests.o \
+       memory-map-selftests.o \
+       memrange-selftests.o \
        offset-type-selftests.o \
        optional-selftests.o \
        ptid-selftests.o \
-       scoped_restore-selftests.o
+       rsp-low-selftests.o \
+       scoped_restore-selftests.o \
+       xml-utils-selftests.o
 
 # Opcodes currently live in one of two places.  Either they are in the
 # opcode library, typically ../opcodes, or they are in a header file
@@ -628,6 +639,9 @@ CONFIG_INSTALL = @CONFIG_INSTALL@
 CONFIG_UNINSTALL = @CONFIG_UNINSTALL@
 HAVE_NATIVE_GCORE_TARGET = @HAVE_NATIVE_GCORE_TARGET@
 
+CONFIG_SRC_SUBDIR = arch cli
+CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
+
 # -I. for config files.
 # -I$(srcdir) for gdb internal headers.
 # -I$(srcdir)/config for more generic config files.
@@ -688,7 +702,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(ZLIB) $(INTL) $(LIBIBERTY) $(LIBD
        $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) \
        @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
        $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
-       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV)
+       $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR)
 CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
        $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
 
@@ -718,12 +732,9 @@ XMLFILES = \
        $(srcdir)/features/traceframe-info.dtd \
        $(srcdir)/features/xinclude.dtd
 
-# This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX
-# interface to the serial port.  Hopefully if get ported to OS/2, VMS,
-# etc., then there will be (as part of the C library or perhaps as
-# part of libiberty) a POSIX interface.  But at least for now the
-# host-dependent makefile fragment might need to use something else
-# besides ser-unix.o
+# Build the ser-*.o files the host supports.  This includes ser-unix.o
+# for any system that supports a POSIX interface to the serial port.
+# See configure.ac.
 SER_HARDWIRE = @SER_HARDWIRE@
 
 # The `remote' debugging target is supported for most architectures,
@@ -749,7 +760,7 @@ TARGET_OBS = @TARGET_OBS@
 # All target-dependent objects files that require 64-bit CORE_ADDR
 # (used with --enable-targets=all --enable-64-bit-bfd).
 ALL_64_TARGET_OBS = \
-       aarch64-insn.o \
+       aarch64-fbsd-tdep.o \
        aarch64-linux-tdep.o \
        aarch64-newlib-tdep.o \
        aarch64-tdep.o \
@@ -768,6 +779,9 @@ ALL_64_TARGET_OBS = \
        amd64-sol2-tdep.o \
        amd64-tdep.o \
        amd64-windows-tdep.o \
+       arch/aarch64.o \
+       arch/aarch64-insn.o \
+       arch/amd64.o \
        ia64-linux-tdep.o \
        ia64-tdep.o \
        ia64-vms-tdep.o \
@@ -782,10 +796,12 @@ ALL_64_TARGET_OBS = \
 # All other target-dependent objects files (used with --enable-targets=all).
 ALL_TARGET_OBS = \
        arc-tdep.o \
-       arm.o \
+       arch/arm.o \
+       arch/arm-get-next-pcs.o \
+       arch/arm-linux.o \
+       arch/i386.o \
        arm-bsd-tdep.o \
-       arm-get-next-pcs.o \
-       arm-linux.o \
+       arm-fbsd-tdep.o \
        arm-linux-tdep.o \
        arm-nbsd-tdep.o \
        arm-obsd-tdep.o \
@@ -1028,6 +1044,7 @@ SFILES = \
        agent.c \
        annotate.c \
        arch-utils.c \
+       arch/i386.c \
        auto-load.c \
        auxv.c \
        ax-gdb.c \
@@ -1070,11 +1087,9 @@ SFILES = \
        d-valprint.c \
        dbxread.c \
        demangle.c \
-       dfp.c \
        dictionary.c \
        disasm.c \
        disasm-selftests.c \
-       doublest.c \
        dtrace-probe.c \
        dummy-frame.c \
        dwarf2-frame.c \
@@ -1160,6 +1175,7 @@ SFILES = \
        parse.c \
        printcmd.c \
        probe.c \
+       producer.c \
        proc-service.list \
        progspace.c \
        progspace-and-thread.c \
@@ -1176,7 +1192,6 @@ SFILES = \
        reverse.c \
        rust-exp.y \
        rust-lang.c \
-       selftest.c \
        selftest-arch.c \
        sentinel-frame.c \
        ser-base.c \
@@ -1208,6 +1223,7 @@ SFILES = \
        tracepoint.c \
        trad-frame.c \
        tramp-frame.c \
+       target-float.c \
        typeprint.c \
        ui-file.c \
        ui-file.h \
@@ -1236,12 +1252,14 @@ SFILES = \
        common/filestuff.c \
        common/format.c \
        common/job-control.c \
+       common/gdb_tilde_expand.c \
        common/gdb_vecs.c \
        common/new-op.c \
        common/print-utils.c \
        common/ptid.c \
        common/rsp-low.c \
        common/run-time-clock.c \
+       common/selftest.c \
        common/signals.c \
        common/signals-state-save-restore.c \
        common/vec.c \
@@ -1301,11 +1319,9 @@ HFILES_NO_SRCDIR = \
        darwin-nat.h \
        dcache.h \
        defs.h \
-       dfp.h \
        dicos-tdep.h \
        dictionary.h \
        disasm.h \
-       doublest.h \
        dummy-frame.h \
        dwarf2-frame.h \
        dwarf2-frame-tailcall.h \
@@ -1328,7 +1344,6 @@ HFILES_NO_SRCDIR = \
        frv-tdep.h \
        ft32-tdep.h \
        gcore.h \
-       gdb.h \
        gdb_bfd.h \
        gdb_curses.h \
        gdb-dlfcn.h \
@@ -1475,6 +1490,7 @@ HFILES_NO_SRCDIR = \
        tracefile.h \
        tracepoint.h \
        trad-frame.h \
+       target-float.h \
        tramp-frame.h \
        typeprint.h \
        ui-file.h \
@@ -1496,8 +1512,10 @@ HFILES_NO_SRCDIR = \
        xml-syscall.h \
        xml-tdesc.h \
        xtensa-tdep.h \
+       arch/aarch64.h \
        arch/aarch64-insn.h \
        arch/arm.h \
+       arch/i386.h \
        cli/cli-cmds.h \
        cli/cli-decode.h \
        cli/cli-script.h \
@@ -1518,11 +1536,11 @@ HFILES_NO_SRCDIR = \
        common/fileio.h \
        common/format.h \
        common/gdb_assert.h \
+       common/gdb_tilde_expand.h \
        common/gdb_locale.h \
        common/gdb_setjmp.h \
        common/gdb_signals.h \
        common/gdb_sys_time.h \
-       common/gdb_termios.h \
        common/gdb_vecs.h \
        common/gdb_wait.h \
        common/common-inferior.h \
@@ -1688,11 +1706,9 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        dbxread.o \
        debug.o \
        demangle.o \
-       dfp.o \
        dictionary.o \
        disasm.o \
        disasm-selftests.o \
-       doublest.o \
        dummy-frame.o \
        dwarf2-frame.o \
        dwarf2-frame-tailcall.o \
@@ -1712,6 +1728,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        f-typeprint.o \
        f-valprint.o \
        fileio.o \
+       filename-seen-cache.o \
        filestuff.o \
        filesystem.o \
        findcmd.o \
@@ -1722,6 +1739,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        frame-unwind.o \
        gcore.o \
        gdb_bfd.o \
+       gdb_tilde_expand.o \
        gdb-dlfcn.o \
        gdb_obstack.o \
        gdb_regex.o \
@@ -1780,6 +1798,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        print-utils.o \
        printcmd.o \
        probe.o \
+       producer.o \
        progspace.o \
        progspace-and-thread.o \
        prologue-value.o \
@@ -1823,12 +1842,12 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
        top.o \
        trad-frame.o \
        tramp-frame.o \
+       target-float.o \
        typeprint.o \
        ui-file.o \
        ui-out.o \
        user-regs.o \
        utils.o \
-       utils-selftests.o \
        valarith.o \
        valops.o \
        valprint.o \
@@ -1902,19 +1921,15 @@ all: gdb$(EXEEXT) $(CONFIG_ALL)
        @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do
 
 # Rule for compiling .c files in the top-level gdb directory.
-%.o: %.c
+# The order-only dependencies ensure that we create the build subdirectories.
+%.o: %.c | $(CONFIG_DEP_SUBDIR)
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-# Rules for compiling .c files in the various source subdirectories.
-%.o: ${srcdir}/arch/%.c
-       $(COMPILE) $<
-       $(POSTCOMPILE)
-
-%.o: $(srcdir)/cli/%.c
-       $(COMPILE) $<
-       $(POSTCOMPILE)
+$(CONFIG_DEP_SUBDIR):
+       $(SHELL) $(srcdir)/../mkinstalldirs $@
 
+# Rules for compiling .c files in the various source subdirectories.
 %.o: ${srcdir}/common/%.c
        $(COMPILE) $<
        $(POSTCOMPILE)
@@ -2286,6 +2301,10 @@ clean mostlyclean: $(CONFIG_CLEAN)
        rm -f test-cp-name-parser$(EXEEXT)
        rm -f xml-builtin.c stamp-xml
        rm -f $(DEPDIR)/*
+       for i in $(CONFIG_SRC_SUBDIR); do \
+               rm -f $$i/*.o;  \
+               rm -f $$i/$(DEPDIR)/*; \
+       done
 
 # This used to depend on c-exp.c m2-exp.c TAGS
 # I believe this is wrong; the makefile standards for distclean just
@@ -2304,6 +2323,9 @@ distclean: clean
        rm -f config.log config.cache
        rm -f Makefile
        rm -rf $(DEPDIR)
+       for i in $(CONFIG_SRC_SUBDIR); do \
+               rmdir $$i/$(DEPDIR); \
+       done
 
 maintainer-clean: local-maintainer-clean do-maintainer-clean distclean
 realclean: maintainer-clean
@@ -2487,6 +2509,8 @@ force_update:
 MAKEOVERRIDES =
 
 ALLDEPFILES = \
+       aarch64-fbsd-nat.c \
+       aarch64-fbsd-tdep.c \
        aarch64-linux-nat.c \
        aarch64-linux-tdep.c \
        aarch64-newlib-tdep.c \
@@ -2517,6 +2541,8 @@ ALLDEPFILES = \
        arc-tdep.c \
        arm.c \
        arm-bsd-tdep.c \
+       arm-fbsd-nat.c \
+       arm-fbsd-tdep.c \
        arm-get-next-pcs.c \
        arm-linux.c \
        arm-linux-nat.c \
@@ -2531,7 +2557,6 @@ ALLDEPFILES = \
        bfin-tdep.c \
        bsd-kvm.c \
        bsd-uthread.c \
-       core-regset.c \
        darwin-nat.c \
        dcache.c \
        dcache.c \
@@ -2697,17 +2722,6 @@ ALLDEPFILES = \
 # Some files need explicit build rules (due to -Werror problems) or due
 # to sub-directory fun 'n' games.
 
-# FIXME: cagney/2003-08-10: "monitor.c" gets -Wformat-nonliteral
-# errors.  It turns out that that is the least of monitor.c's
-# problems.  The function print_vsprintf appears to be using
-# va_arg(long) to extract CORE_ADDR parameters - something that
-# definitly will not work.  "monitor.c" needs to be rewritten so that
-# it doesn't use format strings and instead uses callbacks.
-monitor.o: $(srcdir)/monitor.c
-       $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
-               $(COMPILE.post) $(srcdir)/monitor.c
-       $(POSTCOMPILE)
-
 # Do not try to build "printcmd.c" with -Wformat-nonliteral.  It manually
 # checks format strings.
 printcmd.o: $(srcdir)/printcmd.c
@@ -2715,6 +2729,11 @@ printcmd.o: $(srcdir)/printcmd.c
                $(COMPILE.post) $(srcdir)/printcmd.c
        $(POSTCOMPILE)
 
+# Same for "target-float.c".
+target-float.o: $(srcdir)/target-float.c
+       $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
+               $(COMPILE.post) $(srcdir)/target-float.c
+
 # ada-exp.c can appear in srcdir, for releases; or in ., for
 # development builds.
 ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
@@ -2939,12 +2958,13 @@ ifeq ($(DEPMODE),depmode=gcc3)
 # into place if the compile succeeds.  We need this because gcc does
 # not atomically write the dependency output file.
 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-       -MF $(DEPDIR)/$(basename $(@F)).Tpo
-override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
-       $(DEPDIR)/$(basename $(@F)).Po
+       -MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
+override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
+       $(@D)/$(DEPDIR)/$(basename $(@F)).Po
 else
 override COMPILE.pre = source='$<' object='$@' libtool=no \
-       DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
+       DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
+       $(CXX) -x c++ $(CXX_DIALECT)
 # depcomp handles atomicity for us, so we don't need a postcompile
 # step.
 override POSTCOMPILE =
This page took 0.072436 seconds and 4 git commands to generate.