]> code.delx.au - gnu-emacs/commitdiff
Small Makefile cleanup mainly related to tags file generation
authorGlenn Morris <rgm@gnu.org>
Sat, 2 Nov 2013 19:18:50 +0000 (12:18 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 2 Nov 2013 19:18:50 +0000 (12:18 -0700)
* src/Makefile.in (abs_srcdir): New, set by configure.
(maintainer-clean): Remove pointless echo.  That should be in the
top-level Makefile, if anywhere.  Delete TAGS-LISP.
(extraclean): No s/ and m/ directories for some time.
(TAGS): Remove no-longer-defined S_FILE.
Pass absolute filenames to etags once more.
(TAGS-LISP, $(lwlibdir)/TAGS): Correctly pass ETAGS to sub-makes.
($(lwlibdir)/TAGS): Remove useless subshell, check cd return value.

* lisp/Makefile.in (lisptagsfiles1, lisptagsfiles2, lisptagsfiles3)
(lisptagsfiles4): Use absolute filenames again.
(TAGS, TAGS-LISP): Not everything needs to run in one line.
Remove all *loaddefs files, not just the first.  Remove esh-groups.
(maintainer-clean): Delete TAGS, TAGS-LISP.

* lwlib/Makefile.in (abs_srcdir): New, set by configure.
(ETAGS, ctagsfiles): New variables.
(TAGS): Use ETAGS, ctagsfiles.  Use absolute filenames again.

lisp/ChangeLog
lisp/Makefile.in
lwlib/ChangeLog
lwlib/Makefile.in
src/ChangeLog
src/Makefile.in

index fba59e1c8b81af977b1d5d60293b0bd1672a21a8..8bdf2d3a83e4ba4dcd613b49bd4132737b5616b9 100644 (file)
@@ -1,3 +1,11 @@
+2013-11-02  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (lisptagsfiles1, lisptagsfiles2, lisptagsfiles3)
+       (lisptagsfiles4): Use absolute filenames again.
+       (TAGS, TAGS-LISP): Not everything needs to run in one line.
+       Remove all *loaddefs files, not just the first.  Remove esh-groups.
+       (maintainer-clean): Delete TAGS, TAGS-LISP.
+
 2013-11-02  Bozhidar Batsov  <bozhidar@batsov.com>
 
        * emacs-lisp/package.el (package-version-join): Recognize
index 537603a3018209516b19e8ef7f9c21b449df618e..be7a413b15b9c2c6f084ac6e9e0700261c7ad5e1 100644 (file)
@@ -49,12 +49,6 @@ BYTE_COMPILE_EXTRA_FLAGS =
 # BYTE_COMPILE_EXTRA_FLAGS = --eval '(setq byte-compile-warnings (quote (not unresolved)))'
 # The example above is just for developers, it should not be used by default.
 
-lisptagsfiles1 = $(lisp)/*.el
-lisptagsfiles2 = $(lisp)/*/*.el
-lisptagsfiles3 = $(lisp)/*/*/*.el
-lisptagsfiles4 = $(lisp)/*/*/*/*.el
-ETAGS = ../lib-src/etags
-
 # Automatically generated autoload files, apart from lisp/loaddefs.el.
 # Note this includes only those files that need special rules to
 # build; ie it does not need to include things created via
@@ -217,10 +211,30 @@ bzr-update: compile finder-data custom-deps
 update-authors:
        $(emacs) -l authors -f batch-update-authors $(top_srcdir)/etc/AUTHORS $(top_srcdir)
 
+
+ETAGS = ../lib-src/etags
+
+## NB We use absolute filenames because ../src/Makefile calls this via
+## make -f ../lisp/Makefile.
+## FIXME?  Can etags work ok with relative filenames?
+lisptagsfiles1 = $(abs_srcdir)/*.el
+lisptagsfiles2 = $(abs_srcdir)/*/*.el
+lisptagsfiles3 = $(abs_srcdir)/*/*/*.el
+lisptagsfiles4 = $(abs_srcdir)/*/*/*/*.el
+
+## Apparently the echo | sed | xargs is to stop the command line
+## getting too long on MS Windows.  It will make no difference on
+## POSIX systems, where the shell does the globbing right away, before
+## passing the expanded arguments to echo.
 TAGS TAGS-LISP: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
-       rm -f $@; touch $@; \
-        echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | sed -e "s,$(lisp)/[^ ]*loaddefs[^ ]*,," -e "s,$(lisp)/ldefs-boot[^ ]*,," | \
-       xargs $(XARGS_LIMIT) ${ETAGS} -a -o $@
+       rm -f $@
+       touch $@
+       echo $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4) | \
+         sed -e 's,$(abs_srcdir)/[^ ]*loaddefs[^ ]*,,g' \
+           -e 's,$(abs_srcdir)/ldefs-boot[^ ]*,,' \
+           -e 's,$(abs_srcdir)/[^ ]*esh-groups.el[^ ]*,,' | \
+           xargs $(XARGS_LIMIT) "$(ETAGS)" -a -o $@
+
 
 # The src/Makefile.in has its own set of dependencies and when they decide
 # that one Lisp file needs to be re-compiled, we had better recompile it as
@@ -444,6 +458,7 @@ distclean:
        -rm -f ./Makefile $(lisp)/loaddefs.el~
 
 maintainer-clean: distclean bootstrap-clean
+       rm -f TAGS TAGS-LISP
 
 .PHONY: check-declare
 
index 963b5baed1c8bfc8ae5e8d132b10b3d79bbcdcae..6d10fe551cb119ea24a1404bf9ca2d6025187be1 100644 (file)
@@ -1,3 +1,9 @@
+2013-11-02  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (abs_srcdir): New, set by configure.
+       (ETAGS, ctagsfiles): New variables.
+       (TAGS): Use ETAGS, ctagsfiles.  Use absolute filenames again.
+
 2013-10-24  Glenn Morris  <rgm@gnu.org>
 
        * Makefile.in (abs_top_srcdir): New, set by configure.
index b7f1673aca9f583514c15b5ec2d3879e30fb68c8..550983c17578ffa13b7b793fd2d7edf3f50190d9 100644 (file)
@@ -23,6 +23,7 @@
 # and set up to be configured by ../configure.
 
 srcdir=@srcdir@
+abs_srcdir=@abs_srcdir@
 # MinGW CPPFLAGS may use this.
 abs_top_srcdir=@abs_top_srcdir@
 VPATH=@srcdir@
@@ -100,7 +101,17 @@ distclean: clean
 maintainer-clean: distclean
        rm -f TAGS
 
-TAGS:
-       ../lib-src/etags $(srcdir)/*.[ch]
+
+ETAGS = ../lib-src/etags
+
+## FIXME?  Does etags need to use absolute filenames?
+## See comments in lisp/Makefile.in, src/Makefile.in.
+ctagsfiles= *.[ch]
+
+TAGS: $(srcdir)/$(ctagsfiles)
+       "$(ETAGS)" "$(abs_srcdir)"/$(ctagsfiles)
 tags: TAGS
 .PHONY: tags
+
+
+### Makefile.in ends here
index 1cea67b86899be8c4f0cb1758a65cd3d7ee58dcc..99d19cd68c73ecd5ce5505f3a852596dad1f15b6 100644 (file)
@@ -1,3 +1,14 @@
+2013-11-02  Glenn Morris  <rgm@gnu.org>
+
+       * Makefile.in (abs_srcdir): New, set by configure.
+       (maintainer-clean): Remove pointless echo.  That should be in the
+       top-level Makefile, if anywhere.  Delete TAGS-LISP.
+       (extraclean): No s/ and m/ directories for some time.
+       (TAGS): Remove no-longer-defined S_FILE.
+       Pass absolute filenames to etags once more.
+       (TAGS-LISP, $(lwlibdir)/TAGS): Correctly pass ETAGS to sub-makes.
+       ($(lwlibdir)/TAGS): Remove useless subshell, check cd return value.
+
 2013-11-02  Jan Djärv  <jan.h.d@swipnet.se>
 
        * xfaces.c (check_lface_attrs, realize_default_face): Add
index 21d92463f20a849b58f09e952b04f9e988d9a3d0..c61ff2ddd46d1eccce7c33e8d2c899038ed360a8 100644 (file)
@@ -28,6 +28,7 @@ SHELL = @SHELL@
 # Here are the things that we expect ../configure to edit.
 # We use $(srcdir) explicitly in dependencies so as not to depend on VPATH.
 srcdir = @srcdir@
+abs_srcdir = @abs_srcdir@
 # MinGW CPPFLAGS may use this.
 abs_top_srcdir=@abs_top_srcdir@
 ntsource = $(srcdir)/../nt
@@ -580,38 +581,44 @@ bootstrap-clean: clean
          if test -f "$(srcdir)/.gdbinit"; then rm -f ./.gdbinit.save; \
          else mv ./.gdbinit.save ./.gdbinit; fi; \
        fi
-## This is used in making a distribution.
-## Do not use it on development directories!
+
 distclean: bootstrap-clean
        rm -f Makefile
+
 maintainer-clean: distclean
-       @echo "This command is intended for maintainers to use;"
-       @echo "it deletes files that may require special tools to rebuild."
-       rm -f TAGS
+       rm -f TAGS TAGS-LISP
 versionclean:
        -rm -f emacs$(EXEEXT) emacs-*.*.*$(EXEEXT) ../etc/DOC*
 extraclean: distclean
-       -rm -f *~ \#* m/?*~ s/?*~
+       -rm -f *~ \#*
+
 
-## Arrange to make a tags table TAGS-LISP for ../lisp,
-## plus TAGS for the C files, which includes ../lisp/TAGS by reference.
+ETAGS = ../lib-src/etags
 
 ctagsfiles1 = [xyzXYZ]*.[hc]
 ctagsfiles2 = [a-wA-W]*.[hc]
 ctagsfiles3 = [a-zA-Z]*.m
 
-TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE)
-       ../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
+## FIXME?  Do we really need to use absolute filenames here?
+
+## This does not need to depend on ../lisp and ../lwlib TAGS files,
+## because etags "--include" only includes a pointer to the file,
+## rather than the file contents.
+TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(srcdir)/$(ctagsfiles3)
+       "$(ETAGS)" --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
          --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/' \
-         $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(S_FILE) \
+         "$(abs_srcdir)"/$(ctagsfiles1) "$(abs_srcdir)"/$(ctagsfiles2) \
          --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/' \
-         $(srcdir)/$(ctagsfiles3)
+         "$(abs_srcdir)"/$(ctagsfiles3)
+
+## Arrange to make tags tables for ../lisp and ../lwlib,
+## which the above TAGS file for the C files includes by reference.
 frc:
 TAGS-LISP: frc
-       $(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags
+       $(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS="$(ETAGS)"
 
 $(lwlibdir)/TAGS:
-       (cd $(lwlibdir); $(MAKE) -f $(lwlibdir)/Makefile tags ETAGS=../lib-src/etags)
+       cd $(lwlibdir) && $(MAKE) TAGS ETAGS="$(ETAGS)"
 
 tags: TAGS TAGS-LISP $(lwlibdir)/TAGS
 .PHONY: tags