Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Teensy 3.x Ready-To-Go Makefile System

  1. #1
    Junior Member
    Join Date
    Nov 2014
    Posts
    6

    Teensy 3.x Ready-To-Go Makefile System

    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

    Cheers from UCC Cork in Ireland!

    Alex

  2. #2
    Junior Member
    Join Date
    Nov 2014
    Posts
    6
    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

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,169
    Looks really interesting.

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

  4. #4
    Junior Member
    Join Date
    Nov 2014
    Posts
    6
    Quote Originally Posted by PaulStoffregen View Post
    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

  5. #5
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Quote Originally Posted by AlexJ View Post
    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 by Constantin; 11-19-2014 at 09:57 PM.

  6. #6
    Junior Member
    Join Date
    Nov 2014
    Posts
    6
    Quote Originally Posted by Constantin View Post
    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

  7. #7
    Junior Member
    Join Date
    Nov 2014
    Posts
    6
    Hi again,

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

    Alex

  8. #8
    Junior Member
    Join Date
    Nov 2014
    Posts
    6
    Updated the cores folder to the latest commit. You should be able to overclock the Teensy boards now.

    Alex

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •