From: Marco Sirabella Date: Fri, 23 Nov 2018 17:41:40 +0000 (-0500) Subject: Replace git_ver.h with a combination of git_ver.{c,o} X-Git-Tag: 2019-10-25~482 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d6e1ec421f25b8668509b000a022b08429cd5fac;p=neomutt Replace git_ver.h with a combination of git_ver.{c,o} --- diff --git a/.gitignore b/.gitignore index 6cc68da58..e1c7b6507 100644 --- a/.gitignore +++ b/.gitignore @@ -33,7 +33,7 @@ doc/neomuttrc.5 # Generated source config.h conststrings.c -git_ver.h +git_ver.c hcache/hcversion.h # Misc diff --git a/Makefile.autosetup b/Makefile.autosetup index 4c9de85cd..e227d522d 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -64,7 +64,7 @@ NEOMUTT= neomutt$(EXEEXT) NEOMUTTOBJS= account.o addrbook.o alias.o bcache.o browser.o color.o commands.o \ complete.o compose.o compress.o conststrings.o copy.o \ curs_lib.o edit.o editmsg.o enriched.o enter.o \ - filter.o flags.o group.o handler.o hdrline.o help.o hook.o \ + filter.o flags.o git_ver.o group.o handler.o hdrline.o help.o hook.o \ index.o init.o keymap.o mailbox.o main.o menu.o muttlib.o \ mutt_account.o mutt_attach.o mutt_body.o mutt_header.o \ mutt_history.o mutt_logging.o mutt_parse.o mutt_signal.o \ @@ -259,7 +259,7 @@ ALLOBJS+= $(LIBMUTTOBJS) ############################################################################### # generated -GENERATED= git_ver.h hcache/hcversion.h +GENERATED= git_ver.c hcache/hcversion.h CLEANFILES+= $(GENERATED) ############################################################################## @@ -271,8 +271,7 @@ all: $(BINFILES) $(LIBBINFILES) $(ALL_TARGETS) $(CC) $(CFLAGS) -MT $@ -MD -MP -MF $*.Tpo -c -o $@ $< @mv $*.Tpo $*.Po -# make sure git_ver.h is built before any .o files -$(ALLOBJS): git_ver.h +$(ALLOBJS): # mutt $(NEOMUTT): $(GENERATED) $(NEOMUTTOBJS) $(MUTTLIBS) @@ -368,12 +367,12 @@ $(PGPEWRAP): $(PGPEWRAPOBJS) $(CC) $(LDFLAGS) -o $@ $(PGPEWRAPOBJS) # generated -git_ver.h: $(ALL_FILES) +git_ver.c: $(ALL_FILES) version=`git describe --dirty --abbrev=6 --match "neomutt-*" 2> /dev/null | \ sed -e 's/^neomutt-[0-9]\{8\}//; s/-g\([a-z0-9]\{6\}\)/-\1/'`; \ - echo 'const char *GitVer = "'$$version'";' > git_ver.h.tmp; \ - cmp -s git_ver.h.tmp git_ver.h || mv git_ver.h.tmp git_ver.h; \ - rm -f git_ver.h.tmp + echo 'const char *GitVer = "'$$version'";' > $@.tmp; \ + cmp -s $@.tmp $@ || mv $@.tmp $@; \ + rm -f $@.tmp hcache/hcversion.h: $(SRCDIR)/email/address.h \ $(SRCDIR)/email/body.h \ diff --git a/globals.h b/globals.h index 00776d50c..d87d7ddbd 100644 --- a/globals.h +++ b/globals.h @@ -31,7 +31,6 @@ #ifdef MAIN_C /* so that global vars get included */ -#include "git_ver.h" #include "mx.h" #include "ncrypt/ncrypt.h" #include "sort.h"