3 ms·
> Not when using one translation unit per MCU and letting the Makefile pick the right one. Could you please link any examples of that I could examine myself?
by Avamander 8y ago
> Not when using one translation unit per MCU and letting the Makefile pick the right one.
Could you please link any examples of that I could examine myself?
Also, makefiles aren't really an option with platforms like Arduino, the IDE does not really support them.
- namibj 8y agoErr, you can use the Arduino ecosystem with gnu make.... look for it, there is documentation, which does have ease of use to wish for and requires installation that drives me towards believing in chroot.
- Avamander 8y agoSure I can, but it's ugly and cumbersome and doesn't work when you try to provide a library that could be used with the IDE.
- pjmlp 8y agoAs you can see from my OS list, those days were a while back. Basically I adopted some ideas from Pascal/Modula world, plus some tips from somewhere/someone during my university days. Basically you consider a translation unit as C's vision of a module, and use Abstract Data Type types for the data structures. The header contains the common code, and only on performance critical code are used macros instead of functions (validated with profiler that is worthwhile doing so). Then you have module.c for the common code, followed by module_os.c for each platform. Sorry for not providing Makefile rules, it has been a while.
- stevekemp 8y agoPeople have written Makefiles for arduino-projects, for example this project: https://github.com/sudar/Arduino-Makefile https://github.com/sudar/Arduino-Makefile To be honest the simpler way is to do it "by hand", if you enable the appropriate options in your arduino IDE you can see the actual compilation-commands which are executed. Copy and paste them to a Makefile.. I'm very familiar with make, etc, but still use the IDE for my Arduino projects (simple as they might be). I just use Emacs as an external editor.