From 10211d43fa7eddfd644f8f95650a691989611e8c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 22 Mar 2014 16:08:41 -0700 Subject: [PATCH] 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. --- lib-src/ChangeLog | 3 +++ lib-src/Makefile.in | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 3472f54b0aa..85c4b90d9fc 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,8 @@ 2014-03-22 Glenn Morris + * 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}) diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 7f22ee72602..91d13231f39 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -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 $@ -- 2.39.2