Wow this is a flash in the past for me. Where I worked at in 2005 we shipped several Automotive Embedded software stacks. We had to support ~60-70 uC platforms with a combination of about ~50 different compilers. All kinds of different versions, sizes etc..
We had a Makefile project in place with about >10k LOC that was modular enough that after it was pre-processed we had a functioning Makefile environment which was fast and did all kinds of things. It worked and maintaining and debugging it was actually not too bad since Makefiles are just rules.
I have been trying to wrap my ahead around Makefiles for the longest time, but it never seems to click.
Like I can read the tutorial and understand the individual parts, but I can never really remember them or really what I am doing.
Take for example, I am trying to build a completely unique project something that's never been done before.
But I have no idea how to make the damn thing from scratch.
Basically I want to get Clang/LLVM working on my STM32F4 board(Cortex M4), so that way I can try py2llvm and see if you can do Python with good performance on embedded targets.
I had been fighting with Makefiles for a very long time, and I never really got beyond finding a boilerplate makefile, and changing it to just barely accomplish what I wanted to do.
A while ago, I found Tup thanks to HN: http://gittup.org/tup/
In under an hour of documentation reading, I was writing tupfiles that were more functional than any makefile I had written in years. Also really neat: since tup can monitor the file system, you can set up a monitor to auotmatically rebuild the project every time you change something. Super handy and super easy with tup.
It's a Makefile and basic framework for creating bare metal projects on the STM32 using Rust. Rust emits LLVM, which is then compiled to the Thumb instruction set for use on the Arm device. If py2llvm emits proper llvm, it should work if you switch the Rust compiler out for py2llvm.
Note that you'll need clone and build the LLVM repo directly, since the latest stable release of LLVM (3.3) doesn't yet include the brand-new Thumb mode that you need for the Cortex m4.
Oh wow thank you, how did you manage to find the project?
Just by googling?
I have been having trouble finding projects related to the microcontroller I'm working on, there aren't to many but there are a few that exist on github. Of the few that I was able to find, were goldmines.
I actually have been learning Rust, and since I'm also interested in bare metal programming, I immediately looked into this project when it was on the #rustlang tag on Twitter.
Please let me know if you try to use it for your project, I'm eager to hear if it works for you. llvm is a fascinating project -- if you get it working on your STM32, you also may eventually be able to also use it on Arduino since an avr target for llvm is in the works.
We had a Makefile project in place with about >10k LOC that was modular enough that after it was pre-processed we had a functioning Makefile environment which was fast and did all kinds of things. It worked and maintaining and debugging it was actually not too bad since Makefiles are just rules.
Ever since then I just kind of love Makefiles.