aboutsummaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-05-22 13:52:58 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-01 17:15:56 +1000
commitd531b2660a7f66131eec337b6b72c554007f178c (patch)
tree266b6eb37da5b4bc4189d5fe073a86fab5dcd360 /external
parentd67d71873b1d5dc25120e88bf3cbe4d170dac81b (diff)
downloadskiboot-d531b2660a7f66131eec337b6b72c554007f178c.zip
skiboot-d531b2660a7f66131eec337b6b72c554007f178c.tar.gz
skiboot-d531b2660a7f66131eec337b6b72c554007f178c.tar.bz2
pflash: Use git tag versioning from make_version.sh
In order to be able to create distribution tarballs of pflash there needs to be some saneish versioning scheme. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external')
-rw-r--r--external/pflash/Makefile20
-rw-r--r--external/pflash/pflash.c5
2 files changed, 21 insertions, 4 deletions
diff --git a/external/pflash/Makefile b/external/pflash/Makefile
index f951a58..73f5ed6 100644
--- a/external/pflash/Makefile
+++ b/external/pflash/Makefile
@@ -12,7 +12,7 @@ endif
CFLAGS = -O2 -Wall -I.
LDFLAGS = -lrt
-OBJS = pflash.o progress.o ast-sf-ctrl.o
+OBJS = pflash.o progress.o ast-sf-ctrl.o version.o
OBJS += libflash/libflash.o libflash/libffs.o libflash/ecc.o
OBJS += $(ARCH_OBJS)
EXE = pflash
@@ -30,6 +30,22 @@ links:
ln -sf ../../ccan .
ln -sf ../../hw/sfc-ctrl.c .
ln -sf ../../hw/ast-bmc/ast-sf-ctrl.c
+ ln -sf ../../make_version.sh
+
+PFLASH_VERSION ?= $(shell ./make_version.sh $(EXE))
+
+.PHONY: VERSION-always
+.version: VERSION-always
+ @echo $(PFLASH_VERSION) > $@.tmp
+ @cmp -s $@ $@.tmp || cp $@.tmp $@
+ @rm -f $@.tmp
+
+version.c: make_version.sh .version
+ @(if [ "a$(PFLASH_VERSION)" = "a" ]; then \
+ echo "#error You need to set SKIBOOT_VERSION environment variable" > $@ ;\
+ else \
+ echo "const char version[] = \"$(PFLASH_VERSION)\";" ;\
+ fi) > $@
$(OBJS) : links
@@ -40,4 +56,4 @@ clean:
rm -f $(OBJS) $(EXE) *.o *.d libflash/test/test_flash libflash/test/*.o
distclean: clean
rm -f *.c~ *.h~ *.sh~ Makefile~ config.mk~ libflash/*.c~ libflash/*.h~
- rm -f libflash ccan sfc-ctrl.c ast-sf-ctrl.c
+ rm -f libflash ccan sfc-ctrl.c ast-sf-ctrl.c .version .version.tmp
diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index fb783a2..6a6f284 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -23,7 +23,8 @@
#define __aligned(x) __attribute__((aligned(x)))
-#define PFLASH_VERSION "0.8.6"
+/* Full pflash version number (possibly includes gitid). */
+extern const char version[];
static bool must_confirm = true;
static bool dummy_run;
@@ -437,7 +438,7 @@ static void flash_access_setup_pnor(bool use_lpc, bool use_sfc, bool need_write)
static void print_version(void)
{
- printf("Palmetto Flash tool " PFLASH_VERSION "\n");
+ printf("Open-Power Flash tool %s\n", version);
}
static void print_help(const char *pname)