]> git.corax.cc Git - toolbox/commitdiff
toolbox: Add Makefile for easy installation
authorMatthias Kruk <m@m10k.eu>
Wed, 24 Mar 2021 23:30:38 +0000 (08:30 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 24 Mar 2021 23:30:38 +0000 (08:30 +0900)
This commit adds a Makefile that can be used to easily install and
uninstall the toolbox.

Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..4681690
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+PHONY = install uninstall
+
+ifeq ($(PREFIX), )
+       PREFIX = /usr/local
+endif
+
+all:
+
+clean:
+
+install:
+       mkdir -p $(DESTDIR)/$(PREFIX)/share/toolbox
+       mkdir -p $(DESTDIR)/$(PREFIX)/bin
+       cp toolbox.sh $(DESTDIR)/$(PREFIX)/share/toolbox/.
+       cp -r include $(DESTDIR)/$(PREFIX)/share/toolbox/.
+       chown -R root.root $(DESTDIR)/$(PREFIX)/share/toolbox
+       find $(DESTDIR)/$(PREFIX)/share/toolbox -type d -exec chmod 755 {} \;
+       find $(DESTDIR)/$(PREFIX)/share/toolbox -type f -exec chmod 644 {} \;
+       chmod -R 755 $(DESTDIR)/$(PREFIX)/share/toolbox
+       ln -sf $(DESTDIR)/$(PREFIX)/share/toolbox/toolbox.sh $(DESTDIR)/$(PREFIX)/bin/toolbox.sh
+
+uninstall:
+       rm $(DESTDIR)/$(PREFIX)/bin/toolbox.sh
+       rm -rf $(DESTDIR)/$(PREFIX)/share/toolbox
+
+.PHONY: $(PHONY)