Skip to content

Commit

Permalink
examples/subfolders: have two source files in subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian18 committed Jan 4, 2025
1 parent 725a22e commit b583373
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/subfolders/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions examples/subfolders/folder/subfolder/c.c
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>

void folder_c(void)
{
puts("./folder/subfolder/c.c");
}
2 changes: 2 additions & 0 deletions examples/subfolders/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -34,6 +35,7 @@ int main(void)
// call functions from subfolder
folder_a();
folder_b();
folder_c();

return 0;
}

0 comments on commit b583373

Please sign in to comment.