Skip to content

Commit 408b74d

Browse files
committed
py: Allow to to build MicroPython as a static library.
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.
1 parent fdfcee7 commit 408b74d

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

py/mkenv.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ LD = $(CROSS_COMPILE)ld
5151
OBJCOPY = $(CROSS_COMPILE)objcopy
5252
SIZE = $(CROSS_COMPILE)size
5353
STRIP = $(CROSS_COMPILE)strip
54+
AR = $(CROSS_COMPILE)ar
5455
ifeq ($(MICROPY_FORCE_32BIT),1)
5556
CC += -m32
5657
CXX += -m32

py/mkrules.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ ifndef DEBUG
8787
endif
8888
$(Q)$(SIZE) $(PROG)
8989

90+
lib: $(OBJ)
91+
$(AR) rcs libmicropython.a $(OBJ)
92+
9093
clean: clean-prog
9194
clean-prog:
9295
$(RM) -f $(PROG)

0 commit comments

Comments
 (0)