aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-02-18 20:49:37 -0500
committerYour Name <you@example.com>2022-02-18 20:49:37 -0500
commit200fdab221b2b9bf4954bad9c778512a5134a787 (patch)
treed0c096be401ca3796d6d44dc08a853ceda362c63
parent55d58a16e2511741cc625e203205dec86144faf3 (diff)
downloadlibbible-200fdab221b2b9bf4954bad9c778512a5134a787.tar.gz
libbible-200fdab221b2b9bf4954bad9c778512a5134a787.tar.bz2
libbible-200fdab221b2b9bf4954bad9c778512a5134a787.zip
Updated installation to respect overriden prefix etc
-rw-r--r--Makefile18
1 files changed, 11 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 40d2712..b1ad36b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,11 @@ OBJECTS = $(SOURCES:.cc=.o)
DEPS = $(OBJECTS:.o=.d)
EXECUTABLE = bible
LIBRARY = libbible.so
-PREFIX := /usr
+PREFIX ?= /usr
+EXEC_PREFIX ?= $(PREFIX)
+LIBDIR ?= $(EXEC_PREFIX)/lib
+BINDIR ?= $(EXEC_PREFIX)/bin
+INCLUDEDIR ?= $(PREFIX)/include
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) -o $@ $(LDFLAGS)
@@ -21,12 +25,12 @@ test: $(LIBRARY)
$(MAKE) -C src/test/ test
install: $(LIBRARY) $(EXECUTABLE)
- install -d $(DESTDIR)$(PREFIX)/lib/
- install -m 644 $(LIBRARY) $(DESTDIR)$(PREFIX)/lib/
- install -d $(DESTDIR)$(PREFIX)/include/
- install -m 644 src/lib/libbible.h $(DESTDIR)$(PREFIX)/include/
- install -d $(DESTDIR)$(PREFIX)/bin/
- install -m 755 $(EXECUTABLE) $(DESTDIR)$(PREFIX)/bin/
+ install -d $(DESTDIR)$(LIBDIR)
+ install -m 644 $(LIBRARY) $(DESTDIR)$(LIBDIR)
+ install -d $(DESTDIR)$(INCLUDEDIR)
+ install -m 644 src/lib/libbible.h $(DESTDIR)$(INCLUDEDIR)
+ install -d $(DESTDIR)$(BINDIR)
+ install -m 755 $(EXECUTABLE) $(DESTDIR)$(BINDIR)
install -d $(DESTDIR)`pkg-config --variable=completionsdir bash-completion`
install -m 644 bible.bash $(DESTDIR)`pkg-config --variable=completionsdir bash-completion`/$(EXECUTABLE)