[GDBserver] Replicate src dir in build dir

Similar to f38307f5 (Replicate src dir in build dir), this patch change
configure and Makefile to generate object files in arch/ directory.

gdb/gdbserver:

2017-10-17  Yao Qi  <yao.qi@linaro.org>

	* Makefile.in (CONFIG_SRC_SUBDIR): New variable.
	(clean): Remove .o files in CONFIG_SRC_SUBDIR.
	(distclean): Remove DEPDIR in CONFIG_SRC_SUBDIR.
	(arch-i386.o, arch-amd64.o): Remove rules.
	(arch/%.o): New rule.
	Update POSTCOMPILE and COMPILE.pre.
	* configure.ac: Invoke AC_CONFIG_COMMANDS.
	* configure: Re-generated.
	* configure.srv: Replace arch-i386.o with arch/i386.o.
	Replace arch-amd64.o with arch/amd64.o.
This commit is contained in:
Yao Qi 2017-10-17 12:12:04 +01:00
parent 0301ce1486
commit 60d6cfc99e
5 changed files with 64 additions and 18 deletions

View File

@ -1,3 +1,16 @@
2017-10-17 Yao Qi <yao.qi@linaro.org>
* Makefile.in (CONFIG_SRC_SUBDIR): New variable.
(clean): Remove .o files in CONFIG_SRC_SUBDIR.
(distclean): Remove DEPDIR in CONFIG_SRC_SUBDIR.
(arch-i386.o, arch-amd64.o): Remove rules.
(arch/%.o): New rule.
Update POSTCOMPILE and COMPILE.pre.
* configure.ac: Invoke AC_CONFIG_COMMANDS.
* configure: Re-generated.
* configure.srv: Replace arch-i386.o with arch/i386.o.
Replace arch-amd64.o with arch/amd64.o.
2017-10-16 Yao Qi <yao.qi@linaro.org>
* configure: Regenerated.

View File

@ -43,6 +43,7 @@ man9dir = $(mandir)/man9
infodir = @infodir@
htmldir = $(prefix)/html
includedir = @includedir@
CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@
SHELL = @SHELL@
EXEEXT = @EXEEXT@
@ -434,6 +435,10 @@ clean:
rm -f *-generated.c
rm -f stamp-xml
rm -f $(DEPDIR)/*.Po
for i in $(CONFIG_SRC_SUBDIR); do \
rm -f $$i/*.o; \
rm -f $$i/$(DEPDIR)/*; \
done
@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
maintainer-clean realclean distclean: clean
@ -441,6 +446,9 @@ maintainer-clean realclean distclean: clean
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 \
@ -530,11 +538,7 @@ ax.o: ax.c
$(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
$(POSTCOMPILE)
arch-i386.o: ../arch/i386.c
$(COMPILE) $<
$(POSTCOMPILE)
arch-amd64.o: ../arch/amd64.c
arch/%.o: ../arch/%.c
$(COMPILE) $<
$(POSTCOMPILE)
@ -617,12 +621,13 @@ ifeq ($(DEPMODE),depmode=gcc3)
# into place if the compile succeeds. We need this because gcc does
# not atomically write the dependency output file.
override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-MF $(DEPDIR)/$(basename $(@F)).Tpo
override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
$(DEPDIR)/$(basename $(@F)).Po
-MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
$(@D)/$(DEPDIR)/$(basename $(@F)).Po
else
override COMPILE.pre = source='$<' object='$@' libtool=no \
DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
$(CXX) -x c++ $(CXX_DIALECT)
# depcomp handles atomicity for us, so we don't need a postcompile
# step.
override POSTCOMPILE =

View File

@ -607,6 +607,7 @@ ustinc
ustlibs
ALLOCA
CCDEPMODE
CONFIG_SRC_SUBDIR
DEPDIR
am__leading_dot
host_noncanonical
@ -5854,6 +5855,14 @@ DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depdir"
# Create sub-directories for objects and dependencies.
CONFIG_SRC_SUBDIR="arch"
ac_config_commands="$ac_config_commands gdbdepdir"
depcc="$CC" am_compiler_list=
am_depcomp=$ac_aux_dir/depcomp
@ -9144,6 +9153,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# INIT-COMMANDS
#
ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR
ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"
_ACEOF
@ -9155,6 +9165,7 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
"depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
"gdbdepdir") CONFIG_COMMANDS="$CONFIG_COMMANDS gdbdepdir" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@ -9701,6 +9712,11 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"depdir":C) $SHELL $ac_aux_dir/mkinstalldirs $DEPDIR ;;
"gdbdepdir":C)
for subdir in ${CONFIG_SRC_SUBDIR}
do
$SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
done ;;
"Makefile":F) case x$CONFIG_HEADERS in
xconfig.h:config.in)
echo > stamp-h ;;

View File

@ -66,6 +66,18 @@ ACX_NONCANONICAL_HOST
# Dependency checking.
ZW_CREATE_DEPDIR
# Create sub-directories for objects and dependencies.
CONFIG_SRC_SUBDIR="arch"
AC_SUBST(CONFIG_SRC_SUBDIR)
AC_CONFIG_COMMANDS([gdbdepdir],[
for subdir in ${CONFIG_SRC_SUBDIR}
do
$SHELL $ac_aux_dir/mkinstalldirs $subdir/$DEPDIR
done],
[ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR CONFIG_SRC_SUBDIR="$CONFIG_SRC_SUBDIR"])
ZW_PROG_COMPILER_DEPENDENCIES([CC])
gnulib_extra_configure_args=

View File

@ -113,7 +113,7 @@ case "${target}" in
;;
i[34567]86-*-cygwin*) srv_regobj=""
srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch-i386.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_xmlfiles="$srv_i386_xmlfiles"
;;
i[34567]86-*-linux*) srv_regobj="$srv_i386_linux_regobj"
@ -123,7 +123,7 @@ case "${target}" in
srv_xmlfiles="${srv_xmlfiles} $srv_amd64_linux_xmlfiles"
srv_tgtobj="amd64-linux-siginfo.o"
fi
srv_tgtobj="${srv_tgtobj} arch-i386.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_tgtobj="${srv_tgtobj} $srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o"
srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
@ -137,7 +137,7 @@ case "${target}" in
;;
i[34567]86-*-lynxos*) srv_regobj=""
srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o fork-inferior.o"
srv_tgtobj="${srv_tgtobj} arch-i386.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_xmlfiles="i386/i386.xml"
srv_xmlfiles="${srv_xmlfiles} i386/32bit-core.xml"
srv_xmlfiles="${srv_xmlfiles} i386/32bit-sse.xml"
@ -146,7 +146,7 @@ case "${target}" in
i[34567]86-*-mingw32ce*)
srv_regobj=""
srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch-i386.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_tgtobj="${srv_tgtobj} wincecompat.o"
srv_xmlfiles="$srv_i386_xmlfiles"
# hostio_last_error implementation is in win32-low.c
@ -156,12 +156,12 @@ case "${target}" in
;;
i[34567]86-*-mingw*) srv_regobj=""
srv_tgtobj="x86-low.o x86-dregs.o win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch-i386.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_xmlfiles="$srv_i386_xmlfiles"
srv_mingw=yes
;;
i[34567]86-*-nto*) srv_regobj=""
srv_tgtobj="nto-low.o nto-x86-low.o arch-i386.o"
srv_tgtobj="nto-low.o nto-x86-low.o arch/i386.o"
srv_xmlfiles="$srv_i386_xmlfiles"
srv_qnx="yes"
;;
@ -372,7 +372,7 @@ case "${target}" in
;;
x86_64-*-linux*) srv_regobj="$srv_amd64_linux_regobj $srv_i386_linux_regobj"
srv_tgtobj="$srv_linux_obj linux-x86-low.o x86-low.o x86-dregs.o i387-fp.o"
srv_tgtobj="${srv_tgtobj} arch-i386.o arch-amd64.o"
srv_tgtobj="${srv_tgtobj} arch/i386.o arch/amd64.o"
srv_tgtobj="${srv_tgtobj} linux-x86-tdesc.o"
srv_tgtobj="${srv_tgtobj} linux-btrace.o x86-linux.o"
srv_tgtobj="${srv_tgtobj} x86-linux-dregs.o"
@ -387,13 +387,13 @@ case "${target}" in
;;
x86_64-*-mingw*) srv_regobj=""
srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch-amd64.o"
srv_tgtobj="${srv_tgtobj} arch/amd64.o"
srv_xmlfiles="$srv_i386_xmlfiles $srv_amd64_xmlfiles"
srv_mingw=yes
;;
x86_64-*-cygwin*) srv_regobj=""
srv_tgtobj="x86-low.o x86-dregs.o i387-fp.o win32-low.o win32-i386-low.o"
srv_tgtobj="${srv_tgtobj} arch-amd64.o"
srv_tgtobj="${srv_tgtobj} arch/amd64.o"
srv_xmlfiles="$srv_i386_xmlfiles"
;;