X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgdbserver%2FMakefile.in;h=34d8060c256899e0b5311639c5ef1bf8d3676fbe;hb=00975ff6eb19ea5c14acf354fe3677a68a9e7fa2;hp=d9f55de51c9af00f456e250b1d3207a44cee7efb;hpb=156525114c1cbbace0dec223494b842ffc60d52e;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index d9f55de51c..34d8060c25 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 1989-2017 Free Software Foundation, Inc. +# Copyright (C) 1989-2019 Free Software Foundation, Inc. # This file is part of GDB. @@ -43,6 +43,7 @@ man9dir = $(mandir)/man9 infodir = @infodir@ htmldir = $(prefix)/html includedir = @includedir@ +CONFIG_SRC_SUBDIR = @CONFIG_SRC_SUBDIR@ SHELL = @SHELL@ EXEEXT = @EXEEXT@ @@ -61,14 +62,7 @@ AR_FLAGS = rc # Dependency tracking information. DEPMODE = @CCDEPMODE@ DEPDIR = @DEPDIR@ -depcomp = $(SHELL) $(srcdir)/../depcomp - -# Note that these are overridden by GNU make-specific code below if -# GNU make is used. The overrides implement dependency tracking. -COMPILE.pre = $(CXX) $(CXX_DIALECT) -COMPILE.post = -c -o $@ -COMPILE = $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post) -POSTCOMPILE = @true +depcomp = $(SHELL) $(srcdir)/../../depcomp # Directory containing source files. Don't clean up the spacing, # this exact string is matched for by the "configure" script. @@ -77,6 +71,15 @@ abs_top_srcdir = @abs_top_srcdir@ abs_srcdir = @abs_srcdir@ VPATH = @srcdir@ +include $(srcdir)/../silent-rules.mk + +# Note that these are overridden by GNU make-specific code below if +# GNU make is used. The overrides implement dependency tracking. +COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT) +COMPILE.post = -c -o $@ +COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post) +POSTCOMPILE = @true + # It is also possible that you will need to add -I/usr/include/sys to the # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which # is where it should be according to Posix). @@ -100,7 +103,7 @@ ustinc = @ustinc@ # gnulib GNULIB_BUILDDIR = build-gnulib-gdbserver LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a -INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import +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. @@ -115,7 +118,7 @@ GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@ # in those directories should be included with the subdirectory. # e.g.: "target/wait.h". # -INCLUDE_CFLAGS = -I. -I${srcdir} -I$(srcdir)/../common \ +INCLUDE_CFLAGS = -I. -I${srcdir} \ -I$(srcdir)/../regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \ $(INCGNU) @@ -193,31 +196,40 @@ SFILES = \ $(srcdir)/arch/arm.c \ $(srcdir)/arch/arm-get-next-pcs.c \ $(srcdir)/arch/arm-linux.c \ - $(srcdir)/common/btrace-common.c \ - $(srcdir)/common/buffer.c \ - $(srcdir)/common/cleanups.c \ - $(srcdir)/common/common-debug.c \ - $(srcdir)/common/common-exceptions.c \ - $(srcdir)/common/common-regcache.c \ - $(srcdir)/common/common-utils.c \ - $(srcdir)/common/errors.c \ - $(srcdir)/common/environ.c \ - $(srcdir)/common/fileio.c \ - $(srcdir)/common/filestuff.c \ - $(srcdir)/common/job-control.c \ - $(srcdir)/common/gdb_vecs.c \ - $(srcdir)/common/new-op.c \ - $(srcdir)/common/print-utils.c \ - $(srcdir)/common/ptid.c \ - $(srcdir)/common/rsp-low.c \ - $(srcdir)/common/vec.c \ - $(srcdir)/common/xml-utils.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)/nat/aarch64-sve-linux-ptrace.c \ $(srcdir)/nat/linux-btrace.c \ $(srcdir)/nat/linux-namespaces.c \ $(srcdir)/nat/linux-osdata.c \ $(srcdir)/nat/linux-personality.c \ $(srcdir)/nat/mips-linux-watch.c \ $(srcdir)/nat/ppc-linux.c \ + $(srcdir)/nat/fork-inferior.c \ $(srcdir)/target/waitstatus.c DEPFILES = @GDBSERVER_DEPFILES@ @@ -228,52 +240,69 @@ SOURCES = $(SFILES) TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} OBS = \ - agent.o \ + alloc.o \ ax.o \ - btrace-common.o \ - buffer.o \ - cleanups.o \ - common-debug.o \ - common-exceptions.o \ - job-control.o \ - common-regcache.o \ - common-utils.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/netstuff.o \ + gdbsupport/new-op.o \ + gdbsupport/pathstuff.o \ + gdbsupport/print-utils.o \ + gdbsupport/ptid.o \ + gdbsupport/rsp-low.o \ + gdbsupport/signals.o \ + gdbsupport/signals-state-save-restore.o \ + gdbsupport/tdesc.o \ + gdbsupport/xml-utils.o \ debug.o \ dll.o \ - errors.o \ - environ.o \ event-loop.o \ - fileio.o \ - filestuff.o \ - format.o \ - gdb_vecs.o \ hostio.o \ inferiors.o \ mem-break.o \ - new-op.o \ notif.o \ - print-utils.o \ - ptid.o \ regcache.o \ remote-utils.o \ - rsp-low.o \ server.o \ - signals.o \ - signals-state-save-restore.o \ symbol.o \ target.o \ tdesc.o \ tracepoint.o \ utils.o \ - vec.o \ version.o \ waitstatus.o \ - xml-utils.o \ $(DEPFILES) \ $(LIBOBJS) \ $(XML_BUILTIN) -GDBREPLAY_OBS = gdbreplay.o version.o +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 \ + gdbreplay.o \ + utils.o \ + version.o + GDBSERVER_LIBS = @GDBSERVER_LIBS@ XM_CLIBS = @LIBS@ CDEPS = $(srcdir)/proc-service.list @@ -371,32 +400,46 @@ install-html: clean-info: force @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do -gdbserver$(EXEEXT): $(OBS) ${ADD_DEPS} ${CDEPS} $(LIBGNU) $(LIBIBERTY) - rm -f gdbserver$(EXEEXT) - $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbserver$(EXEEXT) $(OBS) \ - $(LIBGNU) $(LIBIBERTY) $(GDBSERVER_LIBS) $(XM_CLIBS) +gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) + $(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 -gdbreplay$(EXEEXT): $(GDBREPLAY_OBS) $(LIBGNU) $(LIBIBERTY) - rm -f gdbreplay$(EXEEXT) - $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \ - $(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 errors-ipa.o \ +gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) + $(SILENCE) rm -f gdbreplay$(EXEEXT) + $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ + -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \ + $(LIBIBERTY) + +IPA_OBJS = \ + alloc-ipa.o \ + ax-ipa.o \ + gdbsupport/common-utils-ipa.o \ + gdbsupport/errors-ipa.o \ + gdbsupport/format-ipa.o \ + gdbsupport/print-utils-ipa.o \ + gdbsupport/rsp-low-ipa.o \ + gdbsupport/tdesc-ipa.o \ + regcache-ipa.o \ + remote-utils-ipa.o \ + tdesc-ipa.o \ + tracepoint-ipa.o \ + utils-ipa.o \ ${IPA_DEPFILES} IPA_LIB = libinproctrace.so -$(IPA_LIB): $(IPA_OBJS) ${ADD_DEPS} ${CDEPS} - rm -f $(IPA_LIB) - $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) -Wl,--no-undefined $(INTERNAL_CFLAGS) \ - $(INTERNAL_LDFLAGS) -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread +$(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS} + $(SILENCE) rm -f $(IPA_LIB) + $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \ + -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \ + -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread # Put the proper machine-specific files first, so M-. on a machine # specific routine gets the one for the correct machine. @@ -420,6 +463,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 @@ -427,6 +474,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 \ @@ -451,7 +501,7 @@ stamp-h: config.in config.status Makefile: Makefile.in config.status CONFIG_HEADERS="" $(SHELL) ./config.status -$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../gnulib/Makefile.in config.status +$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../../gnulib/Makefile.in config.status @cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \ CONFIG_COMMANDS="depfiles" \ CONFIG_HEADERS= \ @@ -470,16 +520,17 @@ am--refresh: force: -version-generated.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh - $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \ - $(host_alias) $(target_alias) $@ +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 stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES) - rm -f xml-builtin.tmp - $(SHELL) $(XML_DIR)/feature_to_c.sh xml-builtin.tmp $(XML_FILES) - $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c - echo stamp > stamp-xml + $(SILENCE) rm -f xml-builtin.tmp + $(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \ + xml-builtin.tmp $(XML_FILES) + $(SILENCE) $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin-generated.c + $(SILENCE) echo stamp > stamp-xml .PRECIOUS: xml-builtin.c @@ -498,13 +549,19 @@ regdat_sh = $(srcdir)/../regformats/regdat.sh 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 + # Note, we only build the IPA if -fvisibility=hidden is supported in # the first place. IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \ + $(UNDO_GNULIB_CFLAGS) \ -fPIC -DIN_PROCESS_AGENT \ -fvisibility=hidden -IPAGENT_COMPILE = $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post) +IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post) # Rules for special cases. @@ -516,8 +573,20 @@ 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 + $(IPAGENT_COMPILE) $< + $(POSTCOMPILE) + %-ipa.o: %-generated.c $(IPAGENT_COMPILE) $< $(POSTCOMPILE) @@ -537,25 +606,21 @@ ax.o: ax.c $(IPAGENT_COMPILE) $< $(POSTCOMPILE) -%-ipa.o: ../common/%.c - $(IPAGENT_COMPILE) $< - $(POSTCOMPILE) - # Rules for objects that go in the gdbserver binary. -%.o: %-generated.c +arch/%.o: ../arch/%.c $(COMPILE) $< $(POSTCOMPILE) -%.o: %.c +gdbsupport/%.o: ../gdbsupport/%.c $(COMPILE) $< $(POSTCOMPILE) -%.o: ../arch/%.c +%.o: %-generated.c $(COMPILE) $< $(POSTCOMPILE) -%.o: ../common/%.c +%.o: %.c $(COMPILE) $< $(POSTCOMPILE) @@ -567,20 +632,24 @@ ax.o: ax.c $(COMPILE) $< $(POSTCOMPILE) +%.o: ../%.c + $(COMPILE) $< + $(POSTCOMPILE) + # Rules for register format descriptions. Suffix destination files with # -generated to identify and clean them easily. %-generated.c: ../regformats/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/arm/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/i386/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ %-generated.c: ../regformats/rs6000/%.dat | $(regdat_sh) - $(SHELL) $(regdat_sh) $< $@ + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ # # Dependency tracking. @@ -591,12 +660,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 = @@ -615,10 +685,17 @@ else $(all_object_files) : $(generated_files) endif +# All the .deps files to include. +all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\ + $(dir $(dep))/$(DEPDIR)/$(notdir $(dep))) + # Dependencies. --include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files)) +-include $(all_deps_files) # Disable implicit make rules. include $(srcdir)/../disable-implicit-rules.mk +# Do not delete intermediate files (e.g. *-generated.c). +.SECONDARY: + # This is the end of "Makefile.in".