aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDmitrij D. Czarkoff <czarkoff@gmail.com>2015-12-25 15:29:12 +0100
committerDmitrij D. Czarkoff <czarkoff@gmail.com>2015-12-25 15:29:12 +0100
commit77827c838e36e39471f2f23338f76e5ace2404c4 (patch)
tree13bc4fd9649255e7cc6e5472afa14116cdc676dc /Makefile
parent6de6b358e81251bcf9c978b04452d2390d46a388 (diff)
downloadimv-77827c838e36e39471f2f23338f76e5ace2404c4.tar.gz
Make installation locations more configurable
This might be desired when platform has its own, custom layout (eg. OpenBSD or Solaris), or when user wants to install the program to his home directory.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f002847..fb3d07e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,9 @@
.PHONY: clean check install uninstall
PREFIX ?= /usr
+BINPREFIX ?= $(PREFIX)/bin
+MANPREFIX ?= $(PREFIX)/share/man
+DATAPREFIX ?= $(PREFIX)/share
CFLAGS ?= -W -Wall -Wpedantic
CFLAGS += -std=gnu11 $(shell sdl2-config --cflags)
@@ -41,9 +44,9 @@ clean:
@$(RM) $(TARGET) $(OBJECTS) $(TESTS)
install: $(TARGET)
- install -D -m 0755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/imv
- install -D -m 0644 doc/imv.1 $(DESTDIR)$(PREFIX)/share/man/man1/imv.1
- install -D -m 0644 files/imv.desktop $(DESTDIR)$(PREFIX)/share/applications/imv.desktop
+ install -D -m 0755 $(TARGET) $(DESTDIR)$(BINPREFIX)/imv
+ install -D -m 0644 doc/imv.1 $(DESTDIR)$(MANPREFIX)/man1/imv.1
+ install -D -m 0644 files/imv.desktop $(DESTDIR)$(DATAPREFIX)/applications/imv.desktop
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/imv