Dynamically generate "repmgr_version.h"

This commit is contained in:
Ian Barwick
2017-09-12 12:02:26 +09:00
parent b6cd816923
commit 621ca352df
3 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@@ -35,6 +35,7 @@ lib*.pc
/config.log
/config.status
/config.h
/repmgr_version.h
# other
/.lineno

View File

@@ -35,8 +35,12 @@ REPMGR_CLIENT_OBJS = repmgr-client.o \
repmgr-action-primary.o repmgr-action-standby.o repmgr-action-bdr.o repmgr-action-cluster.o repmgr-action-node.o \
configfile.o log.o strutil.o controldata.o dirutil.o compat.o dbutils.o
REPMGRD_OBJS = repmgrd.o repmgrd-physical.o repmgrd-bdr.o configfile.o log.o dbutils.o strutil.o controldata.o
DATE=$(shell date "+%Y-%m-%d")
$(REPMGR_CLIENT_OBJS): repmgr-client.h
repmgr_version.h: repmgr_version.h.in
sed '0,/REPMGR_VERSION_DATE/s,\(REPMGR_VERSION_DATE\).*,\1 "$(DATE)",' $< >$@
$(REPMGR_CLIENT_OBJS): repmgr-client.h repmgr_version.h
repmgr: $(REPMGR_CLIENT_OBJS)
$(CC) $(CFLAGS) $(REPMGR_CLIENT_OBJS) $(libpq_pgport) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)

View File

@@ -19,6 +19,7 @@
#ifndef _VERSION_H_
#define _VERSION_H_
#define REPMGR_VERSION_DATE ""
#define REPMGR_VERSION "4.0dev"
#endif