From 0dae8a68749c648f3df63d25930a52d4f60dce0f Mon Sep 17 00:00:00 2001 From: pgrondek Date: Sun, 23 Feb 2020 21:43:50 +0100 Subject: [PATCH] [Arduino] add makefile --- arduino/Makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 arduino/Makefile diff --git a/arduino/Makefile b/arduino/Makefile new file mode 100644 index 0000000..0a3d4a4 --- /dev/null +++ b/arduino/Makefile @@ -0,0 +1,28 @@ +HOME_BIN_DIR=$(HOME)/bin +HOME_BIN_LINK=$(HOME_BIN_DIR)/arduino + +ifeq ("x86_64","$(shell uname -m)") +ARCH=linux64 +else +ARCH=unknown +endif + +ARDUINO_VERSION=1.8.12 +ARDUINO_URL=https://downloads.arduino.cc/arduino-$(ARDUINO_VERSION)-$(ARCH).tar.xz +TMPDIR:=$(shell mktemp -d) + +SUDO=sudo +OUT_DIR=/opt/arduino + +.PHONY: install + +clean: + $(SUDO) rm -rf $(OUT_DIR) + rm -rf $(HOME_BIN_LINK) + +install: + wget -qO- $(ARDUINO_URL) | tar xJ -C $(TMPDIR) + $(SUDO) cp -r $(TMPDIR)/arduino-$(ARDUINO_VERSION) $(OUT_DIR) + $(SUDO) chmod 755 $(OUT_DIR) + $(SUDO) rm -rf $(TMPDIR) + ln -s $(OUT_DIR)/arduino $(HOME_BIN_LINK)