summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-05-15 15:36:37 +0200
committerxengineering <me@xengineering.eu>2022-05-15 15:36:37 +0200
commitb0f70f5498ae967bcf18b968b995398d1b03b04f (patch)
tree6a67372aa6778a979c4aef51444ff3cacba5e1e0
parent466dd4caeac90dace337c6604e770f0470aee495 (diff)
downloadwebiot-b0f70f5498ae967bcf18b968b995398d1b03b04f.tar
webiot-b0f70f5498ae967bcf18b968b995398d1b03b04f.tar.zst
webiot-b0f70f5498ae967bcf18b968b995398d1b03b04f.zip
Add Makefile
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..57d274f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+# vim: shiftwidth=4 tabstop=4 noexpandtab
+
+DESTDIR="" # leave empty for the current system or provide a fakeroot here
+PREFIX="/usr"
+PROGRAM="webiot"
+
+.PHONY: all clean install debug
+
+all:
+ # some recommended options for Go building:
+ # https://wiki.archlinux.org/title/Go_package_guidelines
+ mkdir -p build
+ go build -o build/$(PROGRAM) main.go hs100.go
+
+clean:
+ rm -rf build
+
+install: all
+ install -Dm 755 build/$(PROGRAM) $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
+ mkdir -p $(DESTDIR)/etc/$(PROGRAM)
+ install -Dm 644 config.json $(DESTDIR)/etc/$(PROGRAM)/
+
+debug:
+ go run main.go hs100.go -c private/config.json
+