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
INCLUDE_DIR = ${srcdir}/../include
INCLUDE_DEP = $$(INCLUDE_DIR)
-LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
+LIBIBERTY_BUILDDIR = ../libiberty
LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
+GDBSUPPORT_BUILDDIR = ../gdbsupport
+GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a
+
# Where is ust? These will be empty if ust was not available.
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..
#
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.
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
PTHREAD_LIBS = @PTHREAD_LIBS@
+WIN32APILIBS = @WIN32APILIBS@
+
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
$(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 \
$(srcdir)/../gdb/arch/arm-get-next-pcs.c \
$(srcdir)/../gdb/arch/arm-linux.c \
$(srcdir)/../gdb/arch/ppc-linux-common.c \
- $(srcdir)/../gdbsupport/btrace-common.cc \
- $(srcdir)/../gdbsupport/buffer.cc \
- $(srcdir)/../gdbsupport/cleanups.cc \
- $(srcdir)/../gdbsupport/common-debug.cc \
- $(srcdir)/../gdbsupport/common-exceptions.cc \
- $(srcdir)/../gdbsupport/common-inferior.cc \
- $(srcdir)/../gdbsupport/common-regcache.cc \
- $(srcdir)/../gdbsupport/common-utils.cc \
- $(srcdir)/../gdbsupport/errors.cc \
- $(srcdir)/../gdbsupport/environ.cc \
- $(srcdir)/../gdbsupport/fileio.cc \
- $(srcdir)/../gdbsupport/filestuff.cc \
- $(srcdir)/../gdbsupport/job-control.cc \
- $(srcdir)/../gdbsupport/gdb-dlfcn.cc \
- $(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
- $(srcdir)/../gdbsupport/gdb_vecs.cc \
- $(srcdir)/../gdbsupport/gdb_wait.cc \
- $(srcdir)/../gdbsupport/netstuff.cc \
- $(srcdir)/../gdbsupport/new-op.cc \
- $(srcdir)/../gdbsupport/pathstuff.cc \
- $(srcdir)/../gdbsupport/print-utils.cc \
- $(srcdir)/../gdbsupport/ptid.cc \
- $(srcdir)/../gdbsupport/rsp-low.cc \
- $(srcdir)/../gdbsupport/safe-strerror.cc \
- $(srcdir)/../gdbsupport/tdesc.cc \
- $(srcdir)/../gdbsupport/xml-utils.cc \
+ $(srcdir)/../gdb/arch/riscv.c \
$(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
$(srcdir)/../gdb/nat/linux-btrace.c \
$(srcdir)/../gdb/nat/linux-namespaces.c \
$(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
OBS = \
alloc.o \
ax.o \
- gdbsupport/agent.o \
- gdbsupport/btrace-common.o \
- gdbsupport/buffer.o \
- gdbsupport/cleanups.o \
- gdbsupport/common-debug.o \
- gdbsupport/common-exceptions.o \
- gdbsupport/common-inferior.o \
- gdbsupport/job-control.o \
- gdbsupport/common-regcache.o \
- gdbsupport/common-utils.o \
- gdbsupport/errors.o \
- gdbsupport/environ.o \
- gdbsupport/fileio.o \
- gdbsupport/filestuff.o \
- gdbsupport/format.o \
- 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 \
- gdbsupport/xml-utils.o \
debug.o \
dll.o \
event-loop.o \
$(XML_BUILTIN)
GDBREPLAY_OBS = \
- gdbsupport/cleanups.o \
- gdbsupport/common-exceptions.o \
- gdbsupport/common-utils.o \
- gdbsupport/rsp-low.o \
- gdbsupport/errors.o \
- gdbsupport/netstuff.o \
- gdbsupport/print-utils.o \
- gdbsupport/safe-strerror.o \
gdbreplay.o \
utils.o \
version.o
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)" \
"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
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)" \
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:
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) $(GDBSUPPORT)
$(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
+ -o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
+ $(LIBIBERTY) $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) \
+ $(WIN32APILIBS)
-gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
+gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
+ $(INTL_DEPS) $(GDBSUPPORT)
$(SILENCE) rm -f gdbreplay$(EXEEXT)
$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
- -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
- $(LIBIBERTY)
+ -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
+ $(GDBSUPPORT) $(LIBGNU) $(LIBIBERTY) $(INTL) \
+ $(WIN32APILIBS)
IPA_OBJS = \
alloc-ipa.o \
if [ x$$i != xyzzy ]; then \
echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
-e 's,/\(arch\|nat\|target\)/,/../\1/,' \
- -e 's,/\(gdbsupport\)/,/../../\1/,'; \
fi; \
done` \
${TAGFILES}
tags: TAGS
-clean:
+mostlyclean clean:
rm -f *.o ${ADD_FILES} *~
rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
rm -f $(IPA_LIB)
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
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
$(COMPILE) -x c++ $<
$(POSTCOMPILE)
-gdbsupport/%.o: ../gdbsupport/%.cc
- $(COMPILE) $<
- $(POSTCOMPILE)
-
%.o: %-generated.cc
$(COMPILE) $<
$(POSTCOMPILE)