ustinc = @ustinc@
# gnulib
-GNULIB_INCLUDE_DIR = $(srcdir)/../gnulib
-GNULIB_LIB = gnulib/libgnu.a
+LIBGNU = gnulib/import/libgnu.a
+INCGNU = -I$(srcdir)/../gnulib/import -Ignulib/import
+
+# We build gnulib directly under the gdbserver build directory, but
+# its sources don't live directly under gdbserver's source directory.
+# Tweak $srcdir and VPATH to make that work.
+GNULIB_FLAGS_TO_PASS = \
+ "top_srcdir=$(abs_top_srcdir)/.." \
+ "srcdir=$(abs_srcdir)/../gnulib/import" \
+ "VPATH=$(abs_top_srcdir)/../gnulib/import:$(abs_top_srcdir)"
# Generated headers in the gnulib directory. These must be listed
# so that they are generated before other files are compiled.
-GNULIB_H = gnulib/string.h @GNULIB_STDINT_H@
+GNULIB_H = gnulib/import/string.h @GNULIB_STDINT_H@
# All the includes used for CFLAGS and for lint.
# -I. for config files.
# -I$(srcdir)/../regformats for regdef.h.
INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../common \
-I$(srcdir)/../regformats -I$(INCLUDE_DIR) \
- -I$(GNULIB_INCLUDE_DIR)
+ $(INCGNU)
# M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
# from the config/ directory.
$(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \
$(srcdir)/win32-low.c $(srcdir)/wincecompat.c \
$(srcdir)/hostio.c $(srcdir)/hostio-errno.c \
+ $(srcdir)/common/vec.c \
$(srcdir)/common/common-utils.c $(srcdir)/common/xml-utils.c \
$(srcdir)/common/linux-osdata.c $(srcdir)/common/ptid.c \
$(srcdir)/common/buffer.c
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
OBS = agent.o ax.o inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
- utils.o version.o \
+ utils.o version.o vec.o \
mem-break.o hostio.o event-loop.o tracepoint.o \
xml-utils.o common-utils.o ptid.o buffer.o \
dll.o \
FLAGS_TO_PASS = \
"prefix=$(prefix)" \
"exec_prefix=$(exec_prefix)" \
- "top_srcdir=$(abs_top_srcdir)/.." "srcdir=$(abs_srcdir)/../gnulib" \
- "VPATH=$(abs_top_srcdir)/../gnulib:$(abs_top_srcdir)" \
"infodir=$(infodir)" \
"datarootdir=$(datarootdir)" \
"docdir=$(docdir)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)"
+# All generated files which can be included by another file.
+generated_files = config.h $(GNULIB_H)
+
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
.c.o:
${CC} -c ${INTERNAL_CFLAGS} $<
all: gdbserver$(EXEEXT) gdbreplay$(EXEEXT) $(extra_libraries)
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) all
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) all
# Traditionally "install" depends on "all". But it may be useful
# not to; for example, if the user has made some trivial change to a
$(INSTALL_PROGRAM) gdbserver$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT); \
$(SHELL) $(srcdir)/../../mkinstalldirs $(DESTDIR)$(man1dir); \
$(INSTALL_DATA) $(srcdir)/gdbserver.1 $(DESTDIR)$(man1dir)/$$n.1
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) install
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) install
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
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) uninstall
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) uninstall
installcheck:
check:
html:
install-html:
clean-info: force
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) $@
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) $@
-gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(GNULIB_LIB)
+gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU)
rm -f gdbserver$(EXEEXT)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \
- $(GNULIB_LIB) $(GDBSERVER_LIBS) $(XM_CLIBS)
+ $(LIBGNU) $(GDBSERVER_LIBS) $(XM_CLIBS)
-$(GNULIB_LIB) $(GNULIB_H): all-lib
-all-lib: gnulib/Makefile
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) all
+$(LIBGNU) $(GNULIB_H): all-lib
+all-lib: gnulib/import/Makefile
+ @cd gnulib/import/; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) all
.PHONY: all-lib
rm -f i386-avx.c i386-avx-linux.c
rm -f amd64-avx.c amd64-avx-linux.c
rm -f i386-mmx.c i386-mmx-linux.c
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) clean
+ rm -f x32.c x32-linux.c
+ rm -f x32-avx.c x32-avx-linux.c
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) clean
maintainer-clean realclean distclean: clean
- rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
- rm -f Makefile
- @cd gnulib; $(MAKE) $(FLAGS_TO_PASS) $@
+ rm -f nm.h tm.h xm.h config.h stamp-h config.log
+ @cd gnulib/import; $(MAKE) $(FLAGS_TO_PASS) $(GNULIB_FLAGS_TO_PASS) $@
+ rm -f Makefile config.status
config.h: stamp-h ; @true
stamp-h: config.in config.status
Makefile: Makefile.in config.status
CONFIG_HEADERS="" $(SHELL) ./config.status
-gnulib/Makefile: $(srcdir)/../gnulib/Makefile.in config.status
+gnulib/import/Makefile: $(srcdir)/../gnulib/import/Makefile.in config.status
CONFIG_COMMANDS="depfiles" \
CONFIG_HEADERS= \
CONFIG_LINKS= \
- $(SHELL) config.status "gnulib/Makefile"
+ $(SHELL) config.status "gnulib/import/Makefile"
config.status: configure configure.srv
$(SHELL) ./config.status --recheck
ax_h = $(srcdir)/ax.h
agent_h = $(srcdir)/../common/agent.h
linux_osdata_h = $(srcdir)/../common/linux-osdata.h
-server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
+vec_h = $(srcdir)/../common/vec.h
+# Since everything must include server.h, we make that depend on
+# generated files.
+server_h = $(srcdir)/server.h $(regcache_h) $(srcdir)/target.h \
$(srcdir)/mem-break.h $(srcdir)/../common/gdb_signals.h \
$(srcdir)/../common/common-utils.h \
$(srcdir)/../common/xml-utils.h \
$(srcdir)/../common/gdb_assert.h \
$(srcdir)/../common/gdb_locale.h \
$(ptid_h) \
- $(signals_h)
+ $(signals_h) \
+ $(generated_files)
linux_low_h = $(srcdir)/linux-low.h
common-utils.o: ../common/common-utils.c $(server_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+vec.o: ../common/vec.c $(vec_h)
+ $(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
+
xml-utils.o: ../common/xml-utils.c $(server_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $< -DGDBSERVER
amd64-avx-linux.o : amd64-avx-linux.c $(regdef_h)
amd64-avx-linux.c : $(srcdir)/../regformats/i386/amd64-avx-linux.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/amd64-avx-linux.dat amd64-avx-linux.c
+x32.o : x32.c $(regdef_h)
+x32.c : $(srcdir)/../regformats/i386/x32.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/x32.dat x32.c
+x32-linux.o : x32-linux.c $(regdef_h)
+x32-linux.c : $(srcdir)/../regformats/i386/x32-linux.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/x32-linux.dat x32-linux.c
+x32-avx.o : x32-avx.c $(regdef_h)
+x32-avx.c : $(srcdir)/../regformats/i386/x32-avx.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/x32-avx.dat x32-avx.c
+x32-avx-linux.o : x32-avx-linux.c $(regdef_h)
+x32-avx-linux.c : $(srcdir)/../regformats/i386/x32-avx-linux.dat $(regdat_sh)
+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/i386/x32-avx-linux.dat x32-avx-linux.c
reg-xtensa.o : reg-xtensa.c $(regdef_h)
reg-xtensa.c : $(srcdir)/../regformats/reg-xtensa.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-xtensa.dat reg-xtensa.c