File tree 2 files changed +15
-11
lines changed
2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,13 @@ recover: obj/bootstub.bin obj/$(PROJ_NAME).bin
30
30
$(DFU_UTIL ) -d 0483:df11 -a 0 -s 0x08004000 -D obj/$(PROJ_NAME ) .bin
31
31
$(DFU_UTIL ) -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.bin
32
32
33
+ include ../../common/version.mk
34
+
33
35
obj/main.o : main.c ../* .h
34
36
mkdir -p obj
35
37
$(CC ) $(CFLAGS ) -o $@ -c $<
36
38
37
- obj/bootstub.o : ../bootstub.c ../* .h
39
+ obj/bootstub.o : ../bootstub.c ../* .h obj/gitversion.h
38
40
mkdir -p obj
39
41
$(CC ) $(CFLAGS ) -o $@ -c $<
40
42
Original file line number Diff line number Diff line change 1
1
ifeq ($(RELEASE ) ,1)
2
- BUILD_TYPE = "RELEASE"
2
+ BUILD_TYPE = "RELEASE"
3
3
else
4
- BUILD_TYPE = "DEBUG"
4
+ BUILD_TYPE = "DEBUG"
5
5
endif
6
6
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) \" ;" > $@
10
12
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) \" ;" > $@
14
16
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) \" ;" > $@
17
19
endif
18
20
endif
You can’t perform that action at this time.
0 commit comments