Skip to content

ports/libmicropython: Implement a static library "port". #5964

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,12 @@ jobs:
script:
- make ${MAKEOPTS} -C ports/powerpc UART=potato
- make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial

# libmicropython via examples/embedding
- stage: test
env: NAME="examples/embedding build"
install:
- gcc --version
- python3 --version
script:
- make ${MAKEOPTS} -C examples/embedding
1 change: 1 addition & 0 deletions examples/embedding/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello-embed
51 changes: 45 additions & 6 deletions examples/embedding/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
MPTOP = ../..
CFLAGS = -std=c99 -I. -I$(MPTOP) -DNO_QSTR
LDFLAGS = -L.
MICROPY_TOP ?= ../..

hello-embed: hello-embed.o -lmicropython
# Get the absolute path to the directory (so that all paths passed to
# libmicropython build can be absolute).
ABS_PATH = $(realpath .)

-lmicropython:
$(MAKE) -f $(MPTOP)/examples/embedding/Makefile.upylib MPTOP=$(MPTOP)
LIBMICROPYTHON_PORT=$(MICROPY_TOP)/ports/libmicropython
LIBMICROPYTHON_BUILD=$(ABS_PATH)/build-libmicropython
LIBMICROPYTHON_A=$(LIBMICROPYTHON_BUILD)/libmicropython.a

CFLAGS = -std=c99

# For mpconfigport.h libmicropython headers.
INC += -I$(LIBMICROPYTHON_PORT)

# For generated headers from the libmicropython build.
INC += -I$(LIBMICROPYTHON_BUILD)

# For all MicroPython headers.
INC += -I$(MICROPY_TOP)

CFLAGS += $(INC)

hello-embed: hello-embed.o $(LIBMICROPYTHON_A)

hello-embed.o: $(LIBMICROPYTHON_A)

V ?= 0

# Overrides:
# BUILD to set the directory for compile artifacts.
# LIBMICROPYTHON to set the output path for libmicropython.a
# MICROPY_QSTRDEFSEMBED_H to use our custom qstrdefsembed.h
# MICROPY_MPCONFIGEMBED_H to use our custom mpconfigembed.h
# V to inherit our verbosity setting
$(LIBMICROPYTHON_A): qstrdefsembed.h mpconfigembed.h
@$(MAKE) \
-C $(LIBMICROPYTHON_PORT) \
BUILD=$(LIBMICROPYTHON_BUILD) \
LIBMICROPYTHON=$(LIBMICROPYTHON_A) \
MICROPY_QSTRDEFSEMBED_H=$(ABS_PATH)/qstrdefsembed.h \
MICROPY_MPCONFIGEMBED_H=$(ABS_PATH)/mpconfigembed.h \
V=$(V) \
lib

clean:
rm -rf *.o hello-embed $(LIBMICROPYTHON_BUILD)
191 changes: 0 additions & 191 deletions examples/embedding/Makefile.upylib

This file was deleted.

Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy