Skip to content

Commit c118b5d

Browse files
dlechdpgeorge
authored andcommitted
extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk.
This separates extmod source files from `py.mk`. Previously, `py.mk` assumed that every consumer of the py/ directory also wanted to include extmod/. However, this is not the case. For example, building mpy-cross uses py/ but doesn't need extmod/. This commit moves all extmod-specific items from `py.mk` to `extmod.mk` and explicitly includes `extmod.mk` in ports that use it. Signed-off-by: David Lechner <[email protected]>
1 parent 4802b6d commit c118b5d

File tree

18 files changed

+70
-52
lines changed

18 files changed

+70
-52
lines changed

docs/develop/porting.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ We also need a Makefile at this point for the port:
9595
9696
# Include py core make definitions.
9797
include $(TOP)/py/py.mk
98+
include $(TOP)/extmod/extmod.mk
9899
99100
# Set CFLAGS and libraries.
100101
CFLAGS = -I. -I$(BUILD) -I$(TOP)

examples/embedding/Makefile.upylib

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ UNAME_S := $(shell uname -s)
99

1010
# include py core make definitions
1111
include $(MPTOP)/py/py.mk
12+
include $(MPTOP)/extmod/extmod.mk
1213

1314
INC += -I.
1415
INC += -I..

extmod/extmod.mk

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,55 @@
1-
# This makefile fragment provides rules to build 3rd-party components for extmod modules
1+
# This makefile fragment adds the source code files for the core extmod modules
2+
# and provides rules to build 3rd-party components for extmod modules.
3+
4+
PY_EXTMOD_O_BASENAME = \
5+
extmod/moduasyncio.o \
6+
extmod/moductypes.o \
7+
extmod/modujson.o \
8+
extmod/moduos.o \
9+
extmod/modure.o \
10+
extmod/moduzlib.o \
11+
extmod/moduheapq.o \
12+
extmod/modutimeq.o \
13+
extmod/moduhashlib.o \
14+
extmod/moducryptolib.o \
15+
extmod/modubinascii.o \
16+
extmod/virtpin.o \
17+
extmod/machine_bitstream.o \
18+
extmod/machine_mem.o \
19+
extmod/machine_pinbase.o \
20+
extmod/machine_signal.o \
21+
extmod/machine_pulse.o \
22+
extmod/machine_pwm.o \
23+
extmod/machine_i2c.o \
24+
extmod/machine_spi.o \
25+
extmod/modbluetooth.o \
26+
extmod/modlwip.o \
27+
extmod/modussl_axtls.o \
28+
extmod/modussl_mbedtls.o \
29+
extmod/moduplatform.o\
30+
extmod/modurandom.o \
31+
extmod/moduselect.o \
32+
extmod/moduwebsocket.o \
33+
extmod/modwebrepl.o \
34+
extmod/modframebuf.o \
35+
extmod/vfs.o \
36+
extmod/vfs_blockdev.o \
37+
extmod/vfs_reader.o \
38+
extmod/vfs_posix.o \
39+
extmod/vfs_posix_file.o \
40+
extmod/vfs_fat.o \
41+
extmod/vfs_fat_diskio.o \
42+
extmod/vfs_fat_file.o \
43+
extmod/vfs_lfs.o \
44+
extmod/utime_mphal.o \
45+
extmod/uos_dupterm.o \
46+
shared/libc/abort_.o \
47+
shared/libc/printf.o \
48+
49+
PY_EXTMOD_O = $(addprefix $(BUILD)/, $(PY_EXTMOD_O_BASENAME))
50+
51+
PY_O += $(PY_EXTMOD_O)
52+
SRC_QSTR += $(PY_EXTMOD_O_BASENAME:.o=.c)
253

354
################################################################################
455
# VFS FAT FS

ports/cc3200/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ MICROPY_ROM_TEXT_COMPRESSION ?= 1
3939

4040
# include MicroPython make definitions
4141
include $(TOP)/py/py.mk
42+
include $(TOP)/extmod/extmod.mk
4243
include application.mk
4344
else
4445
ifeq ($(BTARGET), bootloader)

ports/esp8266/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ FROZEN_MANIFEST ?= boards/manifest.py
3030

3131
# include py core make definitions
3232
include $(TOP)/py/py.mk
33+
include $(TOP)/extmod/extmod.mk
3334

3435
GIT_SUBMODULES = lib/axtls lib/berkeley-db-1.xx
3536

ports/javascript/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CROSS = 0
55
QSTR_DEFS = qstrdefsport.h
66

77
include $(TOP)/py/py.mk
8+
include $(TOP)/extmod/extmod.mk
89

910
CC = emcc
1011
LD = emcc

ports/mimxrt/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ MICROPY_VFS_FAT ?= 1
4242

4343
# Include py core make definitions
4444
include $(TOP)/py/py.mk
45+
include $(TOP)/extmod/extmod.mk
4546

4647
GIT_SUBMODULES = lib/tinyusb lib/nxp_driver lib/lwip lib/mbedtls
4748

ports/nrf/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ FROZEN_MANIFEST ?= modules/manifest.py
5656

5757
# include py core make definitions
5858
include ../../py/py.mk
59+
include ../../extmod/extmod.mk
5960

6061
GIT_SUBMODULES = lib/nrfx lib/tinyusb
6162

ports/pic16bit/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ QSTR_DEFS = qstrdefsport.h
55

66
# include py core make definitions
77
include $(TOP)/py/py.mk
8+
include $(TOP)/extmod/extmod.mk
89

910
XCVERSION ?= 1.35
1011
XC16 ?= /opt/microchip/xc16/v$(XCVERSION)

ports/powerpc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ QSTR_DEFS = qstrdefsport.h
55

66
# include py core make definitions
77
include $(TOP)/py/py.mk
8+
include $(TOP)/extmod/extmod.mk
89

910
# potato or lpc_serial
1011
UART ?= potato

0 commit comments

Comments
 (0)