Author: stefanct
Date: Thu Aug 29 02:38:19 2013
New Revision: 1728
URL: http://flashrom.org/trac/flashrom/changeset/1728

Log:
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.

Signed-Off-By: Joerg Mayer <[email protected]>
Signed-off-by: Stefan Tauner <[email protected]>
Acked-by: Stefan Tauner <[email protected]>

Added:
   trunk/flashrom.8.tmpl
      - copied, changed from r1727, trunk/flashrom.8
Deleted:
   trunk/flashrom.8
Modified:
   trunk/Makefile

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile      Thu Aug 29 02:38:14 2013        (r1727)
+++ trunk/Makefile      Thu Aug 29 02:38:19 2013        (r1728)
@@ -649,7 +649,7 @@
 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 @@
 # 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 @@
        @$(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 @@
 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)

Copied and modified: trunk/flashrom.8.tmpl (from r1727, trunk/flashrom.8)
==============================================================================
--- trunk/flashrom.8    Thu Aug 29 02:38:14 2013        (r1727, copy source)
+++ trunk/flashrom.8.tmpl       Thu Aug 29 02:38:19 2013        (r1728)
@@ -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

_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to