diff Makefile @ 45:a0f2fcc6d9dd

add buildid
author Matt Johnston <matt@ucc.asn.au>
date Sat, 29 Jun 2013 23:46:39 +0800
parents d07aa7644c66
children
line wrap: on
line diff
--- a/Makefile	Sat Jun 29 23:46:35 2013 +0800
+++ b/Makefile	Sat Jun 29 23:46:39 2013 +0800
@@ -25,7 +25,7 @@
 SOURCE_1WIRE = onewire.c simple_ds18b20.c crc8.c
 SOURCE_CRYPTO = hmac-sha1.c sha1-asm.S aes.c
 SOURCE_SD = byteordering.c fat.c  partition.c sd_raw.c 
-SOURCE    = main.c
+SOURCE    = main.c buildid.c
 SOURCE += $(SOURCE_CRYPTO) $(SOURCE_SD)
 LIBS       = 
 BOOTLOADER_HEX = ATmegaBOOT_168_pihelp.hex
@@ -97,6 +97,12 @@
 # symbolic targets:
 all:	main.hex
 
+.PHONY: buildid.c
+
+buildid.c:
+	echo "#include \"buildid.h\"" > $@
+	echo "uint8_t buildid[20] = { `dd if=/dev/urandom bs=20 count=1 2> /dev/null | hexdump -e '20/1 "0x%02x, "' ` };" >> $@
+
 .c.o:
 	$(COMPILE) -c $< -o $@