Teensy 3.x Ready-To-Go Makefile System

Status
Not open for further replies.

AlexJ

Member
Hi Everyone,

I've created a makefile based system for compiling and uploading projects to the Teensy 3.x boards, available here
https://github.com/AlexJaeger/teensy3build

The system automatically detects your platform, compiles and uploads code to the Teensy 3.x boards when the makefile is run.
Currently the system supports Windows, OSX (not tested, yet) and Linux 86_64.
Most of the instructions are in the readme, I should be completing them soon.

The basic use of the system:
1. Add the names of the libraries you want to use to the config.py script
2. Run the makefile and your code should compile and upload.

Yeah, the repo contains binaries, and yeah it is a hack...but hopefully it should be useful for people who want to stay loyal to a certain text editor. It works wonders in sublimetext, as I only have to use ctrl+b to compile my entire project :D

Cheers from UCC Cork in Ireland!

Alex
 
Hello again,

I'd welcome any feedback from people who give it a whirl.
Also if there's any issues regarding licenses and notices I'd greatly appreciate any pointers.

Cheers lads
Alex
 
Looks really interesting.

Is the python stuff used only to figure out which libraries to include?


Hi Paul,

Short answer, yes :)

The purpose of the config.py script is simple enough:

The LIBADD list variable contains the names of the libraries the user would like to use.
On execution, the script searches for these libraries in the 'libraries' folder.
These library files are then copied to a temporary folder called 'build', along with all the teensy core files located in the 'cores' folder.

The Makefile starts by executing the config.py script everytime make is called, and as a result proceeds to refresh (by deleting and recreating) this temporary build directory.
Make then compiles everything in the build folder and proceeds to upload the .hex to the teensy as usual.

The whole business of constantly deleting and recreating the build folder for each build is not very elegent, but it doesn't seem to have any negative effects. It also ensures any changes to libraries are always reflected in the next compilation.

Cheers,
Alex
 
The whole business of constantly deleting and recreating the build folder for each build is not very elegent, but it doesn't seem to have any negative effects. It also ensures any changes to libraries are always reflected in the next compilation.

Which may be a subtle distinction but an important one. While the Arduino IDE picks up on changes to libraries it is aware of at compile time, it does not allow the use of libraries added after it has been launched. To do that, you have to quit the IDE and restart it. It's one of the ways that Arduino manages to daze and confuse those who are adding libraries to do new and exciting things they couldn't do before.

Your approach is a definite plus in that regard.
 
Last edited:
Which may be a subtle distinction but an important one. While the Arduino IDE picks up on changes to libraries it is aware of at compile time, it does not allow the use of libraries added after it has been launched. To do that, you have to quit the IDE and restart it. It's one of the ways that Arduino manages to daze and confuse those who are adding libraries to do new and exciting things they couldn't do before.

Your approach is a definite plus in that regard.

Thanks for that.
It really does make tinkering with the libs easier. I also have a feeling everything compiles quicker too, as I can pass a '-jX' flag to Make (where X is a integer) on multiple core machines!

Alex
 
Hi again,

The Mac OSX toolchain has been fixed and tested working. Thanks to Kigster (github) for pointing out the issues.

Alex
 
Updated the cores folder to the latest commit. You should be able to overclock the Teensy boards now.

Alex
 
Status
Not open for further replies.
Back
Top