[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 3a11b3e: Use find -delete if available
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 3a11b3e: Use find -delete if available |
Date: |
Thu, 30 Mar 2017 22:51:45 -0400 (EDT) |
branch: master
commit 3a11b3e330e88a42386ac3a635330ebd9c610827
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Use find -delete if available
This shortens the ‘make’ output and should avoid some
repetitive scanning of directories during a build.
* configure.ac (FIND_DELETE): New var.
* lisp/Makefile.in (compile-always, bootstrap-clean):
* test/Makefile.in (clean, bootstrap-clean): Use it.
* test/Makefile.in (ELCFILES, LOGSAVEFILES): Remove; no longer needed.
---
configure.ac | 10 ++++++++++
lisp/Makefile.in | 8 ++++++--
test/Makefile.in | 13 ++++++-------
3 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9937a6c..bd8f765 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1178,6 +1178,16 @@ AC_PATH_PROG(GZIP_PROG, gzip)
test $with_compress_install != yes && test -n "$GZIP_PROG" && \
GZIP_PROG=" # $GZIP_PROG # (disabled by configure
--without-compress-install)"
+AC_CACHE_CHECK([for 'find' args to delete a file],
+ [emacs_cv_find_delete],
+ [if touch conftest.tmp && find conftest.tmp -delete 2>/dev/null &&
+ test ! -f conftest.tmp
+ then emacs_cv_find_delete="-delete"
+ else emacs_cv_find_delete="-exec rm -f {} ';'"
+ fi])
+FIND_DELETE=$emacs_cv_find_delete
+AC_SUBST([FIND_DELETE])
+
PAXCTL_dumped=
PAXCTL_notdumped=
if test $opsys = gnu-linux; then
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index cbe7718..185554c 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -47,6 +47,9 @@ am__v_at_ = $(address@hidden@)
am__v_at_0 = @
am__v_at_1 =
+
+FIND_DELETE = @FIND_DELETE@
+
# You can specify a different executable on the make command line,
# e.g. "make EMACS=../src/emacs ...".
@@ -343,7 +346,7 @@ compile: $(LOADDEFS) autoloads compile-first
# unconditionally. Some files don't actually get compiled because they
# set the local variable no-byte-compile.
compile-always:
- cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc
+ find $(lisp) -name '*.elc' $(FIND_DELETE)
$(MAKE) compile
.PHONY: backup-compiled-files compile-after-backup
@@ -433,7 +436,8 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC)
$(CAL_DIR)/diary-loaddefs.el
.PHONY: bootstrap-clean distclean maintainer-clean
bootstrap-clean:
- -cd $(lisp) && rm -f *.elc */*.elc */*/*.elc */*/*/*.elc $(AUTOGENEL)
+ find $(lisp) -name '*.elc' $(FIND_DELETE)
+ -cd $(lisp) && rm -f $(AUTOGENEL)
distclean:
-rm -f ./Makefile $(lisp)/loaddefs.el~
diff --git a/test/Makefile.in b/test/Makefile.in
index 5849e9c..c0056b6 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -33,6 +33,7 @@ SHELL = @SHELL@
srcdir = @srcdir@
VPATH = $(srcdir)
+FIND_DELETE = @FIND_DELETE@
MKDIR_P = @MKDIR_P@
SEPCHAR = @SEPCHAR@
@@ -125,11 +126,9 @@ endif
ELFILES = $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \
-path "*resources" -prune -o -name "*el" -print)
-## .elc files may be in a different directory for out of source builds
-ELCFILES = $(patsubst %.el,%.elc, \
+## .log files may be in a different directory for out of source builds
+LOGFILES = $(patsubst %.el,%.log, \
$(patsubst $(srcdir)%,.%,$(ELFILES)))
-LOGFILES = $(patsubst %.elc,%.log,${ELCFILES})
-LOGSAVEFILES = $(patsubst %.elc,%.log~,${ELCFILES})
TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=))
## If we have to interrupt a hanging test, preserve the log so we can
@@ -193,11 +192,11 @@ mostlyclean:
rm -f *.tmp
clean:
- -rm -f ${LOGFILES} ${LOGSAVEFILES}
- -rm make-test-deps.mk
+ find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE)
+ rm -f make-test-deps.mk
bootstrap-clean: clean
- -rm -f ${ELCFILES}
+ find $(srcdir) -name '*.elc' $(FIND_DELETE)
distclean: clean
rm -f Makefile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 3a11b3e: Use find -delete if available,
Paul Eggert <=