[flashrom] [PATCH] Add version to manpage (plus other stuff)

Joerg Mayer jmayer at loplof.de
Fri Dec 28 09:38:17 CET 2012


Add version and description to manpage, make extension configurable.
Remove some trailing whitespace from manpage.

Note1: This requires sed during the build process. Is this acceptable?
Note2: Apply patch, then rename flashrom.8 to flashrom.man.in

Signed-off-by: Joerg Mayer <jmayer at loplof.de>

Index: flashrom.8
===================================================================
--- flashrom.8	(revision 1633)
+++ flashrom.8	(working copy)
@@ -1,4 +1,4 @@
-.TH FLASHROM 8 "Dec, 2012"
+.TH FLASHROM @MANEXT@ "@DATE@" "@VERSION@" "A flash programmer"
 .SH NAME
 flashrom \- detect, read, write, verify and erase flash chips
 .SH SYNOPSIS
@@ -128,7 +128,7 @@
 .sp
 .B "  flashrom \-p prog \-\-layout rom.layout \-\-image normal \-w some.rom"
 .sp
-To update only the images named 
+To update only the images named
 .BR "normal " "and " "fallback" ", run:"
 .sp
 .B "  flashrom \-p prog \-l rom.layout \-i normal -i fallback \-w some.rom"
@@ -694,11 +694,11 @@
 .BR "pony_spi " programmer
 The serial port (like /dev/ttyS0, /dev/ttyUSB0 on Linux or COM3 on windows) is
 specified using the mandatory
-.B dev 
+.B dev
 parameter. The adapter type is selectable between SI-Prog (used for
 SPI devices with PonyProg 2000) or a custom made serial bitbanging programmer
 named "serbang". The optional
-.B type 
+.B type
 parameter accepts the values "si_prog" (default) or "serbang".
 .sp
 Information about the SI-Prog adapter can be found at
@@ -724,7 +724,7 @@
 .B cprom
 or
 .B s3
-for the configuration ROM and 
+for the configuration ROM and
 .B bprom
 or
 .B bios
@@ -733,7 +733,7 @@
 you want to use with the
 .B pci=
 parameter as explained in the
-.B nic3com et al.\& 
+.B nic3com et al.\&
 section above.
 .sp
 More information about the hardware is available at
Index: Makefile
===================================================================
--- Makefile	(revision 1633)
+++ Makefile	(working copy)
@@ -35,6 +35,7 @@
 DIFF    = diff
 PREFIX  ?= /usr/local
 MANDIR  ?= $(PREFIX)/share/man
+MANEXT  ?= 8
 CFLAGS  ?= -Os -Wall -Wshadow
 EXPORTDIR ?= .
 AR      ?= ar
@@ -318,6 +319,7 @@
 RELEASE := 0.9.6.1
 VERSION := $(RELEASE)-r$(SVNVERSION)
 RELEASENAME ?= $(VERSION)
+DATE := Dec 2012
 
 SVNDEF := -D'FLASHROM_VERSION="$(VERSION)"'
 
@@ -581,7 +583,7 @@
 else
 ifeq ($(TARGET_OS), Darwin)
 # DirectHW framework can be found in the DirectHW library.
-PCILIBS += -framework IOKit -framework DirectHW 
+PCILIBS += -framework IOKit -framework DirectHW
 else
 endif
 endif
@@ -608,7 +610,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).$(MANEXT)
 ifeq ($(ARCH), x86)
 	@+$(MAKE) -C util/ich_descriptors_tool/ TARGET_OS=$(TARGET_OS) EXEC_SUFFIX=$(EXEC_SUFFIX)
 endif
@@ -632,7 +634,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).$(MANEXT)
 	@+$(MAKE) -C util/ich_descriptors_tool/ clean
 
 distclean: clean
@@ -826,11 +828,14 @@
 	@$(DIFF) -q .features.tmp .features >/dev/null 2>&1 && rm .features.tmp || mv .features.tmp .features
 	@rm -f .featuretest.c .featuretest$(EXEC_SUFFIX)
 
+flashrom.$(MANEXT): flashrom.man.in
+	sed -e "s#@MANEXT@#$(MANEXT)#g" -e "s#@VERSION@#$(VERSION)#g" -e "s#@DATE@#$(DATE)#g" <$< >$@
+
 install: $(PROGRAM)$(EXEC_SUFFIX)
 	mkdir -p $(DESTDIR)$(PREFIX)/sbin
-	mkdir -p $(DESTDIR)$(MANDIR)/man8
+	mkdir -p $(DESTDIR)$(MANDIR)/man$(MANEXT)
 	$(INSTALL) -m 0755 $(PROGRAM)$(EXEC_SUFFIX) $(DESTDIR)$(PREFIX)/sbin
-	$(INSTALL) -m 0644 $(PROGRAM).8 $(DESTDIR)$(MANDIR)/man8
+	$(INSTALL) -m 0644 $(PROGRAM).$(MANEXT) $(DESTDIR)$(MANDIR)/man$(MANEXT)
 
 export:
 	@rm -rf $(EXPORTDIR)/flashrom-$(RELEASENAME)
-- 
Joerg Mayer                                           <jmayer at loplof.de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.




More information about the flashrom mailing list