My projects are going to involve a sketch and a number of resource files (html, css, txt or even the ins sketch itself)
I don’t want to embed theses resources directly into the sketch as I want to use the appropriate/relevant tool to edit/maintain them directly.
I want the content of these resources files to be converted (using xxd -I ) into const char arrays declarations in files that I can either :
- leverage using a #include directive in the sketch .
- process with the compiler and integrate the .o output into the linking process ..
I want the whole process to be automated during compilation ….
How do I trigger the creation of these includable files from the ressource files in the project folder when I launch a compilation in the Arduino IDE ?
(Given the size and number of these resources files I am not worried about efficiency … I can live with running xxd -I on each file every time I compile as long as I don’t have to trigger it independently )
Given that the output of xxd -I is only variable declarations (and no code) is it better to use a #include directive to insert them in the sketch or put the output of xxd -I to a C file and put it through the compiler directly to get a .o file to be linked with the whole project ? (how do I make sure all the .o files generated this way are included at link time ?)
I believe that in a typical software dev tool chain this would be handled through recipes of sorts in a Makefile .. however I would like to keep using the Arduino IDE and not use a CLI to compile projects.
I have tried looking for tips on “how to” essentially modify the compile process in the Arduino IDE but I havent found anything promising yet.
I am open to suggestions ..