Port to Arduino 1.0

* renamed .pde files to .ino
* adapted source and makefiles
This commit is contained in:
Admar Schoonen 2011-12-30 22:43:48 +01:00
parent a6c368092c
commit cc6c0940f6
4 changed files with 13 additions and 8 deletions

View File

@ -58,7 +58,7 @@
#
# ARDUINO_DIR - Where the Arduino software has been unpacked
# TARGET - The basename used for the final files. Canonically
# this would match the .pde file, but it's not needed
# this would match the .ino file, but it's not needed
# here: you could always set it to xx if you wanted!
# ARDUINO_LIBS - A list of any libraries used by the sketch (we assume
# these are in $(ARDUINO_DIR)/hardware/libraries
@ -72,7 +72,7 @@
#
# All of the object files are created in the build-cli subdirectory
# All sources should be in the current directory and can include:
# - at most one .pde file which will be treated as C++ after the standard
# - at most one .ino file which will be treated as C++ after the standard
# Arduino header and footer have been affixed.
# - any number of .c, .cpp, .s and .h files
#
@ -139,6 +139,7 @@ endif
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/libraries
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/arduino/cores/arduino
ARDUINO_VARIANT_PATH = $(ARDUINO_DIR)/hardware/arduino/variants/$(ARDUINO_VARIANT)
endif
@ -151,10 +152,10 @@ OBJDIR = build-cli
LOCAL_C_SRCS = $(wildcard *.c)
LOCAL_CPP_SRCS = $(wildcard *.cpp)
LOCAL_CC_SRCS = $(wildcard *.cc)
LOCAL_PDE_SRCS = $(wildcard *.pde)
LOCAL_INO_SRCS = $(wildcard *.ino)
LOCAL_AS_SRCS = $(wildcard *.S)
LOCAL_OBJ_FILES = $(LOCAL_C_SRCS:.c=.o) $(LOCAL_CPP_SRCS:.cpp=.o) \
$(LOCAL_CC_SRCS:.cc=.o) $(LOCAL_PDE_SRCS:.pde=.o) \
$(LOCAL_CC_SRCS:.cc=.o) $(LOCAL_INO_SRCS:.ino=.o) \
$(LOCAL_AS_SRCS:.S=.o)
LOCAL_OBJS = $(patsubst %,$(OBJDIR)/%,$(LOCAL_OBJ_FILES))
@ -209,6 +210,7 @@ LIB_OBJS = $(patsubst $(ARDUINO_LIB_PATH)/%.cpp,$(OBJDIR)/libs/%.o,$(LIB_SR
CPPFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) \
-I. -I$(ARDUINO_CORE_PATH) \
-I$(ARDUINO_VARIANT_PATH) \
$(SYS_INCLUDES) -g -Os -w -Wall \
-ffunction-sections -fdata-sections
CFLAGS = -std=gnu99
@ -217,7 +219,7 @@ ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp
LDFLAGS = -mmcu=$(MCU) -lm -Wl,--gc-sections -Os
# Rules for making a CPP file from the main sketch (.cpe)
PDEHEADER = \\\#include \"WProgram.h\"
INOHEADER = \\\#include \"Arduino.h\"
# Expand and pick the first port
ARD_PORT = $(firstword $(wildcard $(ARDUINO_PORT)))
@ -268,9 +270,9 @@ $(OBJDIR)/%.d: %.S
$(OBJDIR)/%.d: %.s
$(CC) -MM $(CPPFLAGS) $(ASFLAGS) $< -MF $@ -MT $(@:.d=.o)
# the pde -> cpp -> o file
$(OBJDIR)/%.cpp: %.pde
$(ECHO) $(PDEHEADER) > $@
# the ino -> cpp -> o file
$(OBJDIR)/%.cpp: %.ino
$(ECHO) $(INOHEADER) > $@
$(CAT) $< >> $@
$(OBJDIR)/%.o: $(OBJDIR)/%.cpp

View File

@ -8,6 +8,9 @@ SMCU = m328p
F_CPU = 16000000
ARDUINO_PORT = /dev/ttyUSB*
#ARDUINO_VARIANT = mega
ARDUINO_VARIANT = standard
AVRDUDE_ARD_PROGRAMMER = arduino
AVRDUDE_ARD_BAUDRATE = 57600
#AVRDUDE_ARD_EXTRAOPTS = -F