diff --git a/Makefile b/Makefile index 3838b60..5626dc8 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -all install clean distclean: - $(MAKE) -C src $@ - PACKAGE=sysvinit VERSION=$(shell sed -rn '1s/.*[[:blank:]]\((.*)\)[[:blank:]].*/\1/p' doc/Changelog) + +all install clean distclean: + $(MAKE) VERSION=$(VERSION) -C src $@ + GITLOGIN=$(shell git remote -v | head -n 1 | cut -f 1 -d '@' | sed 's/origin\t//g') override TMP:=$(shell mktemp -du $(VERSION).XXXXXXXX) override TARBALL:=$(TMP)/$(PACKAGE)-$(VERSION).tar.xz diff --git a/doc/Changelog b/doc/Changelog index 1547330..1e6c29b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -4,13 +4,12 @@ sysvinit (2.91) UNRELEASED; urgency=low * Adjusted order of compile flags to make it easier for downstream to adjust optimization level. Patch provided by Matias Fonzo. -<<<<<<< HEAD Can now set optimization level in CFLAGS variable. * Added --version command line flag to display current version info. Updated manual page for init.8 to match. -======= - Can now set optimization level in CFLAGS varible. ->>>>>>> 5f6d86d216fd25a5086750465e73ed5579a86d18 + * Version information is now fetched and defined by the Makefile. + No more need to update the version manually in the init.c source. + sysvinit (2.90) world; urgency=low diff --git a/src/Makefile b/src/Makefile index dbcf3e4..272a316 100644 --- a/src/Makefile +++ b/src/Makefile @@ -10,7 +10,7 @@ CPPFLAGS = CFLAGS ?= -O2 -override CFLAGS += -ansi -fomit-frame-pointer -fstack-protector-strong -W -Wall -Wunreachable-code -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE -D_GNU_SOURCE +override CFLAGS += -ansi -fomit-frame-pointer -fstack-protector-strong -W -Wall -Wunreachable-code -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -D_XOPEN_SOURCE -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" override CFLAGS += $(shell getconf LFS_CFLAGS) STATIC = MANDB := s@^\('\\\\\"\)[^\*-]*-\*- coding: [^[:blank:]]\+ -\*-@\1@ diff --git a/src/init.c b/src/init.c index efc40dd..edbc856 100644 --- a/src/init.c +++ b/src/init.c @@ -8,7 +8,13 @@ * Version: @(#)init.c 2.86 30-Jul-2004 miquels@cistron.nl * Version: init.c 2.90 18-Jun-2018 jsmith@resonatingmedia.com */ -#define VERSION "2.90" + +/* +Version information is not placed in the top-level Makefile by default +*/ +#ifndef VERSION +#define VERSION "2.91" +#endif /* * This file is part of the sysvinit suite, * Copyright (C) 1991-2004 Miquel van Smoorenburg.