Teensy.mk -- port of Arduino.mk Makefile

Status
Not open for further replies.

crispyking

New member
I'm just starting out with Teensy and I'm amazed at how easy everything is.
I'm an old vim guy, so my first order of business is to get a decent GUI-free
build environment, so I've adapted Martin Oldfield's Arduino.mk Makefile
for doing command-line builds of Teensyduino sketches.

It finds and builds all required core and library source files, so you can keep your sketch directories clean.

I'm using it with a minimal Makefile that looks like:
Code:
TARGET  = TestProj
ARDUINO_VERSION = 104
ARDUINO_DIR   = /Applications/Arduino.app/Contents/Resources/Java
BOARD_TAG     = teensy3
ARDUINO_LIBS = LiquidCrystal Encoder

include $(ARDUINO_DIR)/hardware/teensy/Teensy.mk

I've only tested it somewhat with Teensy 3.0 and 2.0, so there may still be issues with other boards.

Paul, you're welcome to bundle it or adapt it into the official Teensyduino distribution.

View attachment Teensymk-01.zip

Next step is convert it to use teensy_loader_cli (haven't yet figured out how to get it to work with 3.0) and some way to read/write to Serial from the command-line...

-- Chris
 
Have you looked at the sample makefile in hardware/teensy/cores/teensy3/Makefile? It uses the GUI by remote control, so it's not quite your goal of being 100% GUI-free, but you don't have to actually move your mouse or click on anything.
 
Have you looked at the sample makefile in hardware/teensy/cores/teensy3/Makefile? It uses the GUI by remote control, so it's not quite your goal of being 100% GUI-free, but you don't have to actually move your mouse or click on anything.

Hi Paul, yes I'm using your teensy_post_compile currently and it works quite well.
I tried to get teensy_loader_cli to work (changed productID to 0x483 and added a cortex-m4 option with code_size = 131072),
but it doesn't seem to enumerate all my USB devices on OSX 10.8. I may poke around later to see why.

Both my Teensy 2.0 and 3.0 show up in the Mac System Information app as ProductID=0x0483 VendorID=0x16C0.
I expected the 2.0 to be different (the old teensy_loadr_cli uses pid=0x0478 and 0x0477 for the rebootor).


I also managed to get a serial monitor working fine using C-Kermit (I didn't realize it was just /dev/tty.usbmodem12341).
Is the 12341 a predictable number? My Teensy2.0 keeps changing it's number if I unplug/replug, but the Teensy 3.0 appears to stay the same.

Thanks,
-- Chris
 
Status
Not open for further replies.
Back
Top