From: Glenn Morris Date: Sat, 2 Nov 2013 19:18:50 +0000 (-0700) Subject: Small Makefile cleanup mainly related to tags file generation X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1023 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b0b9e5923267012e5c4f3523ee601c229ea85232;p=emacs.git Small Makefile cleanup mainly related to tags file generation * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fba59e1c8b8..8bdf2d3a83e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2013-11-02 Glenn Morris + + * 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 * emacs-lisp/package.el (package-version-join): Recognize diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 537603a3018..be7a413b15b 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -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 diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 963b5baed1c..6d10fe551cb 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,9 @@ +2013-11-02 Glenn Morris + + * 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 * Makefile.in (abs_top_srcdir): New, set by configure. diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index b7f1673aca9..550983c1757 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index 1cea67b8689..99d19cd68c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2013-11-02 Glenn Morris + + * 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 * xfaces.c (check_lface_attrs, realize_default_face): Add diff --git a/src/Makefile.in b/src/Makefile.in index 21d92463f20..c61ff2ddd46 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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