Today I’ve been experimenting getting firmware for my Core compiling locally.
I’ve now un-Clouded my software from the Web IDE so that I can compile and flash it locally (used the great Windows tutorial https://community.spark.io/t/how-to-video-for-compiling-locally-in-windows/2457 by @seulater, tweaked to use Netbeans on Linux).
As I was using the ‘Multiple Files’ feature of the Web IDE, to compile locally I had to create separate .h and .cpp files in the inc and src directories respectively, and make sure my main code went in src/application.cpp.
I was struggling to tweak the relevant makefile so that my additional libraries would be built too.
In the end I had to add a few lines to the core-firmware/src/build.mk script, to that it referenced my extra files:
... # C++ source files included in this build. CPPSRC += $(TARGET_SRC_PATH)/application.cpp CPPSRC += $(TARGET_SRC_PATH)/SimpleTimer.cpp CPPSRC += $(TARGET_SRC_PATH)/LiquidCrystal.cpp CPPSRC += $(TARGET_SRC_PATH)/DHT11.cpp CPPSRC += $(TARGET_SRC_PATH)/main.cpp CPPSRC += $(TARGET_SRC_PATH)/newlib_stubs.cpp ...
Is there some clever Make-fu that can been deployed that would auto-magically pick up all the .cpp files in src, so that you didn’t have to add each one manually?