From b0cda05d079c76f64571da332b075295a0d19cb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luk=C3=A1=C5=A1=20Ji=C5=99i=C5=A1t=C4=9B?= Date: Tue, 22 Oct 2024 10:27:16 +0200 Subject: [PATCH] Add Makefile for building and uploading to UNO The Makefile uses arduino-cli. --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2cfbb78 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ + +MAINCMD := arduino-cli compile --upload --verify + +FQBN := arduino:avr:uno +PORT := /dev/ttyACM0 + +MAINCMD += --port $(PORT) +MAINCMD += --fqbn $(FQBN) + +ifneq ("$(wildcard .verbose)","") + MAINCMD += --verbose +endif + +SRCS := Servomatic.ino \ + + +NAME := Servomatic + +all : $(NAME) + +$(NAME) : $(NAME).ino + $(MAINCMD) $< + touch $(NAME) + +verbose : .verbose + +noverbose : + if [ -f .verbose ]; then rm .verbose && $(MAKE) re; fi + +re : fclean + $(MAKE) + +clean : + +fclean : clean + $(RM) $(NAME) + +.% : + if [ ! -f $@ ]; then touch $@ && $(MAKE) re; fi -- 2.30.2