2012-04-02 16:50:00 +02:00
|
|
|
#
|
|
|
|
# chipKIT extensions for Arduino Makefile
|
|
|
|
# System part (i.e. project independent)
|
|
|
|
#
|
|
|
|
# Copyright (C) 2011 Christopher Peplin <chris.peplin@rhubarbtech.com>,
|
|
|
|
# based on work that is Copyright Martin Oldfield
|
|
|
|
#
|
|
|
|
# This file is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Lesser General Public License as
|
|
|
|
# published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
# License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
OSTYPE := $(shell uname)
|
|
|
|
|
2012-04-02 21:43:40 +02:00
|
|
|
ifeq ($(wildcard $(MPIDE_DIR)),)
|
|
|
|
$(error "Error: the MPIDE_DIR variable must point to your MPIDE installation")
|
|
|
|
endif
|
|
|
|
|
|
|
|
ARDUINO_DIR = $(MPIDE_DIR)
|
|
|
|
|
2012-04-02 22:09:55 +02:00
|
|
|
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools/bin/
|
2012-04-02 16:50:00 +02:00
|
|
|
|
|
|
|
ifneq ($(OSTYPE),Linux)
|
|
|
|
AVRDUDE_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin
|
|
|
|
else
|
|
|
|
AVRDUDE_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(OSTYPE),Linux)
|
|
|
|
AVRDUDE_ETC_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc
|
|
|
|
else
|
|
|
|
AVRDUDE_ETC_PATH = $(AVRDUDE_TOOLS_PATH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/pic32/cores/pic32
|
|
|
|
ARDUINO_LIB_PATH = $(ARDUINO_DIR)/hardware/pic32/libraries
|
|
|
|
BOARDS_TXT = $(ARDUINO_DIR)/hardware/pic32/boards.txt
|
|
|
|
ARDUINO_VAR_PATH = $(ARDUINO_DIR)/hardware/pic32/variants
|
|
|
|
ARDUINO_VERSION = 23
|
|
|
|
|
|
|
|
CC_NAME = pic32-gcc
|
|
|
|
CXX_NAME = pic32-g++
|
|
|
|
AR_NAME = pic32-ar
|
|
|
|
OBJDUMP_NAME = pic32-objdump
|
|
|
|
OBJCOPY_NAME = pic32-objcopy
|
|
|
|
|
|
|
|
MCU_FLAG_NAME=mprocessor
|
2012-04-03 18:01:58 +02:00
|
|
|
LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript)
|
2012-04-02 23:19:39 +02:00
|
|
|
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
2012-04-02 16:50:00 +02:00
|
|
|
EXTRA_LDFLAGS = -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
|
2012-04-02 22:41:54 +02:00
|
|
|
EXTRA_CPPFLAGS = -mno-smart-io -D$(BOARD)
|
2012-04-02 16:50:00 +02:00
|
|
|
|
|
|
|
CHIPKIT_MK_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
|
|
|
|
|
|
|
|
include $(CHIPKIT_MK_PATH)/Arduino.mk
|
|
|
|
|
2012-04-02 23:19:39 +02:00
|
|
|
ifeq ($(OSTYPE),Linux)
|
2012-04-02 16:50:00 +02:00
|
|
|
# MPIDE still comes with the compilers on Linux, unlike Arduino
|
2012-04-02 22:09:55 +02:00
|
|
|
CC := $(addprefix $(AVR_TOOLS_PATH),$(CC))
|
|
|
|
CXX := $(addprefix $(AVR_TOOLS_PATH),$(CXX))
|
|
|
|
OBJCOPY := $(addprefix $(AVR_TOOLS_PATH),$(OBJCOPY))
|
|
|
|
OBJDUMP := $(addprefix $(AVR_TOOLS_PATH),$(OBJDUMP))
|
|
|
|
AR := $(addprefix $(AVR_TOOLS_PATH),$(AR))
|
|
|
|
SIZE := $(addprefix $(AVR_TOOLS_PATH),$(SIZE))
|
|
|
|
NM := $(addprefix $(AVR_TOOLS_PATH),$(NM))
|
2012-04-02 23:19:39 +02:00
|
|
|
endif
|