File: Makefile

package info (click to toggle)
arduino-mk 1.5.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 456 kB
  • sloc: sh: 292; ansic: 113; makefile: 67; python: 40
file content (46 lines) | stat: -rw-r--r-- 1,447 bytes parent folder | download | duplicates (2)
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
# Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile

# Tested and working with a linuxspi programmer on a remote Raspberry Pi
# Refer to https://github.com/kcuzner/avrdude for linuxspi.
# Should work with ISP as well if you replace $(AVRDUDE_ARD_OPTS) with
# $(AVRDUDE_ISP_OPTS) in the net_set_fuses rule.

# Alternate core from https://code.google.com/p/arduino-tiny
ALTERNATE_CORE = tiny
BOARD_TAG = attiny85at8

# Avrdude config path on the remote Raspberry Pi
AVRDUDE_CONF=/usr/local/etc/avrdude.conf

# Skip the monitor port existance check since it's not on our machine.
FORCE_MONITOR_PORT=true
MONITOR_PORT=/dev/spidev0.0

include ../../Arduino.mk


# Additional rules to use a remote Raspberry Pi programmer

# Note that it's recommended not to use root for this task,
# but to setup spidev access on a normal user instead.
HOST = root@alarmpi
SSH_AVRDUDE = ssh $(HOST) /usr/local/bin/avrdude

CAT_HEX = cat $(TARGET_HEX)
AVRDUDE_UPLOAD_PIPE = -U flash:w:-:i

.PHONY: net_upload net_set_fuses

net_upload: $(TARGET_HEX) verify_size
	$(CAT_HEX) | $(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
		$(AVRDUDE_UPLOAD_PIPE)

net_set_fuses:
ifneq ($(strip $(AVRDUDE_ISP_FUSES_PRE)),)
		$(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) -e \
		$(AVRDUDE_ISP_FUSES_PRE)
endif
ifneq ($(strip $(AVRDUDE_ISP_FUSES_POST)),)
		$(SSH_AVRDUDE) $(AVRDUDE_COM_OPTS) $(AVRDUDE_ARD_OPTS) \
		$(AVRDUDE_ISP_FUSES_POST)
endif