From: Lukáš Jiřiště Date: Tue, 22 Oct 2024 08:27:16 +0000 (+0200) Subject: Add Makefile for building and uploading to UNO X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=b0cda05d079c76f64571da332b075295a0d19cb7;p=Servomatic.git Add Makefile for building and uploading to UNO The Makefile uses arduino-cli. --- b0cda05d079c76f64571da332b075295a0d19cb7 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