summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/superiotool/Makefile9
-rw-r--r--util/superiotool/superiotool.c7
-rw-r--r--util/superiotool/superiotool.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/util/superiotool/Makefile b/util/superiotool/Makefile
index e8ba258682..87faecb05b 100644
--- a/util/superiotool/Makefile
+++ b/util/superiotool/Makefile
@@ -24,14 +24,21 @@ CC = gcc
INSTALL = /usr/bin/install
PREFIX = /usr/local
+# Set the superiotool version string from the highest revision number
+# of the checked out superiotool files.
+SVNDEF := -D'SUPERIOTOOL_VERSION="$(shell svnversion -cn . \
+ | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/")"'
+
# TODO: -pedantic
CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \
- -Werror-implicit-function-declaration -ansi
+ -Werror-implicit-function-declaration -ansi $(SVNDEF)
OBJS = superiotool.o ali.o fintek.o ite.o nsc.o smsc.o winbond.o
all: $(PROGRAM)
+superiotool.o: *.c superiotool.h
+
$(PROGRAM): $(OBJS) superiotool.h
$(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS)
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c
index 6c93f58c6b..7b5bb40f75 100644
--- a/util/superiotool/superiotool.c
+++ b/util/superiotool/superiotool.c
@@ -170,12 +170,7 @@ void probing_for(const char *vendor, const char *info, uint16_t port)
static void print_version(void)
{
- char tmp[80];
-
- strncpy((char *)&tmp,
- (const char *)&SUPERIOTOOL_VERSION[6],
- strlen(SUPERIOTOOL_VERSION) - 8);
- printf("superiotool r%s\n", (char *)&tmp);
+ printf("superiotool r%s\n", SUPERIOTOOL_VERSION);
}
int main(int argc, char *argv[])
diff --git a/util/superiotool/superiotool.h b/util/superiotool/superiotool.h
index 9ba514306f..58243466f2 100644
--- a/util/superiotool/superiotool.h
+++ b/util/superiotool/superiotool.h
@@ -29,8 +29,6 @@
#include <getopt.h>
#include <sys/io.h>
-#define SUPERIOTOOL_VERSION "$Rev$"
-
#define USAGE "Usage: superiotool [-d] [-D] [-V] [-v] [-h]\n\n\
-d | --dump Dump Super I/O registers\n\
-D | --dump-readable Dump Super I/O registers in human-readable format\n\