Page 1 of 1

Component Makefiles - Adding source directories

Posted: Wed Sep 26, 2018 2:59 pm
by mikemoy
I created a test.txt file and included it in my root directory.
In component.mk i have:

Code: Select all

COMPONENT_EMBED_FILES := test.txt
This compiles fine with no issues. I want to put my files in a subdirectory. accoding to the docs, i need to add "COMPONENT_SRCDIRS.
https://docs.espressif.com/projects/esp ... irectories


I created a new directory in root named "WebSiteFiles" and placed the files in there.
the component.mk now looks like this.

Code: Select all

COMPONENT_SRCDIRS := WebsiteFiles
COMPONENT_EMBED_FILES := test.txt
When I compile now, I get:

make[1]: *** No rule to make target '/home/Mike/esp/Projects/spiffs/main/test.txt', needed by 'embed_bin/test.txt'. Stop.

Any ideas why?

Re: Component Makefiles - Adding source directories

Posted: Thu Sep 27, 2018 12:50 am
by ESP_Angus
"Source directories" are checked for "source files" (.c, .cpp, .S). Try the following:

Code: Select all

COMPONENT_EMBED_FILES := WebsiteFiles/test.txt
Paths are expanded relative to the component directory.

Re: Component Makefiles - Adding source directories

Posted: Thu Sep 27, 2018 1:56 am
by mikemoy
Thank you sir, that worked!