Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2015-05-02 22:58:18 -0400
committerDoug Schaefer2015-05-04 16:34:10 -0400
commit076e141b69bb543d45f41b0c10317fde3ef959ea (patch)
tree026daf607667502db6169d401f2deb4068cc3da0 /toolchains/arduino/org.eclipse.cdt.arduino-feature
parentcb16665cc776d9e46d5862e8ee283ff082063a90 (diff)
downloadorg.eclipse.cdt-076e141b69bb543d45f41b0c10317fde3ef959ea.tar.gz
org.eclipse.cdt-076e141b69bb543d45f41b0c10317fde3ef959ea.tar.xz
org.eclipse.cdt-076e141b69bb543d45f41b0c10317fde3ef959ea.zip
Bug 466209 - Initial commit of Arduino plugins.
Includes freemarker jar which we have CQ approval for. Change-Id: I8f36cd7f4539497bab5f106f84216f75a25da3a0
Diffstat (limited to 'toolchains/arduino/org.eclipse.cdt.arduino-feature')
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/.gitignore1
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/.project23
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/arduino.mk113
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/build.properties1
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.properties32
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml43
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino-feature/pom.xml16
8 files changed, 233 insertions, 0 deletions
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/.gitignore b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.gitignore
new file mode 100644
index 0000000000..b83d22266a
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.gitignore
@@ -0,0 +1 @@
+/target/
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/.project b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.project
new file mode 100644
index 0000000000..9a4f866601
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.cdt.arduino-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/.settings/org.eclipse.m2e.core.prefs b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000000..f897a7f1cb
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/arduino.mk b/toolchains/arduino/org.eclipse.cdt.arduino-feature/arduino.mk
new file mode 100644
index 0000000000..9efc895422
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/arduino.mk
@@ -0,0 +1,113 @@
+VERSION = 156
+
+BOARD ?= uno
+OUTPUT_DIR ?= build/Default
+
+rwildcard = $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
+
+ifeq ($(OS),Windows_NT)
+RMDIR = rmdir /s /q
+fixpath = $(subst /,\,$1)
+mymkdir = if not exist "$(call fixpath,$1)" mkdir $(call fixpath,$1)
+else
+RMDIR = rm -fr
+fixpath = $1
+mymkdir = mkdir -p $1
+endif
+
+ifeq ($(BOARD),uno)
+ARCH = avr
+BUILD_CORE = arduino
+BUILD_VARIANT = standard
+BUILD_MCU = atmega328p
+BUILD_F_CPU = 16000000L
+BUILD_BOARD = AVR_UNO
+LOADER = avrdude
+LOADER_PROTOCOL = arduino
+LOADER_SPEED = 115200
+LOADER_MAX_SIZE = 32256
+LOADER_MAX_DATA = 2048
+endif
+
+ifeq ($(ARCH),avr)
+CXXFLAGS = -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD \
+ -mmcu=$(BUILD_MCU) -DF_CPU=$(BUILD_F_CPU) -DARDUINO=$(VERSION) -DARDUINO_$(BUILD_BOARD) -DARDUINO_ARCH_AVR $(INCLUDES)
+CFLAGS = -g -Os -w -ffunction-sections -fdata-sections -MMD \
+ -mmcu=$(BUILD_MCU) -DF_CPU=$(BUILD_F_CPU) -DARDUINO=156 -DARDUINO_$(BUILD_BOARD) -DARDUINO_ARCH_AVR $(INCLUDES)
+
+CXX = avr-g++
+CC = avr-gcc
+AR = avr-ar
+OBJCOPY = avr-objcopy
+
+define do_link
+$(CC) -Os -Wl,--gc-sections -mmcu=$(BUILD_MCU) -o $(OUTPUT_DIR)/$(EXE).elf $^
+avr-objcopy -O ihex -R .eeprom $(OUTPUT_DIR)/$(EXE).elf $(OUTPUT_DIR)/$(EXE).hex
+$(do_link_extra)
+avr-size $(OUTPUT_DIR)/$(EXE).elf
+@echo Max text: $(LOADER_MAX_SIZE)
+@echo Max data + bss: $(LOADER_MAX_DATA)
+endef
+
+define do_eeprom
+avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load \
+ --no-change-warnings --change-section-lma .eeprom=0 \
+ $(OUTPUT_DIR)/$(EXE).elf $(OUTPUT_DIR)/$(EXE).eep
+endef
+
+define do_load_avrdude
+avrdude -C"$(ARDUINO_HOME)/hardware/tools/avr/etc/avrdude.conf" -p$(BUILD_MCU) -c$(LOADER_PROTOCOL) \
+ -P$(SERIAL_PORT) -b$(LOADER_SPEED) -D "-Uflash:w:$(OUTPUT_DIR)/$(EXE).hex:i"
+endef
+
+endif # ARCH = avr
+
+LIB_ROOT = $(ARDUINO_HOME)/hardware/arduino/$(ARCH)/cores/$(BUILD_CORE)
+
+LIB_SRCS = $(call rwildcard, $(LIB_ROOT)/, *.c *.cpp)
+
+LIB_OBJS = $(patsubst $(LIB_ROOT)/%.c, $(OUTPUT_DIR)/arduino/%.o, $(filter %.c, $(LIB_SRCS))) \
+ $(patsubst $(LIB_ROOT)/%.cpp, $(OUTPUT_DIR)/arduino/%.o, $(filter %.cpp, $(LIB_SRCS)))
+
+LIBS_ROOTS = $(HOME)/Documents/Arduino/libraries $(ARDUINO_HOME)/hardware/arduino/$(ARCH)/libraries $(ARDUINO_HOME)/libraries
+
+LIBS_DIRS = $(foreach lib, $(LIBS), $(firstword $(realpath $(foreach lib_root, $(LIBS_ROOTS), $(lib_root)/$(lib)))))
+
+INCLUDES = -I$(ARDUINO_HOME)/hardware/arduino/$(ARCH)/cores/$(BUILD_CORE) \
+ -I$(ARDUINO_HOME)/hardware/arduino/$(ARCH)/variants/$(BUILD_VARIANT) \
+ $(foreach lib, $(LIBS_DIRS), -I$(lib))
+
+SRCS = $(call rwildcard, ./, *.c *.cpp) $(foreach lib, $(LIBS_DIRS), $(wildcard $(lib)/*.c $(lib)/*.cpp $(lib)/utility/*.c $(lib)/utility/*.cpp))
+
+OBJS = $(patsubst %.cpp, $(OUTPUT_DIR)/%.o, $(filter %.cpp, $(SRCS))) \
+ $(patsubst %.c, $(OUTPUT_DIR)/%.o, $(filter %.c, $(SRCS)))
+
+all: $(OUTPUT_DIR)/$(EXE).hex
+
+clean:
+ $(RMDIR) $(call fixpath,$(OUTPUT_DIR))
+
+load: #$(OUTPUT_DIR)/$(EXE).hex
+ $(do_load_$(LOADER))
+
+$(OUTPUT_DIR)/$(EXE).hex: $(OBJS) $(OUTPUT_DIR)/core.a
+ $(do_link)
+
+$(OUTPUT_DIR)/core.a: $(LIB_OBJS)
+ $(AR) r $@ $?
+
+$(OUTPUT_DIR)/arduino/%.o: $(LIB_ROOT)/%.c
+ @-$(call mymkdir,$(dir $@))
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(OUTPUT_DIR)/arduino/%.o: $(LIB_ROOT)/%.cpp
+ @-$(call mymkdir,$(dir $@))
+ $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(OUTPUT_DIR)/%.o: %.c
+ @-$(call mymkdir,$(dir $@))
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+
+$(OUTPUT_DIR)/%.o: %.cpp
+ @-$(call mymkdir,$(dir $@))
+ $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -o $@ $<
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/build.properties b/toolchains/arduino/org.eclipse.cdt.arduino-feature/build.properties
new file mode 100644
index 0000000000..64f93a9f0b
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/build.properties
@@ -0,0 +1 @@
+bin.includes = feature.xml
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.properties b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.properties
new file mode 100644
index 0000000000..06e59da08f
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.properties
@@ -0,0 +1,32 @@
+###############################################################################
+# Copyright (c) 2015 QNX Software Systems and others
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# QNX Software Systems - initial API and implementation
+###############################################################################
+# features.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=Arduino C++ Tools
+
+# "providerName" property - name of the company that provides the feature
+providerName=Eclipse CDT
+
+# "description" property - description of the feature
+description=Extensions to support Arduino C++ projects in Eclipse
+
+# copyright
+copyright=\
+Copyright (c) 2015 QNX Software Systems and others.\n\
+All rights reserved. This program and the accompanying materials\n\
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http://www.eclipse.org/legal/epl-v10.html
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml
new file mode 100644
index 0000000000..0597ebb2b7
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/feature.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.cdt.arduino"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.cdt.arduino.ui"
+ license-feature="org.eclipse.license"
+ license-feature-version="0.0.0">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.launchbar" version="1.0.0.qualifier"/>
+ <import feature="org.eclipse.remote.serial" version="1.0.0.qualifier"/>
+ <import feature="org.eclipse.remote" version="2.0.0.qualifier"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.cdt.arduino.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.cdt.arduino.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino-feature/pom.xml b/toolchains/arduino/org.eclipse.cdt.arduino-feature/pom.xml
new file mode 100644
index 0000000000..3f2eb8214a
--- /dev/null
+++ b/toolchains/arduino/org.eclipse.cdt.arduino-feature/pom.xml
@@ -0,0 +1,16 @@
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.eclipse.cdt</groupId>
+ <artifactId>cdt-parent</artifactId>
+ <version>8.6.0-SNAPSHOT</version>
+ <relativePath>../../../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>org.eclipse.cdt.arduino</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-feature</packaging>
+</project>

Back to the top