generate flash.data.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 3 Oct 2017 04:50:51 +0000 (13:50 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 3 Oct 2017 04:50:51 +0000 (13:50 +0900)
ChangeLog
src/Makefile

index 8a24f1c..5e0493a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-10-03  NIIBE Yutaka  <gniibe@fsij.org>
 
+       * src/Makefile (build/flash.data): Generate.
+
        * src/main.c (flash_addr_key_storage_start)
        (flash_addr_data_storage_start): New.
        (main): Determine flash address.
index da36faa..1e21543 100644 (file)
@@ -75,3 +75,14 @@ build/bignum.o: OPT = -O3 -g
 distclean: clean
        -rm -f gnuk.ld config.h board.h config.mk \
               usb-strings.c.inc usb-vid-pid-ver.c.inc
+
+ifneq ($(EMULATION),)
+build/flash.data: Makefile
+       @echo 'Generating 8192-byte flash.data'
+       @/bin/echo -n -e '\xff\xff\xff\xff\xff\xff\xff\xff' >$@
+       @for i in $(shell seq 511); \
+          do /bin/echo -n -e '\xff\xff\xff\xff\xff\xff\xff\xff' >>$@; done
+       @/bin/echo -n -e '\x00\x00\xff\xff\xff\xff\xff\xff' >>$@
+       @for i in $(shell seq 511); \
+          do /bin/echo -n -e '\xff\xff\xff\xff\xff\xff\xff\xff' >>$@; done
+endif