forked from duino-coin/duino-coin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 827 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 827 Bytes
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
ARDUINO_BOARD?=uno
ARDUINO_BASE?=/usr/share/arduino
BUILD_DIR?=$(shell pwd)/build
default: all
$(BUILD_DIR)/$(ARDUINO_BOARD):
mkdir -p $(BUILD_DIR)/$(ARDUINO_BOARD)
$(BUILD_DIR)/$(ARDUINO_BOARD)/Arduino_Code.ino.hex: $(BUILD_DIR)/$(ARDUINO_BOARD)
arduino-builder -verbose -hardware $(ARDUINO_BASE)/hardware \
-tools $(ARDUINO_BASE)/hardware/tools \
-build-path $(BUILD_DIR)/$(ARDUINO_BOARD) \
-fqbn arduino:avr:$(ARDUINO_BOARD) \
Arduino_Code.ino
all: $(BUILD_DIR)/$(ARDUINO_BOARD)/Arduino_Code.ino.hex
upload: $(BUILD_DIR)/$(ARDUINO_BOARD)/Arduino_Code.ino.hex
@if [ -z "$(ARDUINO_PORT)" ]; then \
echo "ARDUINO_PORT is not defined!"; \
exit 1; \
fi
avrdude -c arduino -P $(ARDUINO_PORT) -p atmega328p -b 115200 -U flash:w:$(BUILD_DIR)/$(ARDUINO_BOARD)/Arduino_Code.ino.hex
clean:
rm -rf $(BUILD_DIR)