forked from lorf/CA3162E-emulator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
31 lines (24 loc) · 805 Bytes
/
Makefile
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
# Makefile for Arduino IDE >= 1.5.8
ARDUINO ?= arduino
PKG ?= arduino-bare
ARCH ?= avr
BOARD ?= atmega8o_8mhz_noxtal
CPU ?=
PORT ?= /dev/ttyUSB0
SRC ?= $(wildcard *.ino *.pde)
RESULT ?= ${BUILD_DIR}/$(patsubst %.ino,%.cpp.hex,$(patsubst %.pde,%.cpp.hex,$(firstword $(SRC))))
ifneq (${CPU},)
BOARD_TAG ?= ${PKG}-${ARCH}-${BOARD}-${CPU}
BOARD_SPEC ?= ${PKG}:${ARCH}:${BOARD}:cpu=${CPU}
else
BOARD_TAG ?= ${PKG}-${ARCH}-${BOARD}
BOARD_SPEC ?= ${PKG}:${ARCH}:${BOARD}
endif
BUILD_DIR ?= build-${BOARD_TAG}
all: ${RESULT}
upload: ${RESULT}
${ARDUINO} --pref build.path=${BUILD_DIR} --board ${BOARD_SPEC} --verbose --upload --port ${PORT} ${SRC}
${BUILD_DIR}/%.cpp.hex: %.ino
${ARDUINO} --pref build.path=${BUILD_DIR} --board ${BOARD_SPEC} --verbose --verify $<
clean:
rm -rf ${BUILD_DIR}