summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorbryan <bryan@veltar.systems>2026-08-27 10:49:41 +0200
committerbryan <bryan@veltar.systems>2026-08-27 10:49:41 +0200
commita6a2ea7ff0f1d0ef47f4797b72c7faae65d0bb54 (patch)
treecaa636959e49cdf0fec7ebc75997224d59ce296a /Makefile
parent002742ad5b1fd76d539c2fb8736622e63e757f98 (diff)
downloadprtmib-a6a2ea7ff0f1d0ef47f4797b72c7faae65d0bb54.tar.gz
prtmib-a6a2ea7ff0f1d0ef47f4797b72c7faae65d0bb54.zip
Add make install for Windows and Linux.
Windows copies prtmib.exe to %USERPROFILE%\.local\bin. Linux installs to /usr/local/bin. PREFIX and DESTDIR work as usual.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 0bc4f23..ec05565 100644
--- a/Makefile
+++ b/Makefile
@@ -13,4 +13,23 @@ prtmib$(EXE): $(SRC) $(HDR)
clean:
-$(RM) prtmib$(EXE)
-.PHONY: all clean
+ifeq ($(OS),Windows_NT)
+install: all
+ -mkdir "$(subst /,\,$(DESTDIR)$(BINDIR))"
+ copy /Y prtmib$(EXE) "$(subst /,\,$(DESTDIR)$(BINDIR)/prtmib$(EXE))"
+ @echo installed to $(DESTDIR)$(BINDIR)/prtmib$(EXE)
+
+uninstall:
+ -$(RM) "$(subst /,\,$(DESTDIR)$(BINDIR)/prtmib$(EXE))"
+else
+install: all
+ mkdir -p "$(DESTDIR)$(BINDIR)"
+ cp -f prtmib$(EXE) "$(DESTDIR)$(BINDIR)/prtmib$(EXE)"
+ chmod 755 "$(DESTDIR)$(BINDIR)/prtmib$(EXE)"
+ @echo installed to $(DESTDIR)$(BINDIR)/prtmib$(EXE)
+
+uninstall:
+ rm -f "$(DESTDIR)$(BINDIR)/prtmib$(EXE)"
+endif
+
+.PHONY: all clean install uninstall