RANLIB = @RANLIB@
CC = @CC@
+AR = @AR@
+AR_FLAGS = rc
# Dependency tracking information.
DEPMODE = @CCDEPMODE@
INCLUDE_DIR = ${srcdir}/../../include
INCLUDE_DEP = $$(INCLUDE_DIR)
+LIBIBERTY_BUILDDIR = build-libiberty-gdbserver
+LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
+
# Where is ust? These will be empty if ust was not available.
ustlibs = @ustlibs@
ustinc = @ustinc@
$(srcdir)/hostio.c $(srcdir)/hostio-errno.c \
$(srcdir)/common/vec.c $(srcdir)/common/gdb_vecs.c \
$(srcdir)/common/common-utils.c $(srcdir)/common/xml-utils.c \
- $(srcdir)/common/linux-osdata.c $(srcdir)/common/ptid.c \
- $(srcdir)/common/buffer.c $(srcdir)/common/linux-btrace.c \
+ $(srcdir)/nat/linux-osdata.c $(srcdir)/common/ptid.c \
+ $(srcdir)/common/buffer.c $(srcdir)/nat/linux-btrace.c \
$(srcdir)/common/filestuff.c $(srcdir)/target/waitstatus.c \
- $(srcdir)/common/mips-linux-watch.c $(srcdir)/common/print-utils.c \
- $(srcdir)/common/rsp-low.c
+ $(srcdir)/nat/mips-linux-watch.c $(srcdir)/common/print-utils.c \
+ $(srcdir)/common/rsp-low.c $(srcdir)/common/errors.c \
+ $(srcdir)/common/common-debug.c $(srcdir)/common/cleanups.c
DEPFILES = @GDBSERVER_DEPFILES@
target.o waitstatus.o utils.o debug.o version.o vec.o gdb_vecs.o \
mem-break.o hostio.o event-loop.o tracepoint.o xml-utils.o \
common-utils.o ptid.o buffer.o format.o filestuff.o dll.o notif.o \
- tdesc.o print-utils.o rsp-low.o $(XML_BUILTIN) $(DEPFILES) $(LIBOBJS)
+ tdesc.o print-utils.o rsp-low.o errors.o common-debug.o cleanups.o \
+ $(XML_BUILTIN) $(DEPFILES) $(LIBOBJS)
GDBREPLAY_OBS = gdbreplay.o version.o
GDBSERVER_LIBS = @GDBSERVER_LIBS@
XM_CLIBS = @LIBS@
IPA_DEPFILES = @IPA_DEPFILES@
extra_libraries = @extra_libraries@
-SUBDIRS = $(GNULIB_BUILDDIR)
+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)
+REQUIRED_SUBDIRS = $(GNULIB_BUILDDIR) | $(LIBIBERTY_BUILDDIR)
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
fi; \
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(bindir); \
$(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT)
- @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
+ # 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
uninstall: force
n=`echo gdbserver | sed '$(program_transform_name)'`; \
clean-info: force
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
-gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU)
+gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY)
rm -f gdbserver$(EXEEXT)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
- $(LIBGNU) $(GDBSERVER_LIBS) $(XM_CLIBS)
+ $(LIBGNU) $(LIBIBERTY) $(GDBSERVER_LIBS) $(XM_CLIBS)
-$(LIBGNU) $(GNULIB_H): all-lib
-all-lib: $(GNULIB_BUILDDIR)/Makefile
- @$(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do
+$(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
-gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU)
+gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY)
rm -f gdbreplay$(EXEEXT)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
- $(XM_CLIBS) $(LIBGNU)
+ $(XM_CLIBS) $(LIBGNU) $(LIBIBERTY)
-IPA_OBJS=ax-ipa.o tracepoint-ipa.o format-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o tdesc-ipa.o print-utils-ipa.o rsp-low-ipa.o ${IPA_DEPFILES}
+IPA_OBJS=ax-ipa.o tracepoint-ipa.o format-ipa.o utils-ipa.o \
+ regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o \
+ tdesc-ipa.o print-utils-ipa.o rsp-low-ipa.o errors-ipa.o \
+ ${IPA_DEPFILES}
IPA_LIB=libinproctrace.so
rsp-low-ipa.o: ../common/rsp-low.c
$(IPAGENT_COMPILE) $<
$(POSTCOMPILE)
+errors-ipa.o: ../common/errors.c
+ $(IPAGENT_COMPILE) $<
+ $(POSTCOMPILE)
ax.o: ax.c
$(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
rsp-low.o: ../common/rsp-low.c
$(COMPILE) $<
$(POSTCOMPILE)
-linux-procfs.o: ../common/linux-procfs.c
- $(COMPILE) $<
- $(POSTCOMPILE)
-linux-ptrace.o: ../common/linux-ptrace.c
- $(COMPILE) $<
- $(POSTCOMPILE)
common-utils.o: ../common/common-utils.c
$(COMPILE) $<
$(POSTCOMPILE)
xml-utils.o: ../common/xml-utils.c
$(COMPILE) $<
$(POSTCOMPILE)
-linux-osdata.o: ../common/linux-osdata.c
- $(COMPILE) $<
- $(POSTCOMPILE)
ptid.o: ../common/ptid.c
$(COMPILE) $<
$(POSTCOMPILE)
agent.o: ../common/agent.c
$(COMPILE) $<
$(POSTCOMPILE)
-waitstatus.o: ../target/waitstatus.c
+errors.o: ../common/errors.c
$(COMPILE) $<
$(POSTCOMPILE)
-
-linux-btrace.o: ../common/linux-btrace.c
+common-debug.o: ../common/common-debug.c
$(COMPILE) $<
$(POSTCOMPILE)
-
-mips-linux-watch.o: ../common/mips-linux-watch.c
+cleanups.o: ../common/cleanups.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
+waitstatus.o: ../target/waitstatus.c
$(COMPILE) $<
$(POSTCOMPILE)
# Native object files rules from ../nat
-linux-waitpid.o: ../nat/linux-waitpid.c
+i386-dregs.o: ../nat/i386-dregs.c
$(COMPILE) $<
$(POSTCOMPILE)
-
-# We build vasprintf with -DHAVE_CONFIG_H because we want that unit to
-# include our config.h file. Otherwise, some system headers do not get
-# included, and the compiler emits a warning about implicitly defined
-# functions (missing declaration).
-vasprintf.o: $(srcdir)/../../libiberty/vasprintf.c
- $(COMPILE) $< -DHAVE_CONFIG_H
+linux-btrace.o: ../nat/linux-btrace.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
+linux-osdata.o: ../nat/linux-osdata.c
+ $(COMPILE) $<
$(POSTCOMPILE)
-vsnprintf.o: $(srcdir)/../../libiberty/vsnprintf.c
+linux-procfs.o: ../nat/linux-procfs.c
$(COMPILE) $<
$(POSTCOMPILE)
-safe-ctype.o: $(srcdir)/../../libiberty/safe-ctype.c
+linux-ptrace.o: ../nat/linux-ptrace.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
+linux-waitpid.o: ../nat/linux-waitpid.c
$(COMPILE) $<
$(POSTCOMPILE)
-lbasename.o: $(srcdir)/../../libiberty/lbasename.c
+mips-linux-watch.o: ../nat/mips-linux-watch.c
$(COMPILE) $<
$(POSTCOMPILE)