update install steps in makefiles - add tommath_private.h to HEADERS - only install public header files - move more shared stuff to makefile.include - make it possible to override the *PATH makefile variables
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
diff --git a/makefile b/makefile
index 576dcd1..aec9982 100644
--- a/makefile
+++ b/makefile
@@ -19,19 +19,6 @@ VERSION=0.43.0
include makefile.include
-#install as this user
-ifndef INSTALL_GROUP
- GROUP=wheel
-else
- GROUP=$(INSTALL_GROUP)
-endif
-
-ifndef INSTALL_USER
- USER=root
-else
- USER=$(INSTALL_USER)
-endif
-
#default files to install
ifndef LIBNAME
LIBNAME=libtommath.a
@@ -39,14 +26,6 @@ endif
default: ${LIBNAME}
-#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.
-DESTDIR=
-LIBPATH=/usr/lib
-INCPATH=/usr/include
-DATAPATH=/usr/share/doc/libtommath/pdf
-
#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
@@ -124,7 +103,7 @@ install: $(LIBNAME)
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
- install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
+ install -g $(GROUP) -o $(USER) $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
test: $(LIBNAME) demo/demo.o
$(CC) $(CFLAGS) demo/demo.o $(LIBNAME) $(LFLAGS) -o test
diff --git a/makefile.include b/makefile.include
index a6c5a66..7f12de6 100644
--- a/makefile.include
+++ b/makefile.include
@@ -47,8 +47,28 @@ endif
endif # COMPILE_SIZE
endif # COMPILE_DEBUG
-HEADERS=tommath.h tommath_class.h tommath_superclass.h
+HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h
+HEADERS=tommath_private.h $(HEADERS_PUB)
test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
+#install as this user
+ifndef INSTALL_GROUP
+ GROUP=wheel
+else
+ GROUP=$(INSTALL_GROUP)
+endif
+
+ifndef INSTALL_USER
+ USER=root
+else
+ USER=$(INSTALL_USER)
+endif
+
+#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
diff --git a/makefile.shared b/makefile.shared
index 4adb400..f8b7760 100644
--- a/makefile.shared
+++ b/makefile.shared
@@ -8,19 +8,6 @@ include makefile.include
LT ?= libtool
LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
-#install as this user
-ifndef INSTALL_GROUP
- GROUP=wheel
-else
- GROUP=$(INSTALL_GROUP)
-endif
-
-ifndef INSTALL_USER
- USER=root
-else
- USER=$(INSTALL_USER)
-endif
-
default: libtommath.la
#default files to install
@@ -31,14 +18,6 @@ ifndef LIBNAME_S
LIBNAME_S=libtommath.a
endif
-#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.
-DESTDIR=
-LIBPATH=/usr/lib
-INCPATH=/usr/include
-DATAPATH=/usr/share/doc/libtommath/pdf
-
#START_INS
OBJECTS=bncore.o bn_error.o bn_fast_mp_invmod.o bn_fast_mp_montgomery_reduce.o bn_fast_s_mp_mul_digs.o \
bn_fast_s_mp_mul_high_digs.o bn_fast_s_mp_sqr.o bn_mp_2expt.o bn_mp_abs.o bn_mp_add.o bn_mp_add_d.o \
@@ -79,7 +58,7 @@ install: $(LIBNAME)
install -d $(DESTDIR)$(LIBPATH)
$(LT) --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
install -d $(DESTDIR)$(INCPATH)
- install -m 644 $(HEADERS) $(DESTDIR)$(INCPATH)
+ install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
test: $(LIBNAME) demo/demo.o
$(CC) $(CFLAGS) -c demo/demo.c -o demo/demo.o