forked from ladislas/Bare-Arduino-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-OSX.mk
78 lines (61 loc) · 2.71 KB
/
Makefile-OSX.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
### DISCLAIMER
### This is an example Makefile and it MUST be configured to suit your needs.
### For detailled explanations about all the avalaible options,
### please refer to https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md
### PROJECT_DIR
### This is the path to where you have created/cloned your project
PROJECT_DIR = /Users/{{ YOUR USERNAME }}/MyArduinoProject
# PROJECT_DIR = $(HOME)/dev/arduino/bare-arduino-project
### AVR_GCC_VERSION
### Check if the version is equal or higher than 4.9
AVR_GCC_VERSION := $(shell expr `avr-gcc -dumpversion | cut -f1` \>= 4.9)
### ARDMK_DIR
### Path to the Arduino-Makefile directory.
ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile
### ARDUINO_DIR
### Path to the Arduino application and ressources directory.
### For Arduino IDE 1.0.x
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
### For Arduino IDE 1.6.x
# ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
### USER_LIB_PATH
### Path to where the your project's libraries are stored.
USER_LIB_PATH := $(realpath $(PROJECT_DIR)/lib)
### BOARD_TAG & BOARD_SUB
### For Arduino IDE 1.0.x
### Only BOARD_TAG is needed. It must be set to the board you are currently using. (i.e uno, mega2560, etc.)
# BOARD_TAG = mega2560
### For Arduino IDE 1.6.x
### Both BOARD_TAG and BOARD_SUB are needed. They must be set to the board you are currently using. (i.e BOARD_TAG = uno, mega, etc. & BOARD_SUB = atmega2560, etc.)
### Note: for the Arduino Uno, only BOARD_TAG is mandatory and BOARD_SUB can be equal to anything
BOARD_TAG = mega
BOARD_SUB = atmega2560
### MONITOR_BAUDRATE
### It must be set to Serial baudrate value you are using.
MONITOR_BAUDRATE = 115200
### AVR_TOOLS_DIR
### Path to the AVR tools directory such as avr-gcc, avr-g++, etc.
AVR_TOOLS_DIR = /usr/local
### AVRDDUDE
### Path to avrdude directory.
AVRDDUDE = /usr/local/bin/avrdude
### CFLAGS_STD
CFLAGS_STD = -std=gnu11
### CXXFLAGS_STD
CXXFLAGS_STD = -std=gnu++11
### CPPFLAGS
### Flags you might want to set for debugging purpose. Comment to stop.
CXXFLAGS = -pedantic -Wall -Wextra
### If avr-gcc -v is higher than 4.9, activate coloring of the output
ifeq "$(AVR_GCC_VERSION)" "1"
CXXFLAGS += -fdiagnostics-color
endif
### MONITOR_PORT
### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
MONITOR_PORT = /dev/tty.usbmodem*
### OBJDIR
### This is were you put the binaries you just compile using 'make'
CURRENT_DIR = $(shell basename $(CURDIR))
OBJDIR = $(PROJECT_DIR)/bin/$(CURRENT_DIR)/$(BOARD_TAG)
### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
include $(ARDMK_DIR)/Arduino.mk