aboutsummaryrefslogtreecommitdiff
path: root/system/maxcso/install.patch
blob: f91f09eba926d6b3138efe0fadbd9331ca5964a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 06c234d2734a2f129aa5cbc1cf8332594813343d Mon Sep 17 00:00:00 2001
From: orbea <orbea@fredslev.dk>
Date: Thu, 22 Nov 2018 12:04:28 -0800
Subject: [PATCH] Makefile: Add install and uninstall targets.

---
 Makefile | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Makefile b/Makefile
index e66826da..54a6489c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+
 CC ?= gcc
 CXX ?= g++
 
@@ -29,6 +32,14 @@ maxcso: $(SRC_CXX_OBJ) $(CLI_CXX_OBJ) $(ZOPFLI_C_OBJ) 7zip/7zip.a
 7zip/7zip.a:
 	$(MAKE) -C 7zip 7zip.a
 
+install:
+	mkdir -p $(DESTDIR)$(BINDIR)
+	cp maxcso $(DESTDIR)$(BINDIR)
+	chmod 0755 $(DESTDIR)$(BINDIR)/maxcso
+
+uninstall:
+	rm -f $(DESTDIR)$(BINDIR)/maxcso
+
 clean:
 	rm -f $(SRC_CXX_OBJ) $(CLI_CXX_OBJ) $(ZOPFLI_C_OBJ) maxcso
 	$(MAKE) -C 7zip clean