Reduce duplication in lib-src etags/ctags rules

* lib-src/Makefile.in (etags_deps, etags_args): New, to reduce duplication.
(etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args.
This commit is contained in:
Glenn Morris 2014-03-22 16:08:41 -07:00
parent df199e5601
commit 10211d43fa
2 changed files with 17 additions and 11 deletions

View 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})

View 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 $@