Commit d2e8179c210327a723565a0be67d50c6dc4bdbb4

Steffen Jaeckel 2017-05-09T14:24:41

install per default to `/usr/local`

diff --git a/makefile.include b/makefile.include
index c862f0f..d09dc38 100644
--- a/makefile.include
+++ b/makefile.include
@@ -71,9 +71,10 @@ test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
 #LIBPATH-The directory for libtommath to be installed to.
 #INCPATH-The directory to install the header files for libtommath.
 #DATAPATH-The directory to install the pdf docs.
-LIBPATH?=/usr/lib
-INCPATH?=/usr/include
-DATAPATH?=/usr/share/doc/libtommath/pdf
+DESTDIR  ?= /usr/local
+LIBPATH  ?= $(DESTDIR)/lib
+INCPATH  ?= $(DESTDIR)/include
+DATAPATH ?= $(DESTDIR)/share/doc/libtommath/pdf
 
 #make the code coverage of the library
 #
diff --git a/makefile.shared b/makefile.shared
index 559720e..02d6fcc 100644
--- a/makefile.shared
+++ b/makefile.shared
@@ -51,10 +51,10 @@ $(LIBNAME):  $(OBJECTS)
 	$(LT) --mode=link --tag=CC $(CC) $(LDFLAGS) *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO)
 
 install: $(LIBNAME)
-	install -d $(DESTDIR)$(LIBPATH)
-	install -d $(DESTDIR)$(INCPATH)
-	$(LT) --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
-	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
+	install -d $(LIBPATH)
+	install -d $(INCPATH)
+	$(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME)
+	install -m 644 $(HEADERS_PUB) $(INCPATH)
 
 test: $(LIBNAME) demo/demo.o
 	$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o