From b583373e5e6048b2208ed190a8ab35970995cd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Sat, 4 Jan 2025 22:25:19 +0100 Subject: [PATCH] examples/subfolders: have two source files in subfolder --- examples/subfolders/Makefile | 2 +- examples/subfolders/folder/subfolder/c.c | 14 ++++++++++++++ examples/subfolders/main.c | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 examples/subfolders/folder/subfolder/c.c diff --git a/examples/subfolders/Makefile b/examples/subfolders/Makefile index b5a8e8870687..c3c983985350 100644 --- a/examples/subfolders/Makefile +++ b/examples/subfolders/Makefile @@ -13,7 +13,7 @@ USEMODULE += my_module # name as defined in module/Makefile # Add source files in subfolders manually SRC += main.c -SRC += folder/a.c folder/subfolder/b.c +SRC += folder/a.c folder/subfolder/b.c folder/subfolder/c.c # Alternative method to add files in subfolders using wildcards # SRC += $(wildcard *.c folder/*.c folder/**/*.c) diff --git a/examples/subfolders/folder/subfolder/c.c b/examples/subfolders/folder/subfolder/c.c new file mode 100644 index 000000000000..ec0c218b03b7 --- /dev/null +++ b/examples/subfolders/folder/subfolder/c.c @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2025 ML!PA Consulting GmbH + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +#include + +void folder_c(void) +{ + puts("./folder/subfolder/c.c"); +} diff --git a/examples/subfolders/main.c b/examples/subfolders/main.c index f7a8cf54b3b8..89ec8e03aa55 100644 --- a/examples/subfolders/main.c +++ b/examples/subfolders/main.c @@ -24,6 +24,7 @@ void module_a(void); void module_b(void); void folder_a(void); void folder_b(void); +void folder_c(void); int main(void) { @@ -34,6 +35,7 @@ int main(void) // call functions from subfolder folder_a(); folder_b(); + folder_c(); return 0; }