diff options
author | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2015-01-10 09:32:07 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2015-01-10 09:32:07 +0000 |
commit | d5ff8455455152b5590b34c11d3d5e8fb5048aa1 (patch) | |
tree | ea4421ce2f5d172063cb4414447b063fdf445c3d /Makefile | |
parent | 60dead4aee579f9da86549ce33d7de29de4e043b (diff) | |
download | ast2050-flashrom-d5ff8455455152b5590b34c11d3d5e8fb5048aa1.zip ast2050-flashrom-d5ff8455455152b5590b34c11d3d5e8fb5048aa1.tar.gz |
Refine revision handling
Up to now, when compiling flashrom outside a VCS it would print two
warnings that are not very clear to the user. This patch adds a new
auxilary function to getrevision.sh and uses it in the makefile to print a
single and more meaningful message to the user while hiding the
warnings from getrevision.sh.
Corresponding to flashrom svn r1862.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -373,7 +373,7 @@ CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o # Set the flashrom version string from the highest revision number of the checked out flashrom files. # Note to packagers: Any tree exported with "make export" or "make tarball" # will not require subversion. The downloadable snapshots are already exported. -SVNVERSION := $(shell ./util/getrevision.sh -u) +SVNVERSION := $(shell ./util/getrevision.sh -u 2>/dev/null ) RELEASE := 0.9.7 VERSION := $(RELEASE)-$(SVNVERSION) @@ -381,6 +381,11 @@ RELEASENAME ?= $(VERSION) SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"' +# Inform user if there is no meaningful version string. If there is version information from a VCS print +# something anyway because $(info...) will print a line break in any case which would look suspicious. +$(info $(shell ./util/getrevision.sh -c 2>/dev/null || echo "Files don't seem to be under version control." ; \ + echo "Replacing all version templates with $(VERSION)." )) + ############################################################################### # Default settings of CONFIG_* variables. @@ -992,7 +997,7 @@ endif @rm -f .featuretest.c .featuretest$(EXEC_SUFFIX) $(PROGRAM).8: $(PROGRAM).8.tmpl - @sed -e '1 s#".*".*#"$(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl)" "$(VERSION)"#' <$< >$@ + @sed -e '1 s#".*".*#"$(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl 2>/dev/null)" "$(VERSION)"#' <$< >$@ install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8 mkdir -p $(DESTDIR)$(PREFIX)/sbin |