This repository has been archived by the owner on Nov 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
chipKIT.mk
79 lines (64 loc) · 2.19 KB
/
chipKIT.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# chipKIT extensions for Arduino Makefile
# System part (i.e. project independent)
#
# Copyright (C) 2011 Christopher Peplin <[email protected]>,
# 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.
#
#
# Modified by John Wallbank for Visual Studio
#
# Development changes, John Wallbank,
#
# - made inclusion of WProgram.h optional so that
# including it in the source doesn't mess up compile error line numbers
# - parameterised the routine used to reset the serial port
#
OSTYPE := $(shell uname)
ifeq ($(wildcard $(MPIDE_DIR)),)
$(error "Error: the MPIDE_DIR variable must point to your MPIDE installation")
endif
ARDUINO_DIR = $(MPIDE_DIR)
AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools/bin/
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
VARIANTS_PATH = $(ARDUINO_DIR)/hardware/pic32/variants
ARDUINO_VERSION = 23
ifndef ARDUINO_PREFERENCES_PATH
ifeq ($(OSTYPE),Linux)
ARDUINO_PREFERENCES_PATH = $(HOME)/.mpide/preferences.txt
else
ARDUINO_PREFERENCES_PATH = $(HOME)/Library/Mpide/preferences.txt
endif
endif
CC_NAME = pic32-gcc
CXX_NAME = pic32-g++
AR_NAME = pic32-ar
OBJDUMP_NAME = pic32-objdump
OBJCOPY_NAME = pic32-objcopy
ifndef $(CORE_INCLUDE_NAME)
CORE_INCLUDE_NAME="WProgram.h"
endif
LDSCRIPT = $(call PARSE_BOARD,$(BOARD_TAG),ldscript)
LDSCRIPT_FILE = $(ARDUINO_CORE_PATH)/$(LDSCRIPT)
MCU_FLAG_NAME=mprocessor
EXTRA_LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(LDSCRIPT)
EXTRA_CPPFLAGS += -mno-smart-io -fno-short-double
CHIPKIT_MK_PATH := $(dir $(lastword $(MAKEFILE_LIST)))
include $(CHIPKIT_MK_PATH)Arduino.mk