From 597eef7b947a64ae8067058478f26a15c0e24a07 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 25 Dec 2020 19:16:27 -0800 Subject: [PATCH] Fix issues with lib/malloc out-of-dir builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Mattias EngdegÄrd in: https://lists.gnu.org/r/emacs-devel/2020-12/msg01626.html * configure.ac: If the scratch_buffer module is enabled, create lib/malloc and (if doing dependencies) lib/deps/malloc. * lib/Makefile.in (DEPFLAGS) [AUTO_DEPEND]: No longer any need to squash lib dependencies into a single directory. (clean): Also remove */*.o and $(DEPDIR)/*/*.d, to clean out malloc/*.o and deps/malloc/*.d. Just remove *.d files in dependencies so that rm does not complain about not being able to remove deps/malloc. (extraclean): Also remove malloc, if it is empty. --- configure.ac | 6 ++++++ lib/Makefile.in | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 888b415148..bf768441fe 100644 --- a/configure.ac +++ b/configure.ac @@ -5878,6 +5878,12 @@ m4_define AS_MKDIR_P([$dir/deps]) done fi +if $gl_gnulib_enabled_scratch_buffer; then + AS_MKDIR_P([lib/malloc]) + if test $AUTO_DEPEND = yes; then + AS_MKDIR_P([lib/deps/malloc]) + fi +fi AC_OUTPUT diff --git a/lib/Makefile.in b/lib/Makefile.in index a280b7a331..e6b1ae6a9a 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -67,7 +67,7 @@ SYSTEM_TYPE = DEPDIR = deps ifeq ($(AUTO_DEPEND),yes) - DEPFLAGS = -MMD -MF $(DEPDIR)/$(*F).d -MP + DEPFLAGS = -MMD -MF $(DEPDIR)/$*.d -MP -include $(ALLOBJS:%.o=$(DEPDIR)/%.d) else DEPFLAGS = @@ -118,7 +118,7 @@ TAGS: .PHONY: $(ETAGS) tags clean: - rm -f ./*.[ao] ./*-t \#* $(DEPDIR)/* + rm -f ./*.[ao] ./*/*.o ./*-t \#* $(DEPDIR)/*.d $(DEPDIR)/*/*.d mostlyclean: clean rm -f $(filter-out %-t,$(MOSTLYCLEANFILES)) distclean bootstrap-clean: mostlyclean @@ -127,7 +127,7 @@ distclean bootstrap-clean: maintainer-clean: distclean rm -f TAGS gnulib.mk extraclean: distclean - -rmdir sys 2>/dev/null + -rmdir malloc sys 2>/dev/null .PHONY: mostlyclean clean distclean bootstrap-clean maintainer-clean -- 2.27.0