55
66# ## PROJECT_DIR
77# ## This is the path to where you have created/cloned your project
8- PROJECT_DIR = $(shell dirname $(shell dirname $(shell pwd) ) )
9-
10- # ## AVR_GCC_VERSION
11- # ## Check if the version is equal or higher than 4.9
12- AVR_GCC_VERSION := $(shell expr `avr-gcc -dumpversion | cut -f1` \>= 4.9)
8+ PROJECT_DIR = $(shell dirname $(shell pwd) )
139
1410# ## ARDMK_DIR
1511# ## Path to the Arduino-Makefile directory.
@@ -19,7 +15,7 @@ ARDMK_DIR = $(PROJECT_DIR)/Arduino-Makefile
1915# ## Path to the Arduino application and ressources directory.
2016# ## For Arduino IDE 1.0.x
2117# ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
22- # ## For Arduino IDE 1.6.x
18+ # ## For Arduino IDE 1.6.x ++
2319ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
2420
2521# ## USER_LIB_PATH
@@ -36,6 +32,10 @@ USER_LIB_PATH := $(realpath $(PROJECT_DIR)/lib)
3632BOARD_TAG = mega
3733BOARD_SUB = atmega2560
3834
35+ # ## MONITOR_PORT
36+ # ## The port your board is connected to. Using an '*' tries all the ports and finds the right one.
37+ MONITOR_PORT = /dev/tty.usbmodem*
38+
3939# ## MONITOR_BAUDRATE
4040# ## It must be set to Serial baudrate value you are using.
4141MONITOR_BAUDRATE = 115200
@@ -46,31 +46,27 @@ AVR_TOOLS_DIR = /usr/local
4646
4747# ## AVRDUDE
4848# ## Path to avrdude directory.
49- AVRDUDE = /usr/local/bin/avrdude
49+ AVRDUDE = /usr/local/bin/avrdude
5050
5151# ## CFLAGS_STD
5252CFLAGS_STD = -std=gnu11
5353
5454# ## CXXFLAGS_STD
55- CXXFLAGS_STD = -std=gnu++11
55+ # ## You can choose wich ever you like
56+ # CXXFLAGS_STD = -std=gnu++11
57+ CXXFLAGS_STD = -std=gnu++17
5658
5759# ## CPPFLAGS
5860# ## Flags you might want to set for debugging purpose. Comment to stop.
59- CXXFLAGS = -pedantic -Wall -Wextra
60-
61- # ## If avr-gcc -v is higher than 4.9, activate coloring of the output
62- ifeq "$(AVR_GCC_VERSION ) " "1"
63- CXXFLAGS += -fdiagnostics-color
64- endif
65-
66- # ## MONITOR_PORT
67- # ## The port your board is connected to. Using an '*' tries all the ports and finds the right one.
68- MONITOR_PORT = /dev/tty.usbmodem*
61+ CXXFLAGS += -pedantic -Wall -Wextra
62+ LDFLAGS += -fdiagnostics-color
6963
7064# ## OBJDIR
65+ # ## Don't touch this!
7166# ## This is were you put the binaries you just compile using 'make'
7267CURRENT_DIR = $(shell basename $(CURDIR ) )
73- OBJDIR = $(PROJECT_DIR ) /bin /$(CURRENT_DIR ) /$(BOARD_TAG )
68+ OBJDIR = $(PROJECT_DIR ) /build /$(CURRENT_DIR ) /$(BOARD_TAG )
7469
7570# ## path to Arduino.mk, inside the ARDMK_DIR, don't touch.
7671include $(ARDMK_DIR ) /Arduino.mk
72+
0 commit comments