.
Bueno, por los foros de Teensy, me han dado una solución, que creo me puede resolver el problema. Me dicen que en la instalación de Teensy para Arduino, hay un Makefile con el que se puede compilar el proyecto sin necesidad de tener Arduino.
He buscado información en la web de Teensy, y me encuentro con esto:
"
Step #3: The GCC Compiler and Tools
Update: This page only applies to Teensy 2.0. Teensy 3.0 is supported by Teensyduino. To use Teensy 3.0 without Arduino, first install Teensyduino. A sample makefile is installed in hardware/teensy/cores/teensy3. The makefile comments explain how to detete the unnecessary portions of Arduino, if you wish to use only the makefile.
To compile C and C++ programs, you will need a collection of programs including avr-gcc, the avr-libc C library and avr-binutils. Installing all the required pieces separately can be difficult. Fortunately, there are complete, easy to install packages for all major platforms. "
He buscado en la instalación de Arduino/Teensy, y me he encontrado el Makefile famoso, que tiene este contenido. Mi duda es si puedo meter este archivo a capón en el proyecto de Kinetis en el KDE. Nunca he mirado los Makefile, intuyo para que sirven, pero no se los detalles. Ahí veo parámetros para el enlazador y el compilador, que es una de las cosas que andaba buscando, y los path a ciertas librerías de Arduino, que podrían ser necesarias para portar el proyecto a Eclipse.
# set your MCU type here, or make command line `make MCU=MK20DX256`
MCU=MK20DX256
# make it lower case
LOWER_MCU := $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$(MCU)))))))))))))))))))))))))))
MCU_LD = $(LOWER_MCU).ld
# The name of your project (used to name the compiled .hex file)
TARGET = main
# Those that specify a NO_ARDUINO environment variable will
# be able to use this Makefile with no Arduino dependency.
# Please note that if ARDUINOPATH was set, it will override
# the NO_ARDUINO behaviour.
ifndef NO_ARDUINO
# Path to your arduino installation
ARDUINOPATH ?= ../../../../..
#ARDUINOPATH ?= ../../../..
endif
# configurable options
OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE
# options needed by many Arduino libraries to configure for Teensy 3.0
OPTIONS += -D__$(MCU)__ -DARDUINO=10613 -DTEENSYDUINO=132
# Other Makefiles and project templates for Teensy 3.x:
#
# https://github.com/apmorton/teensy-template
# https://github.com/xxxajk/Arduino_Makefile_master
# https://github.com/JonHylands/uCee
#************************************************************************
# Location of Teensyduino utilities, Toolchain, and Arduino Libraries.
# To use this makefile without Arduino, copy the resources from these
# locations and edit the pathnames. The rest of Arduino is not needed.
#************************************************************************
ifdef ARDUINOPATH
# path location for Teensy Loader, teensy_post_compile and teensy_reboot (on Linux)
TOOLSPATH = $(abspath $(ARDUINOPATH)/hardware/tools)
# path location for Arduino libraries (currently not used)
LIBRARYPATH = $(abspath $(ARDUINOPATH)/libraries)
# path location for the arm-none-eabi compiler
COMPILERPATH = $(abspath $(ARDUINOPATH)/hardware/tools/arm/bin)
else
# Default to the normal GNU/Linux compiler path if NO_ARDUINO
# and ARDUINOPATH was not set.
COMPILERPATH ?= /usr/bin
endif
#************************************************************************
# Settings below this point usually do not need to be edited
#************************************************************************
# CPPFLAGS = compiler options for C and C++
CPPFLAGS = -Wall -g -Os -mcpu=cortex-m4 -mthumb -MMD $(OPTIONS) -I.
# compiler options for C++ only
CXXFLAGS = -std=gnu++0x -felide-constructors -fno-exceptions -fno-rtti
# compiler options for C only
CFLAGS =
# linker options
LDFLAGS = -Os -Wl,--gc-sections,--defsym=__rtc_localtime=0 --specs=nano.specs -mcpu=cortex-m4 -mthumb -T$(MCU_LD)
# additional libraries to link
LIBS = -lm
# names for the compiler programs
CC = $(COMPILERPATH)/arm-none-eabi-gcc
CXX = $(COMPILERPATH)/arm-none-eabi-g++
OBJCOPY = $(COMPILERPATH)/arm-none-eabi-objcopy
SIZE = $(COMPILERPATH)/arm-none-eabi-size
# automatically create lists of the sources and objects
# TODO: this does not handle Arduino libraries yet...
C_FILES := $(wildcard *.c)
CPP_FILES := $(wildcard *.cpp)
OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)
# the actual makefile rules (all .o files built by GNU make's default implicit rules)
all: $(TARGET).hex
$(TARGET).elf: $(OBJS) $(MCU_LD)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
%.hex: %.elf
$(SIZE) $<
$(OBJCOPY) -O ihex -R .eeprom $< $@
ifneq (,$(wildcard $(TOOLSPATH)))
$(TOOLSPATH)/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(TOOLSPATH)
-$(TOOLSPATH)/teensy_reboot
endif
# compiler generated dependency info
-include $(OBJS:.o=.d)
clean:
rm -f *.o *.d $(TARGET).elf $(TARGET).hex