Skip to content

Instantly share code, notes, and snippets.

@RyanScottLewis
Last active September 14, 2017 00:22
Show Gist options
  • Save RyanScottLewis/d8b0ffaf79b85f9250525c69a922f20b to your computer and use it in GitHub Desktop.
Save RyanScottLewis/d8b0ffaf79b85f9250525c69a922f20b to your computer and use it in GitHub Desktop.
Example Arduino Makefile
ARDMK_DIR = /usr/local/opt/arduino-mk
MONITOR_PORT = /dev/tty.usbmodem1421 # NOTE: This will have to be updated to the path of the Arduino device
ISP_PROG = arduino
ISP_PORT = $(MONITOR_PORT)
CFLAGS_STD = -std=gnu11
CXXFLAGS_STD = -std=gnu++11
CXXFLAGS += -pedantic -Wall -Wextra
OBJDIR = bin/$(BOARD_TAG)/$(CURRENT_DIR)
USER_LIB_PATH = lib
# -- Host Settings
# # Linux
# ARDUINO_DIR = /usr/share/arduino
# AVR_TOOLS_DIR = /usr
# AVRDUDE = /usr/bin/avrdude
# Mac + Homebrew
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
AVR_TOOLS_DIR = /usr/local
AVRDUDE = /usr/local/bin/avrdude
# -- Microcontroller Settings
BOARD_TAG = uno
include $(ARDMK_DIR)/Arduino.mk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment