Skip to content

Commit bada8c9

Browse files
stinosdpgeorge
authored andcommitted
windows: Update build instructions in README.
Make the instructions more complete by documenting all needed steps for starting from scratch. Also add a section for MSYS2 since the Travis build uses it as well and it's a good alternative for Cygwin. Remove the mingw32 reference since it's not readily available anymore in most Linux distros nor compiles successfully.
1 parent 71adf50 commit bada8c9

File tree

1 file changed

+50
-10
lines changed

1 file changed

+50
-10
lines changed

ports/windows/README.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,73 @@ It is based on Unix port, and expected to remain so.
33
The port requires additional testing, debugging, and patches. Please
44
consider to contribute.
55

6+
All gcc-based builds use the gcc compiler from [Mingw-w64](mingw-w64.org),
7+
which is the advancement of the original mingw project. The latter is
8+
getting obsolete and is not actively supported by MicroPython.
9+
10+
Build instruction assume you're in the ports/windows directory.
611

712
Building on Debian/Ubuntu Linux system
813
---------------------------------------
914

10-
sudo apt-get install gcc-mingw-w64
15+
sudo apt-get install python3 build-essential gcc-mingw-w64
16+
make -C ../../mpy-cross
1117
make CROSS_COMPILE=i686-w64-mingw32-
1218

13-
If for some reason the mingw-w64 crosscompiler is not available, you can try
14-
mingw32 instead, but it comes with a really old gcc which may produce some
15-
spurious errors (you may need to disable -Werror):
16-
17-
sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
18-
make CROSS_COMPILE=i586-mingw32msvc-
19-
2019

2120
Building under Cygwin
2221
---------------------
2322

24-
Install following packages using cygwin's setup.exe:
23+
Install Cygwin, then install following packages using Cygwin's setup.exe:
2524

2625
* mingw64-i686-gcc-core
2726
* mingw64-x86_64-gcc-core
2827
* make
2928

29+
Also install the python3 package, or install Python globally for Windows (see below).
30+
3031
Build using:
3132

33+
make -C ../../mpy-cross CROSS_COMPILE=i686-w64-mingw32-
3234
make CROSS_COMPILE=i686-w64-mingw32-
3335

3436
Or for 64bit:
3537

38+
make -C ../../mpy-cross CROSS_COMPILE=x86_64-w64-mingw32-
3639
make CROSS_COMPILE=x86_64-w64-mingw32-
3740

3841

42+
Building under MSYS2
43+
--------------------
44+
45+
Install MSYS2 from http://repo.msys2.org/distrib, start the msys2.exe shell and
46+
install the build tools:
47+
48+
pacman -Syuu
49+
pacman -S make mingw-w64-x86_64-gcc pkg-config python3
50+
51+
Start the mingw64.exe shell and build:
52+
53+
make -C ../../mpy-cross STRIP=echo SIZE=echo
54+
make
55+
56+
3957
Building using MS Visual Studio 2013 (or higher)
4058
------------------------------------------------
4159

42-
In the IDE, open `micropython.vcxproj` and build.
60+
Install Python. There are several ways to do this, for example: download and install the
61+
latest Python 3 release from https://www.python.org/downloads/windows or from
62+
https://docs.conda.io/en/latest/miniconda.html,
63+
or open the Microsoft Store app and search for Python and install it.
64+
65+
Install Visual Studio and the C++ toolset (for recent versions: install
66+
the free Visual Studio Community edition and the *Desktop development with C++* workload).
67+
68+
In the IDE, open `micropython-cross.vcxproj` and `micropython.vcxproj` and build.
4369

4470
To build from the command line:
4571

72+
msbuild ../../mpy-cross/mpy-cross.vcxproj
4673
msbuild micropython.vcxproj
4774

4875
__Stack usage__
@@ -57,6 +84,19 @@ There are several ways to deal with this:
5784
See [issue 2927](https://github.com/micropython/micropython/issues/2927) for more information.
5885

5986

87+
Running the tests
88+
-----------------
89+
90+
This is similar for all ports:
91+
92+
cd ../../tests
93+
python3 ./run-tests
94+
95+
Depending on the combination of platform and Python version used it might be
96+
needed to first set the MICROPY_MICROPYTHON environment variable to
97+
the full path of micropython.exe.
98+
99+
60100
Running on Linux using Wine
61101
---------------------------
62102

0 commit comments

Comments
 (0)