Skip to content

Commit f5817e6

Browse files
committed
Fix Pedal bootstub version
1 parent c00fe86 commit f5817e6

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

board/pedal/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ recover: obj/bootstub.bin obj/$(PROJ_NAME).bin
3030
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08004000 -D obj/$(PROJ_NAME).bin
3131
$(DFU_UTIL) -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.bin
3232

33+
include ../../common/version.mk
34+
3335
obj/main.o: main.c ../*.h
3436
mkdir -p obj
3537
$(CC) $(CFLAGS) -o $@ -c $<
3638

37-
obj/bootstub.o: ../bootstub.c ../*.h
39+
obj/bootstub.o: ../bootstub.c ../*.h obj/gitversion.h
3840
mkdir -p obj
3941
$(CC) $(CFLAGS) -o $@ -c $<
4042

common/version.mk

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
ifeq ($(RELEASE),1)
2-
BUILD_TYPE = "RELEASE"
2+
BUILD_TYPE = "RELEASE"
33
else
4-
BUILD_TYPE = "DEBUG"
4+
BUILD_TYPE = "DEBUG"
55
endif
66

7-
ifneq ($(wildcard ../.git/HEAD),)
8-
obj/gitversion.h: ../VERSION ../.git/HEAD ../.git/index
9-
echo "const uint8_t gitversion[] = \"$(shell cat ../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
7+
SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
8+
9+
ifneq ($(wildcard $(SELF_DIR)/../.git/HEAD),)
10+
obj/gitversion.h: $(SELF_DIR)/../VERSION $(SELF_DIR)/../.git/HEAD $(SELF_DIR)/../.git/index
11+
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
1012
else
11-
ifneq ($(wildcard ../../.git/modules/panda/HEAD),)
12-
obj/gitversion.h: ../VERSION ../../.git/modules/panda/HEAD ../../.git/modules/panda/index
13-
echo "const uint8_t gitversion[] = \"$(shell cat ../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
13+
ifneq ($(wildcard $(SELF_DIR)/../../.git/modules/panda/HEAD),)
14+
obj/gitversion.h: $(SELF_DIR)/../VERSION $(SELF_DIR)/../../.git/modules/panda/HEAD $(SELF_DIR)/../../.git/modules/panda/index
15+
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-$(shell git rev-parse --short=8 HEAD)-$(BUILD_TYPE)\";" > $@
1416
else
15-
obj/gitversion.h: ../VERSION
16-
echo "const uint8_t gitversion[] = \"$(shell cat ../VERSION)-$(BUILDER)-unknown-$(BUILD_TYPE)\";" > $@
17+
obj/gitversion.h: $(SELF_DIR)/../VERSION
18+
echo "const uint8_t gitversion[] = \"$(shell cat $(SELF_DIR)/../VERSION)-$(BUILDER)-unknown-$(BUILD_TYPE)\";" > $@
1719
endif
1820
endif

0 commit comments

Comments
 (0)