Fix gdbserver build when intl already built
[deliverable/binutils-gdb.git] / gdbserver / Makefile.in
index 5d0d608e058abc5a24d5f5d88ae5e2485a026a26..d6b79385e15732c962e09fdebab28b1e0782961e 100644 (file)
@@ -75,6 +75,8 @@ abs_top_srcdir = @abs_top_srcdir@
 abs_srcdir = @abs_srcdir@
 VPATH = @srcdir@
 
+top_builddir = .
+
 include $(srcdir)/../gdb/silent-rules.mk
 
 # Note that these are overridden by GNU make-specific code below if
@@ -97,7 +99,7 @@ CC_LD = $(CXX) $(CXX_DIALECT)
 INCLUDE_DIR = ${srcdir}/../include
 INCLUDE_DEP = $$(INCLUDE_DIR)
 
-LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
+LIBIBERTY_BUILDDIR = ../libiberty
 LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
 
 # Where is ust?  These will be empty if ust was not available.
@@ -105,13 +107,14 @@ ustlibs = @ustlibs@
 ustinc = @ustinc@
 
 # gnulib
-GNULIB_BUILDDIR = build-gnulib-gdbserver
+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@
+# Where is the INTL library?  Typically in ../intl.
+INTL = @LIBINTL@
+INTL_DEPS = @LIBINTL_DEP@
+INTL_CFLAGS = @INCINTL@
 
 INCSUPPORT = -I$(srcdir)/.. -I..
 
@@ -126,7 +129,8 @@ INCSUPPORT = -I$(srcdir)/.. -I..
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
        -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
-       -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT)
+       -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \
+       $(INTL_CFLAGS)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -181,6 +185,7 @@ SFILES = \
        $(srcdir)/linux-mips-low.cc \
        $(srcdir)/linux-nios2-low.cc \
        $(srcdir)/linux-ppc-low.cc \
+       $(srcdir)/linux-riscv-low.cc \
        $(srcdir)/linux-s390-low.cc \
        $(srcdir)/linux-sh-low.cc \
        $(srcdir)/linux-sparc-low.cc \
@@ -207,6 +212,7 @@ SFILES = \
        $(srcdir)/../gdb/arch/arm-get-next-pcs.c \
        $(srcdir)/../gdb/arch/arm-linux.c \
        $(srcdir)/../gdb/arch/ppc-linux-common.c \
+       $(srcdir)/../gdb/arch/riscv.c \
        $(srcdir)/../gdbsupport/btrace-common.cc \
        $(srcdir)/../gdbsupport/buffer.cc \
        $(srcdir)/../gdbsupport/cleanups.cc \
@@ -240,6 +246,7 @@ SFILES = \
        $(srcdir)/../gdb/nat/linux-personality.c \
        $(srcdir)/../gdb/nat/mips-linux-watch.c \
        $(srcdir)/../gdb/nat/ppc-linux.c \
+       $(srcdir)/../gdb/nat/riscv-linux-tdesc.c \
        $(srcdir)/../gdb/nat/fork-inferior.c \
        $(srcdir)/../gdb/target/waitstatus.c
 
@@ -329,15 +336,6 @@ XML_BUILTIN = @srv_xmlbuiltin@
 IPA_DEPFILES = @IPA_DEPFILES@
 extra_libraries = @extra_libraries@
 
-SUBDIRS = $(GNULIB_BUILDDIR) $(LIBIBERTY_BUILDDIR)
-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 = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
-
 FLAGS_TO_PASS = \
        "prefix=$(prefix)" \
        "exec_prefix=$(exec_prefix)" \
@@ -371,10 +369,9 @@ FLAGS_TO_PASS = \
        "RUNTESTFLAGS=$(RUNTESTFLAGS)"
 
 # All generated files which can be included by another file.
-generated_files = config.h $(GNULIB_H)
+generated_files = config.h
 
 all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
-       @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
 # Traditionally "install" depends on "all".  But it may be useful
 # not to; for example, if the user has made some trivial change to a
@@ -393,10 +390,6 @@ install-only:
        fi; \
        $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
        $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
-       # Note that we run install and not install-only, as the latter
-       # is not part of GNU standards and in particular not provided
-       # in libiberty.
-       @$(MAKE) $(FLAGS_TO_PASS) DO=install "DODIRS=$(SUBDIRS)" subdir_do
 
 install-strip:
        $(MAKE) $(FLAGS_TO_PASS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
@@ -408,7 +401,6 @@ uninstall: force
        n=`echo gdbserver | sed '$(program_transform_name)'`; \
        if [ x$$n = x ]; then n=gdbserver; else true; fi; \
        rm -f $(DESTDIR)/$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(man1dir)/$$n.1
-       @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
 installcheck:
 check:
@@ -417,25 +409,21 @@ install-info:
 install-pdf:
 html:
 install-html:
-clean-info: force
-       @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
+clean-info:
 
-gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
+gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
+               $(INTL_DEPS)
        $(SILENCE) rm -f gdbserver$(EXEEXT)
        $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
                -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
-               $(GDBSERVER_LIBS) $(XM_CLIBS)
-
-$(LIBGNU) $(LIBIBERTY) $(GNULIB_H): all-lib
-all-lib: $(GNULIB_BUILDDIR)/Makefile $(LIBIBERTY_BUILDDIR)/Makefile
-       @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS="$(SUBDIRS)" subdir_do
-.PHONY: all-lib
+               $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS)
 
-gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
+gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
+               $(INTL_DEPS)
        $(SILENCE) rm -f gdbreplay$(EXEEXT)
        $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
                -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
-               $(LIBIBERTY)
+               $(LIBIBERTY) $(INTL)
 
 IPA_OBJS = \
        alloc-ipa.o \
@@ -477,7 +465,7 @@ TAGS:       ${TAGFILES}
          ${TAGFILES}
 tags: TAGS
 
-clean:
+mostlyclean clean:
        rm -f *.o ${ADD_FILES} *~
        rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
        rm -f $(IPA_LIB)
@@ -488,33 +476,14 @@ clean:
                rm -f $$i/*.o;  \
                rm -f $$i/$(DEPDIR)/*; \
        done
-       @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
 maintainer-clean realclean distclean: clean
-       @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
-       rm -rf $(GNULIB_BUILDDIR)
        rm -f Makefile config.status config.h stamp-h config.log
        rm -f Makefile
        for i in $(CONFIG_SRC_SUBDIR); do \
                rmdir $$i/$(DEPDIR); \
        done
 
-subdir_do: force
-       @for i in $(DODIRS); do \
-               case $$i in \
-               $(REQUIRED_SUBDIRS)) \
-                       if [ ! -f ./$$i/Makefile ] ; then \
-                               echo "Missing $$i/Makefile" >&2 ; \
-                               exit 1 ; \
-                       fi ;; \
-               esac ; \
-               if [ -f ./$$i/Makefile ] ; then \
-                       if (cd ./$$i; \
-                               $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
-                       else exit 1 ; fi ; \
-               else true ; fi ; \
-       done
-
 config.h: stamp-h ; @true
 stamp-h: config.in config.status
        $(SHELL) ./config.status config.h
@@ -522,13 +491,6 @@ stamp-h: config.in config.status
 Makefile: Makefile.in config.status
        $(SHELL) ./config.status $@
 
-$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../gnulib/Makefile.in config.status
-         @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
-         CONFIG_COMMANDS="depfiles" \
-         CONFIG_HEADERS= \
-         CONFIG_LINKS= \
-         $(SHELL) config.status
-
 config.status: configure configure.srv $(srcdir)/../bfd/development.sh
        $(SHELL) ./config.status --recheck
 
This page took 0.027213 seconds and 4 git commands to generate.