Makefile 910 Bytes
Newer Older
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
BOARD := uno
PIODIR := .pio
MAKEFILEDIR := $(shell python -c "import os; print(os.path.dirname(\
							 	 '$(shell readlink Makefile)'))")
PIOMAN := python3 $(MAKEFILEDIR)/pioman.py
QTSERMON := python3 $(MAKEFILEDIR)/qtsermon.py

.PHONY: build monitor uno due nano mega qtsermon picocom clean baka

all: build monitor

monitor: qtsermon

build:
	$(PIOMAN) build --board $(BOARD) --pio-dir $(PIODIR)

uno:
	$(PIOMAN) build --board uno --pio-dir $(PIODIR)

due:
	$(PIOMAN) build --board diecimilaatmega328 --pio-dir $(PIODIR)

nano:
	$(PIOMAN) build --board nanoatmega328 --pio-dir $(PIODIR)

mega:
	$(PIOMAN) build --board megaatmega2560 --pio-dir $(PIODIR)

qtsermon:
	$(QTSERMON) --baud $(shell $(PIOMAN) getbaud)

picocom:
	picocom --baud $(shell $(GET_BAUD)) $(shell $(GET_PORT))

getbaud:
	@ $(PIOMAN) getbaud

clean:
	rm -rf $(PIODIR) .travis.yml

define GET_PORT
	platformio device list | head -1
endef