aboutsummaryrefslogtreecommitdiff
path: root/external/xscom-utils
diff options
context:
space:
mode:
authorCédric Le Goater <clg@fr.ibm.com>2016-03-09 13:30:36 +0100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-03-31 14:26:53 +1100
commit634add7df941011816cd65e03507e1d9e69e38f5 (patch)
treeb58204e6a915a871ec3ed6f036a05e4f21dc8ea6 /external/xscom-utils
parent618a201ebf33382fadc3f5353a47ac11ab8a2a9b (diff)
downloadskiboot-634add7df941011816cd65e03507e1d9e69e38f5.zip
skiboot-634add7df941011816cd65e03507e1d9e69e38f5.tar.gz
skiboot-634add7df941011816cd65e03507e1d9e69e38f5.tar.bz2
external: use skiboot make_version script
Let's version like skiboot and other external tools do. There is no need to generate a version.c file. Defining VERSION on the compile commande line is enough. Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> [stewart@linux.vnet.ibm.com: fix makefile CFLAGS so can be overwritten] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/xscom-utils')
-rw-r--r--external/xscom-utils/Makefile5
-rw-r--r--external/xscom-utils/getscom.c6
-rw-r--r--external/xscom-utils/getsram.c6
-rw-r--r--external/xscom-utils/putscom.c6
4 files changed, 6 insertions, 17 deletions
diff --git a/external/xscom-utils/Makefile b/external/xscom-utils/Makefile
index b5d0d1c..f944ff3 100644
--- a/external/xscom-utils/Makefile
+++ b/external/xscom-utils/Makefile
@@ -1,7 +1,8 @@
all: getscom putscom getsram
-VERSION=0.1
-CFLAGS=-O2 -g -Wall -m64 -DVERSION=$(VERSION)
+XSCOM_VERSION ?= $(shell ../../make_version.sh xscom-utils)
+CFLAGS?=-O2 -g -Wall -m64
+override CFLAGS += -DVERSION=\"$(XSCOM_VERSION)\"
getscom: getscom.c xscom.c
$(CC) $(CFLAGS) -o $@ $^
diff --git a/external/xscom-utils/getscom.c b/external/xscom-utils/getscom.c
index 96dcace..81893df 100644
--- a/external/xscom-utils/getscom.c
+++ b/external/xscom-utils/getscom.c
@@ -74,10 +74,6 @@ static void print_chip_info(uint32_t chip_id)
}
-#define VERSION_STR _str(VERSION)
-#define _str(s) __str(s)
-#define __str(s) #s
-
int main(int argc, char *argv[])
{
uint64_t val, addr = -1ull;
@@ -112,7 +108,7 @@ int main(int argc, char *argv[])
list_chips = true;
break;
case 'v':
- printf("xscom utils version %s\n", VERSION_STR);
+ printf("xscom utils version %s\n", VERSION);
exit(1);
default:
exit(1);
diff --git a/external/xscom-utils/getsram.c b/external/xscom-utils/getsram.c
index ea3d38b..5dbd81b 100644
--- a/external/xscom-utils/getsram.c
+++ b/external/xscom-utils/getsram.c
@@ -32,10 +32,6 @@ static void print_usage(void)
exit(1);
}
-#define VERSION_STR _str(VERSION)
-#define _str(s) __str(s)
-#define __str(s) #s
-
int main(int argc, char *argv[])
{
uint64_t val, addr = -1ull;
@@ -73,7 +69,7 @@ int main(int argc, char *argv[])
print_usage();
break;
case 'v':
- printf("xscom utils version %s\n", VERSION_STR);
+ printf("xscom utils version %s\n", VERSION);
exit(1);
default:
exit(1);
diff --git a/external/xscom-utils/putscom.c b/external/xscom-utils/putscom.c
index be7b696..0c4d5cd 100644
--- a/external/xscom-utils/putscom.c
+++ b/external/xscom-utils/putscom.c
@@ -30,10 +30,6 @@ static void print_usage(void)
exit(1);
}
-#define VERSION_STR _str(VERSION)
-#define _str(s) __str(s)
-#define __str(s) #s
-
int main(int argc, char *argv[])
{
uint64_t val = -1ull, addr = -1ull;
@@ -66,7 +62,7 @@ int main(int argc, char *argv[])
chip_id = strtoul(optarg, NULL, 0);
break;
case 'v':
- printf("xscom utils version %s\n", VERSION_STR);
+ printf("xscom utils version %s\n", VERSION);
exit(1);
case 'h':
print_usage();