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
1414# Include py core make definitions.
1515include $(TOP ) /py/py.mk
1616
17+ MP_VER_FILE = $(HEADER_BUILD ) /mpversion.h
1718MBIT_VER_FILE = $(HEADER_BUILD ) /microbitversion.h
1819
1920LOCAL_LIB_DIR = ../../lib
@@ -115,8 +116,11 @@ QSTR_GLOBAL_REQUIREMENTS += $(MBIT_VER_FILE)
115116all : lib $(MBIT_VER_FILE )
116117
117118# Rule to build header with micro:bit specific version information.
119+ # Also rebuild MicroPython version header in correct directory to pick up git hash.
118120$(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 )
120124
121125include $(TOP ) /py/mkrules.mk
122126
Original file line number Diff line number Diff line change 2929#include "py/objstr.h"
3030#include "ports/nrf/modules/uos/microbitfs.h"
3131
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.
4233#include "genhdr/mpversion.h"
34+ #include "genhdr/microbitversion.h"
4335
4436#define MICROBIT_VERSION \
4537 "micro:bit v" MICROBIT_RELEASE "+" MICROBIT_GIT_HASH " on " MICROBIT_BUILD_DATE \
You can’t perform that action at this time.
0 commit comments