]> git.eshelyaron.com Git - emacs.git/commitdiff
Reduce duplication in lib-src etags/ctags rules
authorGlenn Morris <rgm@gnu.org>
Sat, 22 Mar 2014 23:08:41 +0000 (16:08 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 22 Mar 2014 23:08:41 +0000 (16:08 -0700)
* lib-src/Makefile.in (etags_deps, etags_args): New, to reduce duplication.
(etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args.

lib-src/ChangeLog
lib-src/Makefile.in

index 3472f54b0aa79e62fd977642f3597602d88ae0ea..85c4b90d9fcd4fe64d11b8ffa1334abd8802aff3 100644 (file)
@@ -1,5 +1,8 @@
 2014-03-22  Glenn Morris  <rgm@gnu.org>
 
+       * Makefile.in (etags_deps, etags_args): New, to reduce duplication.
+       (etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args.
+
        * Makefile.in (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT})
        (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT})
        (emacsclient${EXEEXT}, emacsclientw${EXEEXT}, hexl${EXEEXT})
index 7f22ee72602d203e3bfa70627113a47feb245638..91d13231f39c8e0396ec88e0ae304379c379afb9 100644 (file)
@@ -309,23 +309,26 @@ TAGS: etags${EXEEXT}
 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h)
        ${CC} -c ${CPP_CFLAGS} ${srcdir}/../src/regex.c
 
-etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
-       $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
-         -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) $(NTLIB) -o $@
+
+etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h)
+etags_args = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" \
+       ${srcdir}/etags.c regex.o $(LOADLIBES) $(NTLIB) -o $@
+
+etags${EXEEXT}: ${etags_deps}
+       $(CC) ${ALL_CFLAGS} ${etags_args}
+
+## FIXME?
+## Can't we use a symlink ctags -> etags, and make etags check for argv[0]?
+## Or a wrapper script that calls etags --ctags?
+ctags${EXEEXT}: ${etags_deps}
+       $(CC) ${ALL_CFLAGS} -DCTAGS ${etags_args}
+
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
                    $(config_h)
        $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
          ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o $@
 
-## We depend on etags to assure that parallel makes do not write two
-## etags.o files on top of each other.
-ctags${EXEEXT}: etags${EXEEXT}
-       $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
-         -DVERSION="\"${version}\"" ${srcdir}/etags.c \
-         regex.o $(LOADLIBES) $(NTLIB) -o $@
-
 profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h)
        $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \
          $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@