10000 all: Update Makefiles and others to build with new ports/ dir layout. · devmonkZA/micropython@4a93801 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a93801

Browse files
committed
all: Update Makefiles and others to build with new ports/ dir layout.
Also renames "stmhal" to "stm32" in documentation and everywhere else.
1 parent 01dd780 commit 4a93801

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+150
-161
lines changed

.gitattributes

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
# These should also not be modified by git.
1616
tests/basics/string_cr_conversion.py -text
1717
tests/basics/string_crlf_conversion.py -text
18-
stmhal/pybcdc.inf_template -text
19-
stmhal/usbd_* -text
20-
stmhal/boards/*/stm32f4xx_hal_conf.h -text
21-
stmhal/usbdev/** -text
22-
stmhal/usbhost/** -text
23-
cc3200/hal/aes.c -text
24-
cc3200/hal/aes.h -text
25-
cc3200/hal/des.c -text
26-
cc3200/hal/i2s.c -text
27-
cc3200/hal/i2s.h -text
28-
cc3200/version.h -text
2918
ports/stm32/pybcdc.inf_template -text
3019
ports/stm32/usbd_* -text
3120
ports/stm32/boards/*/stm32f4xx_hal_conf.h -text

.travis.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,40 +28,40 @@ before_script:
2828

2929
script:
3030
- make -C mpy-cross
31-
- make -C minimal CROSS=1 build/firmware.bin
32-
- ls -l minimal/build/firmware.bin
31+
- make -C ports/minimal CROSS=1 build/firmware.bin
32+
- ls -l ports/minimal/build/firmware.bin
3333
- tools/check_code_size.sh
3434
- mkdir -p ${HOME}/persist
3535
# Save new firmware for reference, but only if building a main branch, not a pull request
36-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp minimal/build/firmware.bin ${HOME}/persist/; fi'
37-
- make -C unix deplibs
38-
- make -C unix
39-
- make -C unix nanbox
40-
- make -C bare-arm
41-
- make -C qemu-arm test
42-
- make -C stmhal
43-
- make -C stmhal BOARD=PYBV11 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
44-
- make -C stmhal BOARD=STM32F769DISC
45-
- make -C stmhal BOARD=STM32L476DISC
46-
- make -C teensy
47-
- make -C cc3200 BTARGET=application BTYPE=release
48-
- make -C cc3200 BTARGET=bootloader BTYPE=release
49-
- make -C windows CROSS_COMPILE=i686-w64-mingw32-
36+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
37+
- make -C ports/unix deplibs
38+
- make -C ports/unix
39+
- make -C ports/unix nanbox
40+
- make -C ports/bare-arm
41+
- make -C ports/qemu-arm test
42+
- make -C ports/stm32
43+
- make -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
44+
- make -C ports/stm32 BOARD=STM32F769DISC
45+
- make -C ports/stm32 BOARD=STM32L476DISC
46+
- make -C ports/teensy
47+
- make -C ports/cc3200 BTARGET=application BTYPE=release
48+
- make -C ports/cc3200 BTARGET=bootloader BTYPE=release
49+
- make -C ports/windows CROSS_COMPILE=i686-w64-mingw32-
5050

5151
# run tests without coverage info
5252
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests)
5353
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests --emit native)
5454

5555
# run tests with coverage info
56-
- make -C unix coverage
57-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests)
58-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests -d thread)
59-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --emit native)
60-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --via-mpy -d basics float)
56+
- make -C ports/unix coverage
57+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
58+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
59+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
60+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)
6161

6262
# run coveralls coverage analysis (try to, even if some builds/tests failed)
63-
- (cd unix && coveralls --root .. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
63+
- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
6464

6565
after_failure:
6666
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
67-
- (grep "FAIL" qemu-arm/build/console.out)
67+
- (grep "FAIL" ports/qemu-arm/build/console.out)

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@ Major components in this repository:
3434
core library.
3535
- mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts
3636
into precompiled bytecode.
37-
- unix/ -- a version of MicroPython that runs on Unix.
38-
- stmhal/ -- a version of MicroPython that runs on the PyBoard and similar
37+
- ports/unix/ -- a version of MicroPython that runs on Unix.
38+
- ports/stm32/ -- a version of MicroPython that runs on the PyBoard and similar
3939
STM32 boards (using ST's Cube HAL drivers).
40-
- minimal/ -- a minimal MicroPython port. Start with this if you want
40+
- ports/minimal/ -- a minimal MicroPython port. Start with this if you want
4141
to port MicroPython to another microcontroller.
4242
- tests/ -- test framework and test scripts.
4343
- docs/ -- user documentation in Sphinx reStructuredText format. Rendered
4444
HTML documentation is available at http://docs.micropython.org (be sure
4545
to select needed board/port at the bottom left corner).
4646

4747
Additional components:
48-
- bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
48+
- ports/bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
4949
mostly to control code size.
50-
- teensy/ -- a version of MicroPython that runs on the Teensy 3.1
50+
- ports/teensy/ -- a version of MicroPython that runs on the Teensy 3.1
5151
(preliminary but functional).
52-
- pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
53-
- cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
54-
- esp8266/ -- an experimental port for ESP8266 WiFi modules.
52+
- ports/pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
53+
- ports/cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
54+
- ports/esp8266/ -- an experimental port for ESP8266 WiFi modules.
5555
- extmod/ -- additional (non-core) modules implemented in C.
5656
- tools/ -- various tools, including the pyboard.py module.
5757
- examples/ -- a few example Python scripts.
@@ -72,7 +72,7 @@ Alternatively, fallback implementation based on setjmp/longjmp can be used.
7272

7373
To build (see section below for required dependencies):
7474

75-
$ cd unix
75+
$ cd ports/unix
7676
$ make axtls
7777
$ make
7878

@@ -115,33 +115,33 @@ these additional dependencies, first fetch git submodules for them:
115115
$ git submodule update --init
116116

117117
Use this same command to get the latest versions of dependencies, as
118-
they are updated from time to time. After that, in `unix/` dir, execute:
118+
they are updated from time to time. After that, in `ports/unix/` dir, execute:
119119

120120
$ make deplibs
121121

122122
This will build all available dependencies (regardless whether they
123123
are used or not). If you intend to build MicroPython with additional
124124
options (like cross-compiling), the same set of options should be passed
125125
to `make deplibs`. To actually enabled use of dependencies, edit
126-
`unix/mpconfigport.mk` file, which has inline descriptions of the options.
126+
`ports/unix/mpconfigport.mk` file, which has inline descriptions of the options.
127127
For example, to build SSL module (required for `upip` tool described above),
128128
set `MICROPY_PY_USSL` to 1.
129129

130-
In `unix/mpconfigport.mk`, you can also disable some dependencies enabled
130+
In `ports/unix/mpconfigport.mk`, you can also disable some dependencies enabled
131131
by default, like FFI support, which requires libffi development files to
132132
be installed.
133133

134-
The STM version
135-
---------------
134+
The STM32 version
135+
-----------------
136136

137-
The "stmhal" port requires an ARM compiler, arm-none-eabi-gcc, and associated
137+
The "stm32" port requires an ARM compiler, arm-none-eabi-gcc, and associated
138138
bin-utils. For those using Arch Linux, you need arm-none-eabi-binutils and
139139
arm-none-eabi-gcc packages. Otherwise, try here:
140140
https://launchpad.net/gcc-arm-embedded
141141

142142
To build:
143143

144-
$ cd stmhal
144+
$ cd ports/stm32
145145
$ make
146146

147147
You then need to get your board into DFU mode. On the pyboard, connect the
@@ -155,4 +155,4 @@ Then to flash the code via USB DFU to your device:
155155
This will use the included `tools/pydfu.py` script. If flashing the firmware
156156
does not work it may be because you don't have the correct permissions, and
157157
need to use `sudo make deploy`.
158-
See the README.md file in the stmhal/ directory for further details.
158+
See the README.md file in the ports/stm32/ directory for further details.

docs/reference/constrained.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ After importing the modules, execute:
279279
280280
Then copy and paste all the Q(xxx) lines into a text editor. Check for and
281281
remove lines which are obviously invalid. Open the file qstrdefsport.h which
282-
will be found in stmhal (or the equivalent directory for the architecture in
282+
will be found in ports/stm32 (or the equivalent directory for the architecture in
283283
use). Copy and paste the corrected lines at the end of the file. Save the file,
284284
rebuild and flash the firmware. The outcome can be checked by importing the
285285
modules and again issuing:

examples/pins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Print a nice list of pins, their current settings, and available afs.
2-
# Requires pins_af.py from stmhal/build-PYBV10/ directory.
2+
# Requires pins_af.py from ports/stm32/build-PYBV10/ directory.
33

44
import pyb
55
import pins_af

extmod/modframebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
#if MICROPY_PY_FRAMEBUF
3535

36-
#include "stmhal/font_petme128_8x8.h"
36+
#include "ports/stm32/font_petme128_8x8.h"
3737

3838
typedef struct _mp_obj_framebuf_t {
3939
mp_obj_base_t base;

mpy-cross/Makefile

Lines changed: 1 addition & 1 deletion
Original file li 10000 ne numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ SRC_C = \
6565
# Add fmode when compiling with mingw gcc
6666
COMPILER_TARGET := $(shell $(CC) -dumpmachine)
6767
ifneq (,$(findstring mingw,$(COMPILER_TARGET)))
68-
SRC_C += windows/fmode.c
68+
SRC_C += ports/windows/fmode.c
6969
endif
7070

7171
OBJ = $(PY_O)

mpy-cross/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "py/gc.h"
3737
#include "py/stackctrl.h"
3838
#ifdef _WIN32
39-
#include "windows/fmode.h"
39+
#include "ports/windows/fmode.h"
4040
#endif
4141

4242
// Command line options, with their defaults

ports/bare-arm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include ../py/mkenv.mk
1+
include ../../py/mkenv.mk
22

33
# qstr definitions (must come before including py.mk)
44
QSTR_DEFS = qstrdefsport.h

ports/cc3200/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ PORT ?= /dev/ttyUSB1
1414
# If the build directory is not given, make it reflect the board name.
1515
BUILD ?= build/$(BOARD)/$(BTYPE)
1616

17-
include ../py/mkenv.mk
17+
include ../../py/mkenv.mk
1818
-include ../../localconfig.mk
1919

2020
CROSS_COMPILE ?= arm-none-eabi-

0 commit comments

Comments
 (0)
0