diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-10-29 04:08:49 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-29 23:37:45 +0000 |
commit | b1422de12f0f0556c845ab029c5077d9a69a8314 (patch) | |
tree | 349f4cc89b0872e3a0e0d1dcdeaf9231e83a886d /py/mpconfig.h | |
parent | 49c47da8046e46348d43037c3a41059180eb280f (diff) | |
download | micropython-b1422de12f0f0556c845ab029c5077d9a69a8314.tar.gz micropython-b1422de12f0f0556c845ab029c5077d9a69a8314.zip |
py: Allow to override port config file and thus have >1 configs per port.
Use it like:
make CFLAGS_EXTRA='-DMP_CONFIGFILE="<mpconfigport_my.h>"'
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index b9e87fc012..6f92f3d88b 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -25,10 +25,23 @@ */ // This file contains default configuration settings for MicroPython. -// You can override any of these options using mpconfigport.h file located -// in a directory of your port. - +// You can override any of the options below using mpconfigport.h file +// located in a directory of your port. + +// mpconfigport.h is a file containing configuration settings for a +// particular port. mpconfigport.h is actually a default name for +// such config, and it can be overriden using MP_CONFIGFILE preprocessor +// define (you can do that by passing CFLAGS_EXTRA='-DMP_CONFIGFILE="<file.h>"' +// argument to make when using standard MicroPython makefiles). +// This is useful to have more than one config per port, for example, +// release vs debug configs, etc. Note that if you switch from one config +// to another, you must rebuild from scratch using "-B" switch to make. + +#ifdef MP_CONFIGFILE +#include MP_CONFIGFILE +#else #include <mpconfigport.h> +#endif // Any options not explicitly set in mpconfigport.h will get default // values below. |