File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ QSTR_DEFS = qstrdefsport.h
14
14
# Include py core make definitions.
15
15
include $(TOP ) /py/py.mk
16
16
17
+ MP_VER_FILE = $(HEADER_BUILD ) /mpversion.h
17
18
MBIT_VER_FILE = $(HEADER_BUILD ) /microbitversion.h
18
19
19
20
LOCAL_LIB_DIR = ../../lib
@@ -115,8 +116,11 @@ QSTR_GLOBAL_REQUIREMENTS += $(MBIT_VER_FILE)
115
116
all : lib $(MBIT_VER_FILE )
116
117
117
118
# Rule to build header with micro:bit specific version information.
119
+ # Also rebuild MicroPython version header in correct directory to pick up git hash.
118
120
$(MBIT_VER_FILE ) : FORCE
119
- $(PYTHON ) $(TOP ) /py/makeversionhdr.py $(MBIT_VER_FILE )
121
+ (cd $( TOP) && $( PYTHON) py/makeversionhdr.py $( abspath $( MP_VER_FILE) ) )
122
+ $(PYTHON ) $(TOP ) /py/makeversionhdr.py $(MBIT_VER_FILE ) .pre
123
+ $(CAT ) $(MBIT_VER_FILE ) .pre | $(SED ) s/MICROPY_/MICROBIT_/ > $(MBIT_VER_FILE )
120
124
121
125
include $(TOP ) /py/mkrules.mk
122
126
Original file line number Diff line number Diff line change 29
29
#include "py/objstr.h"
30
30
#include "ports/nrf/modules/uos/microbitfs.h"
31
31
32
- // The microbitversion.h file is generated with the same tool as mpversion.h and
33
- // defines MICROPY_xxx symbols, so rename them.
34
- #include "genhdr/microbitversion.h"
35
- #define MICROBIT_GIT_HASH MICROPY_GIT_HASH
36
- #define MICROBIT_BUILD_DATE MICROPY_BUILD_DATE
37
- #undef MICROPY_GIT_TAG
38
- #undef MICROPY_GIT_HASH
39
- #undef MICROPY_BUILD_DATE
40
-
41
- // Include MicroPython version information.
32
+ // Include MicroPython and micro:bit version information.
42
33
#include "genhdr/mpversion.h"
34
+ #include "genhdr/microbitversion.h"
43
35
44
36
#define MICROBIT_VERSION \
45
37
"micro:bit v" MICROBIT_RELEASE "+" MICROBIT_GIT_HASH " on " MICROBIT_BUILD_DATE \
You can’t perform that action at this time.
0 commit comments