[syslinux:master] sysdump: *actually* generate the proper version string
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Sun Feb 7 12:18:22 PST 2010
Commit-ID: 459a865ecfd949e7819c7674d3b450a1d1182d05
Gitweb: http://syslinux.zytor.com/commit/459a865ecfd949e7819c7674d3b450a1d1182d05
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sun, 7 Feb 2010 12:13:34 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Sun, 7 Feb 2010 12:13:34 -0800
sysdump: *actually* generate the proper version string
Make the gen-id.sh script actually do the right thing...
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
com32/sysdump/Makefile | 9 +++++++--
gen-id.sh | 5 +++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index 4ac235a..bffee3a 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -17,6 +17,7 @@
topdir = ../..
include ../MCONFIG
+-include $(topdir)/version.mk
LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
LNXLIBS = ../libutil/libutil_lnx.a
@@ -24,13 +25,17 @@ LNXLIBS = ../libutil/libutil_lnx.a
MODULES = sysdump.c32
TESTFILES =
-OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
+SRCS = $(wildcard *.c)
+OBJS = $(patsubst %.c,%.o,$(SRCS))
# The DATE is set on the make command line when building binaries for
# official release. Otherwise, substitute a hex string that is pretty much
# guaranteed to be unique to be unique from build to build.
+ifndef HEXDATE
+HEXDATE := $(shell $(PERL) $(topdir)/now.pl $(SRCS) $(wildcard *.h))
+endif
ifndef DATE
-DATE := $(shell sh ../gen-id.sh $(VERSION) $(HEXDATE))
+DATE := $(shell sh $(topdir)/gen-id.sh $(VERSION) $(HEXDATE))
endif
CFLAGS += -DDATE='"$(DATE)"'
diff --git a/gen-id.sh b/gen-id.sh
index 1b3e108..301ea4e 100755
--- a/gen-id.sh
+++ b/gen-id.sh
@@ -8,9 +8,10 @@
#
ver="$1"
-tim="$1"
+tim="$2"
+top=`dirname "$0"`
-if test -n "$GIT_DIR" -o -d ../.git -o -f ../.git; then
+if test -n "$GIT_DIR" -o -d "$top"/.git -o -f "$top"/.git; then
id="$(git describe)"
if test -n "$id"; then
if test x"$(echo "$id" | cut -d- -f1)" = xsyslinux; then
More information about the Syslinux-commits
mailing list