summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-02-24 16:29:39 +0100
committerChristian Pointner <equinox@spreadspace.org>2015-02-24 16:29:39 +0100
commitc6f3627eb20df13a023fb82cb33afe482f8f34be (patch)
tree0aafa42906a969fd7b9aa5dc63a8952a6aafcd4e
parentrefactored newly imported r3cam-steppermotoer (diff)
introduced path variable for avr utilities path
-rw-r--r--defines.mk20
-rw-r--r--include.mk11
-rw-r--r--lufa.mk2
3 files changed, 18 insertions, 15 deletions
diff --git a/defines.mk b/defines.mk
index 9af0179..e5f1d92 100644
--- a/defines.mk
+++ b/defines.mk
@@ -59,7 +59,7 @@ ifeq ($(BOARD_TYPE),minimus)
F_USB = $(F_CPU)
PROG := DFU
LUFA_BOARD = MINIMUS
- RESET_FUNC := ../tools/reset_minimus
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_minimus
RESET_PARAM = "03eb:2ffa"
endif
ifeq ($(BOARD_TYPE),minimus32)
@@ -69,7 +69,7 @@ ifeq ($(BOARD_TYPE),minimus32)
F_USB = $(F_CPU)
PROG := DFU
LUFA_BOARD = MINIMUS
- RESET_FUNC := ../tools/reset_minimus
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_minimus
RESET_PARAM = "03eb:2ff0"
endif
ifeq ($(BOARD_TYPE),hhd70dongle)
@@ -136,7 +136,7 @@ ifeq ($(BOARD_TYPE),arduinoUno)
UPLOAD_RATE := 57600
PROG_TYPE := stk500v1
AVRDUDE_PORT := /dev/ttyUSB0
- RESET_FUNC := ../tools/reset_arduino
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_arduino
RESET_PARAM = $(AVRDUDE_PORT)
endif
ifeq ($(BOARD_TYPE),arduino2009v2)
@@ -147,7 +147,7 @@ ifeq ($(BOARD_TYPE),arduino2009v2)
UPLOAD_RATE := 57600
PROG_TYPE := stk500v1
AVRDUDE_PORT := /dev/ttyUSB0
- RESET_FUNC := ../tools/reset_arduino
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_arduino
RESET_PARAM = $(AVRDUDE_PORT)
endif
ifeq ($(BOARD_TYPE),arduino2009)
@@ -158,7 +158,7 @@ ifeq ($(BOARD_TYPE),arduino2009)
UPLOAD_RATE := 19200
PROG_TYPE := stk500v1
AVRDUDE_PORT := /dev/ttyUSB0
- RESET_FUNC := ../tools/reset_arduino
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_arduino
RESET_PARAM = $(AVRDUDE_PORT)
endif
ifeq ($(BOARD_TYPE),arduino10000)
@@ -169,7 +169,7 @@ ifeq ($(BOARD_TYPE),arduino10000)
UPLOAD_RATE := 19200
PROG_TYPE := stk500v1
AVRDUDE_PORT := /dev/ttyUSB0
- RESET_FUNC := ../tools/reset_arduino
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_arduino
RESET_PARAM = $(AVRDUDE_PORT)
endif
ifeq ($(BOARD_TYPE),arduinoNG)
@@ -180,7 +180,7 @@ ifeq ($(BOARD_TYPE),arduinoNG)
UPLOAD_RATE := 19200
PROG_TYPE := stk500v1
AVRDUDE_PORT := /dev/ttyUSB0
- RESET_FUNC := ../tools/reset_dummy
+ RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_dummy
endif
ifeq ($(BOARD_TYPE),AvrNetIo)
MCU := atmega32
@@ -197,7 +197,7 @@ OBJCOPY = avr-objcopy
AR = avr-ar rcs
SIZE = avr-size
-LIB_DIR = ../lib
+LIB_DIR = $(SPREADAVR_PATH)/lib
DFU = dfu-programmer
teensy = teensy_loader_cli
@@ -207,7 +207,7 @@ avrdude = avrdude
COMMON = -mmcu=$(MCU)
## Compile options common for all C compilation units.
-CFLAGS = $(COMMON)
+CFLAGS = $(COMMON)
CFLAGS += -O2
CFLAGS += -funsigned-char
CFLAGS += -funsigned-bitfields
@@ -225,4 +225,4 @@ CFLAGS += -std=c99
## Linker flags
LDFLAGS = $(COMMON)
-LDFLAGS +=
+LDFLAGS +=
diff --git a/include.mk b/include.mk
index c2eb585..4bf417e 100644
--- a/include.mk
+++ b/include.mk
@@ -20,7 +20,10 @@
## along with spreadspace avr utils. If not, see <http://www.gnu.org/licenses/>.
##
-include ../defines.mk
+ifndef SPREADAVR_PATH
+SPREADAVR_PATH := ..
+endif
+include $(SPREADAVR_PATH)/defines.mk
## project-specific objects
SRC := $(OBJ:%.o=%.c)
@@ -55,12 +58,12 @@ build-lufa: liblufa.a
liblufa.a: Makefile
@echo "building external LUFA lib ($(LUFA_PATH))"
- make -f ../lufa.mk liblufa.a
- make -f ../lufa.mk clean
+ make -f $(SPREADAVR_PATH)/lufa.mk liblufa.a
+ make -f $(SPREADAVR_PATH)/lufa.mk clean
clean-lufa:
@echo "cleaning external LUFA lib ($(LUFA_PATH))"
- make -f ../lufa.mk clean
+ make -f $(SPREADAVR_PATH)/lufa.mk clean
rm -f liblufa.a
diff --git a/lufa.mk b/lufa.mk
index b247b87..e2f45e1 100644
--- a/lufa.mk
+++ b/lufa.mk
@@ -20,7 +20,7 @@
## along with spreadspace avr utils. If not, see <http://www.gnu.org/licenses/>.
##
-include ../defines.mk
+include $(SPREADAVR_PATH)/defines.mk
include $(LUFA_PATH)/LUFA/makefile
SRC:=$(foreach COMP,$(LUFA_COMPONENTS),$(LUFA_SRC_$(COMP)))