]> code.delx.au - gnu-emacs/commitdiff
Build tweaks related to tags files.
authorGlenn Morris <rgm@gnu.org>
Wed, 6 Jan 2016 23:25:47 +0000 (18:25 -0500)
committerGlenn Morris <rgm@gnu.org>
Wed, 6 Jan 2016 23:25:47 +0000 (18:25 -0500)
* lib-src/Makefile.in (tagsfiles): New variable.
(TAGS): Also depend on the source files.  Use our own etags program.
* lisp/Makefile.in (ETAGS): Add EXEEXT.
(lisptagsfiles1, lisptagsfiles2, lisptagsfiles3, lisptagsfiles4):
Remove.
(tagsfiles): New, replacing lisptagsfiles1 etc.
Remove irrelevant source files here rather than in the TAGS rule.
(${ETAGS}): New rule.
(TAGS): Also depend on the etags executable.
* lwlib/Makefile.in (EXEEXT): New, set by configure.
(ETAGS): Add EXEEXT.
(${ETAGS}): New rule.
(ctagsfiles): Use "wildcard".
(TAGS): Also depend on the etags executable.
* nt/Makefile.in (ETAGS, tagsfiles): New variables.
(${ETAGS}): New rule.
(TAGS): Fix dependencies.
* oldXMenu/Makefile.in (EXEEXT): New, set by configure.
(ETAGS): New variable, replacing $TAGS.  Use our own etags program.
Remove "-t" argument.
(${ETAGS}): New rule.
(tagsfiles): New variable.
(TAGS): New rule, with proper dependencies.
* src/Makefile.in (ETAGS): Add EXEEXT.  Add a build rule.
(ctagsfiles1, ctagsfiles2): Use "wildcard".
(ctagsfiles3): Remove.
(TAGS): Depend on etags.
(../lisp/TAGS, $(lwlibdir)/TAGS): Let the rules in the relevant
directories decide if updates are needed.

lib-src/Makefile.in
lisp/Makefile.in
lwlib/Makefile.in
nt/Makefile.in
oldXMenu/Makefile.in
src/Makefile.in

index 2b65cb2e1a9ca0f0ac78a1ae5967835db0f4282d..b666508e5930dabca338ddce76607870ca84bdf6 100644 (file)
@@ -345,9 +345,12 @@ extraclean: maintainer-clean
 check:
        @echo "We don't have any tests for the lib-src/ directory yet."
 
+tagsfiles = $(wildcard ${srcdir}/*.[ch])
+
+.PHONY: tags
 tags: TAGS
-TAGS: etags${EXEEXT}
-       etags *.[ch]
+TAGS: etags${EXEEXT} ${tagsfiles}
+       ./etags ${tagsfiles}
 
 ../lib/libgnu.a: $(config_h)
        $(MAKE) -C ../lib all
index 3d0c95dcb5ef0f669c339f1da28c830e6c70f705..5f72e6ce23e337fecce4525941ca33cd0f873938 100644 (file)
@@ -220,26 +220,28 @@ update-authors:
        $(emacs) -L "$(top_srcdir)/admin" -l authors \
          -f batch-update-authors "$(top_srcdir)/etc/AUTHORS" "$(top_srcdir)"
 
+FORCE:
+.PHONY: FORCE
 
-ETAGS = ../lib-src/etags
+tagsfiles = $(shell find ${srcdir} -name '*.el')
+tagsfiles := $(filter-out ${srcdir}/%loaddefs.el,${tagsfiles})
+tagsfiles := $(filter-out ${srcdir}/ldefs-boot.el,${tagsfiles})
+tagsfiles := $(filter-out ${srcdir}/eshell/esh-groups.el,${tagsfiles})
 
-lisptagsfiles1 = $(srcdir)/*.el
-lisptagsfiles2 = $(srcdir)/*/*.el
-lisptagsfiles3 = $(srcdir)/*/*/*.el
-lisptagsfiles4 = $(srcdir)/*/*/*/*.el
+ETAGS = ../lib-src/etags${EXEEXT}
+
+${ETAGS}: FORCE
+       ${MAKE} -C ../lib-src $(notdir $@)
 
 ## The ls | sed | xargs is to stop the command line getting too long
 ## on MS Windows, when the MSYS Bash passes it to a MinGW compiled
 ## etags.  It might be better to use find in a similar way to
 ## compile-main.  But maybe this is not even necessary any more now
 ## that this uses relative filenames.
-TAGS: $(lisptagsfiles1) $(lisptagsfiles2) $(lisptagsfiles3) $(lisptagsfiles4)
+TAGS: ${ETAGS} ${tagsfiles}
        rm -f $@
        touch $@
-       ls $(lisptagsfiles1) $(lisptagsfiles2) \
-          $(lisptagsfiles3) $(lisptagsfiles4) | \
-           sed -e '/loaddefs/d; /\/ldefs-boot/d; /esh-groups\.el/d' | \
-           xargs $(XARGS_LIMIT) "$(ETAGS)" -a -o $@
+       ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@
 
 
 # The src/Makefile.in has its own set of dependencies and when they decide
index bfeef16571afdbeb443fd07eb9da69ca95457c01..be12b4235b684781600bb9eced74169ac05f2d6e 100644 (file)
@@ -44,6 +44,7 @@ RANLIB=@RANLIB@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
 MKDIR_P = @MKDIR_P@
+EXEEXT = @EXEEXT@
 
 LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
 MOTIF_OBJS = lwlib-Xm.o
@@ -128,15 +129,17 @@ distclean: clean
 bootstrap-clean maintainer-clean: distclean
        rm -f TAGS
 
+ETAGS = ../lib-src/etags${EXEEXT}
 
-ETAGS = ../lib-src/etags
+${ETAGS}: FORCE
+       ${MAKE} -C ../lib-src $(notdir $@)
 
-ctagsfiles= $(srcdir)/*.[ch]
+ctagsfiles= $(wildcard ${srcdir}/*.[ch])
 
-TAGS: $(ctagsfiles)
-       "$(ETAGS)" $(ctagsfiles)
+FORCE:
+.PHONY: tags FORCE
 tags: TAGS
-.PHONY: tags
-
+TAGS: ${ETAGS} $(ctagsfiles)
+       ${ETAGS} $(ctagsfiles)
 
 ### Makefile.in ends here
index fc6887f163eab3fc54e676d256874ba7aa4eb20f..86fca5f8e36ec8ada55d93c4769a878c3178b89e 100644 (file)
@@ -225,9 +225,18 @@ extraclean: maintainer-clean
 check:
        @echo "We don't have any tests for the nt/ directory yet."
 
+ETAGS = ../lib-src/etags${EXEEXT}
+
+${ETAGS}: FORCE
+       ${MAKE} -C ../lib-src $(notdir $@)
+
+tagsfiles= $(wildcard ${srcdir}/*.[ch])
+
+FORCE:
+.PHONY: tags FORCE
 tags: TAGS
-TAGS: ${EXE_FILES:${EXEEXT}=.c}
-       ../lib-src/etags *.[ch]
+TAGS: ${ETAGS} ${tagsfiles}
+       ${ETAGS} ${tagsfiles}
 
 ## Build the programs
 addpm${EXEEXT}: ${srcdir}/addpm.c ../src/epaths.h
index de5b8e1114c052253949d3b1c770b41fc2ad5e0c..71dd5663f43c722737ad0d73f7fb24a9c35b9f74 100644 (file)
@@ -58,12 +58,12 @@ CC=@CC@
 CFLAGS=@CFLAGS@
 CPPFLAGS = @CPPFLAGS@
 
-TAGS = etags
 RM = rm -f
 RANLIB = @RANLIB@
 AR = @AR@
 ARFLAGS = @ARFLAGS@
 MKDIR_P = @MKDIR_P@
+EXEEXT = @EXEEXT@
 
 OBJS =  Activate.o \
        AddPane.o \
@@ -152,8 +152,17 @@ clean mostlyclean:
 bootstrap-clean maintainer-clean distclean: clean
        rm -f Makefile
 
-.PHONY: tags
-tags:
-       $(TAGS) -t *.[ch]
+ETAGS = ../lib-src/etags${EXEEXT}
+
+${ETAGS}: FORCE
+       ${MAKE} -C ../lib-src $(notdir $@)
+
+tagsfiles = $(wildcard ${srcdir}/*.[ch])
+
+FORCE:
+.PHONY: tags FORCE
+tags: TAGS
+TAGS: ${ETAGS} ${tagsfiles}
+       ${ETAGS} ${tagsfiles}
 
 ### Makefile.in ends here
index f96ebb2aeeb370806f7ec2619db213c8f0a4941a..97505b986870159814fcb245e347cc882caef4a0 100644 (file)
@@ -649,32 +649,34 @@ extraclean: distclean
        -rm -f *~ \#*
 
 
-ETAGS = ../lib-src/etags
+ETAGS = ../lib-src/etags${EXEEXT}
 
-ctagsfiles1 = [xyzXYZ]*.[hc]
-ctagsfiles2 = [a-wA-W]*.[hc]
-ctagsfiles3 = [a-zA-Z]*.m
+${ETAGS}: FORCE
+       ${MAKE} -C ../lib-src $(notdir $@)
+
+ctagsfiles1 = $(wildcard ${srcdir}/*.[hc])
+ctagsfiles2 = $(wildcard ${srcdir}/*.m)
 
 ## FIXME? In out-of-tree builds, should TAGS be generated in srcdir?
 
 ## 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=../lisp/TAGS --include=$(lwlibdir)/TAGS \
+TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
+       ${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \
          --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/\1/' \
          --regex='{c}/[        ]*DEFVAR_[A-Z_  (]+"[^"]+",[    ]\([A-Za-z0-9_]+\)/\1/' \
-         $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) \
+         $(ctagsfiles1) \
          --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"\([^"]+\)"/\1/' \
          --regex='{objc}/[     ]*DEFVAR_[A-Z_  (]+"[^"]+",[    ]\([A-Za-z0-9_]+\)/\1/' \
-         $(srcdir)/$(ctagsfiles3)
+         $(ctagsfiles2)
 
 ## Arrange to make tags tables for ../lisp and ../lwlib,
 ## which the above TAGS file for the C files includes by reference.
-../lisp/TAGS:
+../lisp/TAGS: FORCE
        $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)"
 
-$(lwlibdir)/TAGS:
+$(lwlibdir)/TAGS: FORCE
        $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)"
 
 tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS