summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-12-09 11:46:11 -0500
committerDave Jones <davej@redhat.com>2011-12-09 11:46:11 -0500
commit8052aabdd159bc9050e7dc264f33782c5acce05f (patch)
treee021bd16647c689a4f17c064cd3551759049f8a8
parentfbca04b00e98eda3994ff0a73049a0da6d7345c3 (diff)
centralise version number to the makefile.
having to change it in several places is a recipe for failure.
-rw-r--r--Makefile2
-rw-r--r--README2
-rw-r--r--lsmsr.c4
-rw-r--r--x86info.c2
-rw-r--r--x86info.h3
5 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 65acf2f..0e4c7d2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION=1.30
-CFLAGS = -g -O2 -Werror -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls
+CFLAGS = -g -O2 -Werror -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement -Wredundant-decls -DVERSION="$(VERSION)"
LDFLAGS = -Wl,-z,relro,-z,now
CC = gcc
diff --git a/README b/README
index 5eedabb..79afb48 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-x86info v1.30 http://www.codemonkey.org.uk/projects/x86info
+x86info http://www.codemonkey.org.uk/projects/x86info
Dave Jones <davej@redhat.com>
Somewhere in the mists of time, there was a program by Phil Karn (KA9Q)
diff --git a/lsmsr.c b/lsmsr.c
index aadda0d..0c7aa98 100644
--- a/lsmsr.c
+++ b/lsmsr.c
@@ -41,7 +41,7 @@
* - add support for generic MSRs for non-Intel/AMD CPUs
*/
-#define VERSION "0.816"
+#define LSMSR_VERSION "0.816"
struct {
int fd;
@@ -116,7 +116,7 @@ static void help(void)
static void version(void)
{
- fprintf(stdout, "%s version %s\n", g.prog, VERSION);
+ fprintf(stdout, "%s version %s\n", g.prog, LSMSR_VERSION);
}
static int get_msr_val(unsigned int msr, unsigned long long *val)
diff --git a/x86info.c b/x86info.c
index f621b9e..22c4734 100644
--- a/x86info.c
+++ b/x86info.c
@@ -169,7 +169,7 @@ int main (int argc, char **argv)
parse_command_line(argc, argv);
- printf("x86info v1.30. Dave Jones 2001-2011\n");
+ printf("x86info v" __stringify(VERSION) " Dave Jones 2001-2011\n");
printf("Feedback to <davej@redhat.com>.\n\n");
if ((HaveCPUID()) == 0) {
diff --git a/x86info.h b/x86info.h
index 5bc6231..96fa1e5 100644
--- a/x86info.h
+++ b/x86info.h
@@ -238,4 +238,7 @@ static inline void bind_cpu(struct cpudata *cpu)
}
}
+#define __stringify_1(x...) #x
+#define __stringify(x...) __stringify_1(x)
+
#endif /* _X86INFO_H */