summaryrefslogtreecommitdiffstatshomepage
path: root/examples/usercmodule/cexample/micropython.mk
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-10-21 11:13:47 +0200
committerDamien George <damien@micropython.org>2020-10-29 15:30:42 +1100
commit25c4563f26c2270cde01b01dca0e8b801c9c8282 (patch)
tree893f7160c558bceb288f06642d2fae440d51014d /examples/usercmodule/cexample/micropython.mk
parentfad4079778f46bc21dd19a674b31b4c3c7eb6a91 (diff)
downloadmicropython-25c4563f26c2270cde01b01dca0e8b801c9c8282.tar.gz
micropython-25c4563f26c2270cde01b01dca0e8b801c9c8282.zip
examples: Add example code for user C modules, both C and C++.
Add working example code to provide a starting point for users with files that they can just copy, and include the modules in the coverage test to verify the complete user C module build functionality. The cexample module uses the code originally found in cmodules.rst, which has been updated to reflect this and partially rewritten with more complete information.
Diffstat (limited to 'examples/usercmodule/cexample/micropython.mk')
-rw-r--r--examples/usercmodule/cexample/micropython.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/usercmodule/cexample/micropython.mk b/examples/usercmodule/cexample/micropython.mk
new file mode 100644
index 0000000000..dbfe3c5cbd
--- /dev/null
+++ b/examples/usercmodule/cexample/micropython.mk
@@ -0,0 +1,9 @@
+EXAMPLE_MOD_DIR := $(USERMOD_DIR)
+
+# Add all C files to SRC_USERMOD.
+SRC_USERMOD += $(EXAMPLE_MOD_DIR)/examplemodule.c
+
+# We can add our module folder to include paths if needed
+# This is not actually needed in this example.
+CFLAGS_USERMOD += -I$(EXAMPLE_MOD_DIR)
+CEXAMPLE_MOD_DIR := $(USERMOD_DIR)