I have a sketch with multiple source files and folders arranged like so. I've divided up the project like this to keep things clean.
| \---project | project.ino | types.h | +---sub1 | gadget1.c | gadget1.h | gadget2.c | gadget2.h | \---blarg foobar.c foobar.h
The sketch file includes the headers via quoted include directives (rather than the lib alternative with angled brackets). This seems to work for compilation.
However, when the IDE tries to link, all references to implementations (c source files) in the subfolders generate "undefined reference" errors. Almost as if the IDE is completely ignoring the C source files.
In trying to resolve this I've discovered that apparently the handling of subfolders by the IDE seems to be all over the place. Some versions only acknowledge headers in subfolders, others work if you put everything in a "src" folder (I've also seen mention of a "utility" folder), some people suggest modifying environment variables, etc. I've even tried manually adding source files via the "sketch/add file" option which makes the files visible in the IDE but does not solve the linking problems. All these methods seem to depend on IDE version, and I couldn't distill what was the correct way vs a hack or work-around.
So my question is what is the correct/current way of organizing the above project so that it can be compiled/linked using the IDE? I am using IDE version 1.8.5 which I believe is either the latest version, or close too it.