summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2013-08-29 00:38:19 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-08-29 00:38:19 +0000
commita93d9dc54d7c7a98912632a3097fe853e813c28d (patch)
tree9ffd6c3d805abab27369bce1e8d8e5f7d09777ed
parentec7a35f7ec8be2cb541de86263a35b1d54206a6b (diff)
downloadast2050-flashrom-a93d9dc54d7c7a98912632a3097fe853e813c28d.zip
ast2050-flashrom-a93d9dc54d7c7a98912632a3097fe853e813c28d.tar.gz
Automatically add version and date to the manpage
To avoid funny effects of ever changing files tracked by the VCS this patch moves the manpage data to flashrom.8.tmpl and generates the actual manpage with a new makefile target if needed. Corresponding to flashrom svn r1728. Signed-off-by: Joerg Mayer <jmayer@loplof.de> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-rw-r--r--Makefile14
-rw-r--r--flashrom.8.tmpl (renamed from flashrom.8)2
2 files changed, 10 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f34ed1d..70ef640 100644
--- a/Makefile
+++ b/Makefile
@@ -649,7 +649,7 @@ FEATURE_LIBS += $(shell LC_ALL=C grep -q "NEEDLIBZ := yes" .libdeps && printf "%
LIBFLASHROM_OBJS = $(CHIP_OBJS) $(PROGRAMMER_OBJS) $(LIB_OBJS)
OBJS = $(CLI_OBJS) $(LIBFLASHROM_OBJS)
-all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX)
+all: hwlibs features $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
ifeq ($(ARCH), x86)
@+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX)
endif
@@ -673,7 +673,7 @@ TAROPTIONS = $(shell LC_ALL=C tar --version|grep -q GNU && echo "--owner=root --
# This includes all frontends and libflashrom.
# We don't use EXEC_SUFFIX here because we want to clean everything.
clean:
- rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d
+ rm -f $(PROGRAM) $(PROGRAM).exe libflashrom.a *.o *.d $(PROGRAM).8
@+$(MAKE) -C util/ich_descriptors_tool/ clean
distclean: clean
@@ -867,16 +867,20 @@ endif
@$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features
@rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)
-install: $(PROGRAM)$(EXEC_SUFFIX)
+$(PROGRAM).8: $(PROGRAM).8.tmpl
+ @sed -e '1 s#".*".*#"$(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl)" "$(VERSION)"#' <$< >$@
+
+install: $(PROGRAM)$(EXEC_SUFFIX) $(PROGRAM).8
mkdir -p $(DESTDIR)$(PREFIX)/sbin
mkdir -p $(DESTDIR)$(MANDIR)/man8
$(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin
$(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8
-export:
+export: $(PROGRAM).8
@rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME)
@svn export -r BASE . $(EXPORTDIR)/flashrom-$(RELEASENAME)
@sed "s/^SVNVERSION.*/SVNVERSION := $(SVNVERSION)/" Makefile >$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile
+ @cp $(PROGRAM).8 "$(EXPORTDIR)/flashrom-$(RELEASENAME)/$(PROGRAM).8"
@LC_ALL=C svn log >$(EXPORTDIR)/flashrom-$(RELEASENAME)/ChangeLog
@echo Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/
@@ -890,6 +894,6 @@ djgpp-dos: clean
libpayload: clean
make CC="CC=i386-elf-gcc lpgcc" AR=i386-elf-ar RANLIB=i386-elf-ranlib
-.PHONY: all clean distclean compiler hwlibs features export tarball dos featuresavailable
+.PHONY: all install clean distclean compiler hwlibs features export tarball dos featuresavailable
-include $(OBJS:.o=.d)
diff --git a/flashrom.8 b/flashrom.8.tmpl
index c52542a..5ede423 100644
--- a/flashrom.8
+++ b/flashrom.8.tmpl
@@ -1,4 +1,4 @@
-.TH FLASHROM 8 "Jul, 2013"
+.TH FLASHROM 8 "" ""
.SH NAME
flashrom \- detect, read, write, verify and erase flash chips
.SH SYNOPSIS
OpenPOWER on IntegriCloud