aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-10 09:27:00 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-10 09:27:00 +0200
commit83d80ad1e20160b812717018d895a7d7c3f74b5b (patch)
tree34d15d075689bb9cb00818efcaf875fa1ea626d8
parentd00e0f20cbc214b6c7c3221f05f79c78ba7b9de3 (diff)
add build number to makefile
-rw-r--r--robot/makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/robot/makefile b/robot/makefile
index e4366d8..8ddcb28 100644
--- a/robot/makefile
+++ b/robot/makefile
@@ -18,6 +18,9 @@ AVRDUDE=avrdude
CC=avr-gcc
OBJ2HEX=avr-objcopy
+BUILD_STR=$(shell git update-index -q --refresh; git describe --tags --dirty='*' --broken='x' | cut -c1-20)
+CFLAGS += -DBUILD_STR="$(BUILD_STR)"
+
all: out.hex
clean:
@@ -31,6 +34,7 @@ a.out: $(OBJECTS)
out.hex: a.out
$(OBJ2HEX) -R .eeprom -O ihex $< $@
+ $(info build $(BUILD_STR) complete)
flash: out.hex
$(AVRDUDE) -p $(AVRDUDE_DEVICE) -c avrisp2 -P $(PORT) -U flash:w:out.hex