From 77827c838e36e39471f2f23338f76e5ace2404c4 Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Fri, 25 Dec 2015 15:29:12 +0100 Subject: 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. --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3