The company I work for uses a variety of device types (argon, boron) for the same application, depending on the cell service/wifi availability at each of our customers’ sites. Currently, we have 4 “products” with very similar firmware to each other to accommodate our general need. We manage our firmware source code on github as 4 separate, independent code bases that contain essentially the same code (except for product id, and a few minor differences here and there).
I am interested in consolidating the firmware into one code base to make feature development easier, but being a beginner c++ programmer I’m not sure the correct approach for this.
In order to compile our firmware to 4 different products, I’m attempting to write a custom makefile to build the firmware. I’m having trouble getting it to work, because make can’t find the “application.h” included in each file.
Is a custom makefile the correct approach, or is there a better way to handle compiling the same firmware to different products? If a makefile is the correct approach, how do I accommodate the Spark core stuff (“application.h”) in my makefile?
This is my first exposure to writing makefiles, so more beginner friendly explanations are appreciated. I’ve been mainly working by consulting the
particle-core-communication repo (it was referenced on a forum post I found)