diff --git a/.gitignore b/.gitignore index a83c4c97..a7526b78 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ lib*.pc /config.log /config.status /config.h +/repmgr_version.h # other /.lineno diff --git a/Makefile.in b/Makefile.in index c769d6f7..740876f9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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) diff --git a/repmgr_version.h b/repmgr_version.h.in similarity index 96% rename from repmgr_version.h rename to repmgr_version.h.in index a6760762..7ed5c769 100644 --- a/repmgr_version.h +++ b/repmgr_version.h.in @@ -19,6 +19,7 @@ #ifndef _VERSION_H_ #define _VERSION_H_ +#define REPMGR_VERSION_DATE "" #define REPMGR_VERSION "4.0dev" #endif