]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/gdbserver/Makefile.in
Move gdbsupport to the top level
[thirdparty/binutils-gdb.git] / gdb / gdbserver / Makefile.in
index 34d8060c256899e0b5311639c5ef1bf8d3676fbe..38f30a027708f85e5d927d54ff6e88e4ba0e08b3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1989-2019 Free Software Foundation, Inc.
+# Copyright (C) 1989-2020 Free Software Foundation, Inc.
 
 # This file is part of GDB.
 
@@ -109,6 +109,8 @@ INCGNU = -I$(srcdir)/../../gnulib/import -I$(GNULIB_BUILDDIR)/import
 # so that they are generated before other files are compiled.
 GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 
+INCSUPPORT = -I$(srcdir)/../.. -I../..
+
 # All the includes used for CFLAGS and for lint.
 # -I. for config files.
 # -I${srcdir} for our headers.
@@ -120,7 +122,7 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
        -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
-       $(INCGNU)
+       $(INCGNU) $(INCSUPPORT)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -139,9 +141,12 @@ CFLAGS = @CFLAGS@
 CXXFLAGS = @CXXFLAGS@
 CPPFLAGS = @CPPFLAGS@
 
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
 INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
-       ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
+       ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
 INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
 INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
 
@@ -198,30 +203,32 @@ SFILES = \
        $(srcdir)/arch/arm-linux.c \
        $(srcdir)/arch/ppc-linux-common.c \
        $(srcdir)/../alloc.c \
-       $(srcdir)/gdbsupport/btrace-common.c \
-       $(srcdir)/gdbsupport/buffer.c \
-       $(srcdir)/gdbsupport/cleanups.c \
-       $(srcdir)/gdbsupport/common-debug.c \
-       $(srcdir)/gdbsupport/common-exceptions.c \
-       $(srcdir)/gdbsupport/common-inferior.c \
-       $(srcdir)/gdbsupport/common-regcache.c \
-       $(srcdir)/gdbsupport/common-utils.c \
-       $(srcdir)/gdbsupport/errors.c \
-       $(srcdir)/gdbsupport/environ.c \
-       $(srcdir)/gdbsupport/fileio.c \
-       $(srcdir)/gdbsupport/filestuff.c \
-       $(srcdir)/gdbsupport/job-control.c \
-       $(srcdir)/gdbsupport/gdb-dlfcn.c \
-       $(srcdir)/gdbsupport/gdb_tilde_expand.c \
-       $(srcdir)/gdbsupport/gdb_vecs.c \
-       $(srcdir)/gdbsupport/netstuff.c \
-       $(srcdir)/gdbsupport/new-op.c \
-       $(srcdir)/gdbsupport/pathstuff.c \
-       $(srcdir)/gdbsupport/print-utils.c \
-       $(srcdir)/gdbsupport/ptid.c \
-       $(srcdir)/gdbsupport/rsp-low.c \
-       $(srcdir)/gdbsupport/tdesc.c \
-       $(srcdir)/gdbsupport/xml-utils.c \
+       $(srcdir)/../../gdbsupport/btrace-common.c \
+       $(srcdir)/../../gdbsupport/buffer.c \
+       $(srcdir)/../../gdbsupport/cleanups.c \
+       $(srcdir)/../../gdbsupport/common-debug.c \
+       $(srcdir)/../../gdbsupport/common-exceptions.c \
+       $(srcdir)/../../gdbsupport/common-inferior.c \
+       $(srcdir)/../../gdbsupport/common-regcache.c \
+       $(srcdir)/../../gdbsupport/common-utils.c \
+       $(srcdir)/../../gdbsupport/errors.c \
+       $(srcdir)/../../gdbsupport/environ.c \
+       $(srcdir)/../../gdbsupport/fileio.c \
+       $(srcdir)/../../gdbsupport/filestuff.c \
+       $(srcdir)/../../gdbsupport/job-control.c \
+       $(srcdir)/../../gdbsupport/gdb-dlfcn.c \
+       $(srcdir)/../../gdbsupport/gdb_tilde_expand.c \
+       $(srcdir)/../../gdbsupport/gdb_vecs.c \
+       $(srcdir)/../../gdbsupport/gdb_wait.c \
+       $(srcdir)/../../gdbsupport/netstuff.c \
+       $(srcdir)/../../gdbsupport/new-op.c \
+       $(srcdir)/../../gdbsupport/pathstuff.c \
+       $(srcdir)/../../gdbsupport/print-utils.c \
+       $(srcdir)/../../gdbsupport/ptid.c \
+       $(srcdir)/../../gdbsupport/rsp-low.c \
+       $(srcdir)/../../gdbsupport/safe-strerror.c \
+       $(srcdir)/../../gdbsupport/tdesc.c \
+       $(srcdir)/../../gdbsupport/xml-utils.c \
        $(srcdir)/nat/aarch64-sve-linux-ptrace.c \
        $(srcdir)/nat/linux-btrace.c \
        $(srcdir)/nat/linux-namespaces.c \
@@ -260,12 +267,14 @@ OBS = \
        gdbsupport/gdb-dlfcn.o \
        gdbsupport/gdb_tilde_expand.o \
        gdbsupport/gdb_vecs.o \
+       gdbsupport/gdb_wait.o \
        gdbsupport/netstuff.o \
        gdbsupport/new-op.o \
        gdbsupport/pathstuff.o \
        gdbsupport/print-utils.o \
        gdbsupport/ptid.o \
        gdbsupport/rsp-low.o \
+       gdbsupport/safe-strerror.o \
        gdbsupport/signals.o \
        gdbsupport/signals-state-save-restore.o \
        gdbsupport/tdesc.o \
@@ -299,11 +308,12 @@ GDBREPLAY_OBS = \
        gdbsupport/errors.o \
        gdbsupport/netstuff.o \
        gdbsupport/print-utils.o \
+       gdbsupport/safe-strerror.o \
        gdbreplay.o \
        utils.o \
        version.o
 
-GDBSERVER_LIBS = @GDBSERVER_LIBS@
+GDBSERVER_LIBS = @GDBSERVER_LIBS@ $(PTHREAD_LIBS)
 XM_CLIBS = @LIBS@
 CDEPS = $(srcdir)/proc-service.list
 
@@ -375,10 +385,10 @@ install-only:
        if [ x$$n = x ]; then n=gdbserver; else true; fi; \
        if [ x"$(IPA_DEPFILES)" != x ]; then \
                $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(libdir); \
-               $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
+               $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(IPA_LIB) $(DESTDIR)$(libdir)/$(IPA_LIB); \
        fi; \
        $(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
-       $(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
+       $(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.
@@ -425,6 +435,7 @@ IPA_OBJS = \
        gdbsupport/format-ipa.o \
        gdbsupport/print-utils-ipa.o \
        gdbsupport/rsp-low-ipa.o \
+       gdbsupport/safe-strerror-ipa.o \
        gdbsupport/tdesc-ipa.o \
        regcache-ipa.o \
        remote-utils-ipa.o \
@@ -496,10 +507,10 @@ subdir_do: force
 
 config.h: stamp-h ; @true
 stamp-h: config.in config.status
-       CONFIG_FILES="" CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+       $(SHELL) ./config.status config.h
 
 Makefile: Makefile.in config.status
-       CONFIG_HEADERS="" $(SHELL) ./config.status
+       $(SHELL) ./config.status $@
 
 $(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../../gnulib/Makefile.in config.status
          @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \
@@ -520,8 +531,8 @@ am--refresh:
 
 force:
 
-version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
-       $(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/.. \
+version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../../gdbsupport/create-version.sh
+       $(ECHO_GEN) $(SHELL) $(srcdir)/../../gdbsupport/create-version.sh $(srcdir)/.. \
                $(host_alias) $(target_alias) $@
 
 xml-builtin-generated.c: stamp-xml; @true
@@ -552,7 +563,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 # Undo gnulib replacements for the IPA shared library build.
 # The gnulib headers are still needed, but gnulib is not linked
 # into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror=strerror
+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
@@ -573,17 +584,13 @@ ax.o: ax.c
        $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
        $(POSTCOMPILE)
 
-alloc-ipa.o: ../alloc.c
-       $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
-       $(POSTCOMPILE)
-
 # Rules for objects that go in the in-process agent.
 
 arch/%-ipa.o: ../arch/%.c
        $(IPAGENT_COMPILE) $<
        $(POSTCOMPILE)
 
-gdbsupport/%-ipa.o: ../gdbsupport/%.c
+gdbsupport/%-ipa.o: ../../gdbsupport/%.c
        $(IPAGENT_COMPILE) $<
        $(POSTCOMPILE)
 
@@ -595,6 +602,10 @@ gdbsupport/%-ipa.o: ../gdbsupport/%.c
        $(IPAGENT_COMPILE) $<
        $(POSTCOMPILE)
 
+%-ipa.o: ../%.c
+       $(IPAGENT_COMPILE) $<
+       $(POSTCOMPILE)
+
 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
 # Therefore, this one needs to be before "%.o: %.c" for it to be considered for
 # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
@@ -612,7 +623,7 @@ arch/%.o: ../arch/%.c
        $(COMPILE) $<
        $(POSTCOMPILE)
 
-gdbsupport/%.o: ../gdbsupport/%.c
+gdbsupport/%.o: ../../gdbsupport/%.c
        $(COMPILE) $<
        $(POSTCOMPILE)
 
@@ -639,16 +650,13 @@ gdbsupport/%.o: ../gdbsupport/%.c
 # Rules for register format descriptions.  Suffix destination files with
 # -generated to identify and clean them easily.
 
-%-generated.c: ../regformats/%.dat | $(regdat_sh)
-       $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
-
-%-generated.c: ../regformats/arm/%.dat | $(regdat_sh)
+%-generated.c: ../regformats/%.dat $(regdat_sh)
        $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
-%-generated.c: ../regformats/i386/%.dat | $(regdat_sh)
+%-generated.c: ../regformats/arm/%.dat $(regdat_sh)
        $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
-%-generated.c: ../regformats/rs6000/%.dat $(regdat_sh)
+%-generated.c: ../regformats/rs6000/%.dat $(regdat_sh)
        $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 #