sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.

Home Page:http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for compiling multiple .ino and .pde files

sudar opened this issue · comments

After c64f38a 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.

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

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

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.