Add Port tags to know which system we are making#282
Add Port tags to know which system we are making#282nathanRamaNoodles wants to merge 2 commits intobluekitchen:masterfrom nathanRamaNoodles:master
Conversation
…al makefiles in big projects.
|
Hi Nathan. Thanks for the suggestion and pull request. In the existing BTstack ports, we've tried to limit the examples to a minimal API and tried to hide additional functionality (e.g. audio) behind interfaces -> also keep the Makefile.inc the same (although the different ports use different Makefiles and it needs some cleanup). Would it possible for you to add the additional files to the port specific makefile? e.g. the wiringPi can only be used by the Raspi port, but no others. So my main question would be: is it better to have port-specific files / flags in example/Makefile.inc or in the port-specific Makefile? |
Its better to have the port-specific files specified in the
I originally programmed in the esp-idf and found their project structure to be optimal for other projects like btstack. Here is what an example ESP-idf Project Structure looks like: Here is how I adapted it to btstack |
So in big projects, I found that it would be nice to make the makefile easier for multiple different systems like Linux and raspberry pi; sometimes I may use a button in raspi but not in Linux. So I need to use wiringPi, which is only allowed on raspberry pi. But in the example folder, it can be hard to differentiate which system we're compiling on, so I made a tag for most of the ports, such as:
Raspi:
BTSTACK_SYSTEM ?= RASPIand then when making for RASPI, our normal
examples/Makefile.incwill include the extra dependencies I want for each port.This sketch will print out
Making for raspberry pi...and include the wiring Pi library exclusively for raspberry pi and not Linux; which is exactly what I want.