Component Makefiles - Adding source directories

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Component Makefiles - Adding source directories

Postby mikemoy » Wed Sep 26, 2018 2:59 pm

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Component Makefiles - Adding source directories

Postby ESP_Angus » Thu Sep 27, 2018 12:50 am

"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.

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: Component Makefiles - Adding source directories

Postby mikemoy » Thu Sep 27, 2018 1:56 am

Thank you sir, that worked!

Who is online

Users browsing this forum: No registered users and 108 guests