Commit 141a98931eefd4491eb06ff474efc2fe74f393cf

Steffen Jaeckel 2017-05-10T11:37:48

fixup install and clean

diff --git a/doc/makefile b/doc/makefile
index fcc47c9..a5ebb6f 100644
--- a/doc/makefile
+++ b/doc/makefile
@@ -42,7 +42,7 @@ poster: poster.tex
 docs: docdvi
 	dvipdf tommath
 	rm -f tommath.log tommath.aux tommath.dvi tommath.idx tommath.toc tommath.lof tommath.ind tommath.ilg
-	cd pics ; MAKE=${MAKE} ${MAKE} clean
+	${MAKE} -C pics/ clean MAKE=${MAKE}
 
 #LTM user manual
 mandvi: bn.tex
@@ -67,3 +67,7 @@ manual:	mandvi
 	sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' bn.pdf
 	mv bn.bak bn.tex
 	rm -f bn.aux bn.dvi bn.log bn.idx bn.lof bn.out bn.toc
+
+clean:
+	${MAKE} -C pics/ clean MAKE=${MAKE}
+	rm -f *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log tommath.tex
diff --git a/makefile b/makefile
index 3fd47d2..5812fe4 100644
--- a/makefile
+++ b/makefile
@@ -83,10 +83,10 @@ profiled_single:
 	ranlib $(LIBNAME)
 
 install: $(LIBNAME)
-	install -d $(DESTDIR)$(LIBPATH)
-	install -d $(DESTDIR)$(INCPATH)
-	install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)
-	install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
+	install -d $(LIBPATH)
+	install -d $(INCPATH)
+	install -m 644 $(LIBNAME) $(LIBPATH)
+	install -m 644 $(HEADERS_PUB) $(INCPATH)
 
 test: $(LIBNAME) demo/demo.o
 	$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) $(LFLAGS) -o test
diff --git a/makefile.include b/makefile.include
index d09dc38..4db2fdf 100644
--- a/makefile.include
+++ b/makefile.include
@@ -102,5 +102,5 @@ clean:
 	rm -f *.gcda *.gcno *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \
         *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
 	rm -rf .libs/
-	cd etc ; MAKE=${MAKE} ${MAKE} clean
-	cd pics ; MAKE=${MAKE} ${MAKE} clean
+	${MAKE} -C etc/ clean MAKE=${MAKE}
+	${MAKE} -C doc/ clean MAKE=${MAKE}
diff --git a/makefile.shared b/makefile.shared
index 13c8eaf..4e9bf85 100644
--- a/makefile.shared
+++ b/makefile.shared
@@ -53,7 +53,7 @@ $(LIBNAME):  $(OBJECTS)
 install: $(LIBNAME)
 	install -d $(LIBPATH)
 	install -d $(INCPATH)
-	$(LT) --mode=install install -c $(LIBNAME) $(LIBPATH)/$(LIBNAME)
+	$(LT) --mode=install install -m 644 $(LIBNAME) $(LIBPATH)/$(LIBNAME)
 	install -m 644 $(HEADERS_PUB) $(INCPATH)
 	sed -e 's,^prefix=.*,prefix=$(DESTDIR),' -e 's,^Version:.*,Version: $(VERSION),' libtommath.pc.in > libtommath.pc
 	install -d $(LIBPATH)/pkgconfig