aboutsummaryrefslogtreecommitdiff
path: root/py/mkenv.mk
AgeCommit message (Collapse)Author
2021-08-07py/mkrules: Automatically build mpy-cross if it doesn't exist.Damien George
Commit 41739506589ec8397613c86d8f682fb7f86c0a9f removed automatic building of mpy-cross, which rebuilt it whenever any of its dependent source files changed. But needing to build mpy-cross, and not knowing how, is a frequent issue. This commit aims to help by automatically building mpy-cross only if it doesn't exist. For Makefiles it uses an order-only prerequisite, while for CMake it uses a custom command. If MICROPY_MPYCROSS (which is what makemanifest.py uses to locate the mpy-cross executable) is defined in the environment then automatic build will not be attempted, allowing a way to prevent this auto-build if needed. Thanks to Trammell Hudson aka @osresearch for the original idea; see #5760. Signed-off-by: Damien George <damien@micropython.org>
2021-05-12py/mkenv.mk: Don't emit info about BUILD_VERBOSE if it's set.Damien George
If the user sets V or BUILD_VERBOSE then they don't need to see this message. Signed-off-by: Damien George <damien@micropython.org>
2020-01-12py/mkenv.mk: Move usage of 32-bit flags to py.mk.Jim Mussared
This allows ports/variants to configure MICROPY_FORCE_32BIT after including mkenv.mk, but before py.mk.
2019-10-21tools/makemanifest.py: Eval relative paths w.r.t. current manifest file.Jim Mussared
When loading a manifest file, e.g. by include(), it will chdir first to the directory of that manifest. This means that all file operations within a manifest are relative to that manifest's location. As a consequence of this, additional environment variables are needed to find absolute paths, so the following are added: $(MPY_LIB_DIR), $(PORT_DIR), $(BOARD_DIR). And rename $(MPY) to $(MPY_DIR) to be consistent. Existing manifests are updated to match.
2019-10-15tools: Add mechanism to provide a manifest of frozen files.Damien George
This introduces a new build variable FROZEN_MANIFEST which can be set to a manifest listing (written in Python) that describes the set of files to be frozen in to the firmware.
2019-09-05py/mkenv.mk: Add GDB variable.Damien George
2019-05-22py: Update makefiles to use $(TOUCH) instead of hard coded "touch".Sebastien Rinsoz
The variable $(TOUCH) is initialized with the "touch" value in mkenv.mk like for the other command line tools (rm, echo, cp, mkdir etc). With this, for example, Windows users can specify the path of touch.exe.
2019-05-21py: Update makefiles to use $(CAT) variable instead of hard coded "cat".Sébastien Rinsoz
The variable $(CAT) is initialised with the "cat" value in mkenv.mk like for the other command line tools (rm, echo, cp, mkdir etc). With this, for example, Windows users can specify the path of cat.exe.
2019-03-08py: Update and rework build system for including external C modules.Andrew Leech
How to use this feature is documented in docs/develop/cmodules.rst.
2019-03-08py: Implement a module system for external, user C modules.Ayke van Laethem
This system makes it a lot easier to include external libraries as static, native modules in MicroPython. Simply pass USER_C_MODULES (like FROZEN_MPY_DIR) as a make parameter.
2019-02-12py/mkenv.mk: Change default PYTHON variable from "python" to "python3".Damien George
This change makes it so that python3 is required by default to build MicroPython. Python 2 can be used by specifying make PYTHON=python2. This comes about due to a recent-ish change to PEP 394 that makes the python command more optional than before (even with Python 2 installed); see https://github.com/python/peps/commit/cd59ec03c8ff1e75089d5872520cd0706774b35b#diff-1d22f7bd72cbc900670f058b1107d426 Since the command python is no longer required to be provided by a distribution we need to use either python2 or python3 as commands. And python3 seems the obvious choice.
2017-11-15py/mkenv.mk: Use $(PYTHON) consistently when calling Python tools.Christopher Arndt
Rationale: * Calling Python build tool scripts from makefiles should be done consistently using `python </path/to/script>`, instead of relying on the correct she-bang line in the script [1] and the executable bit on the script being set. This is more platform-independent. * The name/path of the Python executable should always be used via the makefile variable `PYTHON` set in `py/mkenv.mk`. This way it can be easily overwritten by the user with `make PYTHON=/path/to/my/python`. * The Python executable name should be part of the value of the makefile variable, which stands for the build tool command (e.g. `MAKE_FROZEN` and `MPY_TOOL`), not part of the command line where it is used. If a Python tool is substituted by another (non-python) program, no change to the Makefiles is necessary, except in `py/mkenv.mk`. * This also solves #3369 and #1616. [1] There are systems, where even the assumption that `/usr/bin/env` always exists, doesn't hold true, for example on Android (where otherwise the unix port compiles perfectly well).
2017-10-31Revert "py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files."Damien George
This reverts commit 3289b9b7a76a1230b6bb631e191a47bfc6c7a8ee. The commit broke building on MINGW because the filename became micropython.exe.exe. A proper solution to support more Windows build environments requires more thought and testing.
2017-10-04py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files.chrismas9
Building mpy-cross: this patch adds .exe to the PROG name when building executables for host (eg mpy-cross) on Windows. make clean now removes mpy-cross.exe under Windows. Building MicroPython: this patch sets MPY_CROSS to mpy-cross.exe or mpy-cross so they can coexist and use cygwin or WSL without rebuilding mpy-cross. The dependency in the mpy rule now uses mpy-cross.exe for Windows and mpy-cross for Linux.
2017-05-29various: Spelling fixesVille Skyttä
2017-05-19py/mkenv.mk: Use $(TOP) instead of ".." to reference tools, mpy-cross.Damien George
2016-11-08py: Move frozen bytecode Makefile rules from ports to common mk files.Damien George
Now, to use frozen bytecode all a port needs to do is define FROZEN_MPY_DIR to the directory containing the .py files to freeze, and define MICROPY_MODULE_FROZEN_MPY and MICROPY_QSTR_EXTRA_POOL.
2016-09-17py: Move frozen modules rules from esp8266 port for reuse across ports.Paul Sokolovsky
A port now just needs to define FROZEN_DIR var and add $(BUILD)/frozen.c to SRC_C to support frozen modules.
2016-04-21py/mkenv.mk: Remove -s and -S args from PYTHON variable.Damien George
Qstr auto-generation is now much faster so this optimisation for start-up time is no longer needed. And passing "-s -S" breaks some things, like stmhal's "make deploy".
2016-04-17py/mkenv.mk: Optimize Python startup type during make process.Paul Sokolovsky
By skipping loading site.py, etc.
2015-10-12py: Allow to to build MicroPython as a static library.Paul Sokolovsky
The whole current port gets slurped into a static lib named "libmicropython.a". Maybe that's not ideal, but at least something to start with.
2015-08-29py: Treat -m32 flag as part of CC, LD, etc.Paul Sokolovsky
Indeed, this flag efectively selects architecture target, and must consistently apply to all compiles and links, including 3rd-party libraries, unlike CFLAGS, which have MicroPython-specific setting.
2014-06-07py, mk: Revert change where build variables set with ?=.Damien George
?= operator does not do delayed expansion (unlike =).
2014-06-07- Let the build environment decide about the toolchain to be used, in caseMarcus von Appen
there are special tweaks and paths to be considered. Just provide some defaults, in case the values are undefined. - py-version.sh does not need any bash specific features. - Use libdl only on Linux for now. FreeBSD provides dl*() calls from libc.
2014-04-16Have make remove targets if a recipie fails.Dave Hylands
2014-04-07Replace some Makefile commands with variables in py/mkenv.mkAndrew Scheller
2014-01-24Rework makefiles. Add proper dependency checking.Dave Hylands