Arduino-Makefile icon indicating copy to clipboard operation
Arduino-Makefile copied to clipboard

Add support for compiling multiple .ino and .pde files

Open sudar opened this issue 12 years ago • 3 comments

After c64f38ae6d3591e4b94f6ba8659e7ddf30446a14 we can't compile if we had multiple .ino or .pde files. (The support for multiple files was anyways broken before #39 )

One approach is to concatenate all files together into one big .cpp file and compile that. Arduino IDE does this together with some more preprocessing at https://github.com/arduino/Arduino/blob/master/app/src/processing/app/preproc/PdePreprocessor.java

I am open for other suggestions as well.

sudar avatar May 31 '13 03:05 sudar

As I mentioned in #59, I wrote a preprocessor, which also combines all Arduino source files.

michaelbaisch avatar Mar 23 '15 20:03 michaelbaisch

There’s also the official Arduino preprocessor: https://github.com/arduino/arduino-preprocessor

jabberabbe avatar Jul 19 '18 11:07 jabberabbe

I would like to see a rather different approach. Rather than a single executable from multiple .ino files, create a separate executable from each .ino file. That way a library can have an examples directory with multiple examples in it without having to introduce another layer of directories. examples/example_A.ino examples/example_B.ino ...

Alternatively provide a way to specify which .ino files (or .cpp) should be used to generate which executable.

MalcolmBoura avatar Mar 11 '21 13:03 MalcolmBoura