summaryrefslogtreecommitdiffstats
path: root/libtommath/makefile
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-09-26 16:31:55 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-09-26 16:31:55 (GMT)
commit6285bbd18905331a696ae8d31942482672261433 (patch)
tree4ec07aa4ad5cdf752c1df248b9a54a4dd6cfb167 /libtommath/makefile
parent12cea33504df70df1758c94a2302e367e3855e43 (diff)
downloadtcl-6285bbd18905331a696ae8d31942482672261433.zip
tcl-6285bbd18905331a696ae8d31942482672261433.tar.gz
tcl-6285bbd18905331a696ae8d31942482672261433.tar.bz2
Import of libtommath 0.36
Diffstat (limited to 'libtommath/makefile')
-rw-r--r--libtommath/makefile51
1 files changed, 36 insertions, 15 deletions
diff --git a/libtommath/makefile b/libtommath/makefile
index 17873ee..a4697d4 100644
--- a/libtommath/makefile
+++ b/libtommath/makefile
@@ -3,12 +3,14 @@
#Tom St Denis
#version of library
-VERSION=0.35
+VERSION=0.36
CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
+ifndef IGNORE_SPEED
+
#for speed
-CFLAGS += -O3 -funroll-all-loops
+CFLAGS += -O3 -funroll-loops
#for size
#CFLAGS += -Os
@@ -19,14 +21,27 @@ CFLAGS += -fomit-frame-pointer
#debug
#CFLAGS += -g3
+endif
+
#install as this user
-USER=root
-GROUP=root
+ifndef INSTALL_GROUP
+ GROUP=wheel
+else
+ GROUP=$(INSTALL_GROUP)
+endif
+
+ifndef INSTALL_USER
+ USER=root
+else
+ USER=$(INSTALL_USER)
+endif
default: libtommath.a
#default files to install
-LIBNAME=libtommath.a
+ifndef LIBNAME
+ LIBNAME=libtommath.a
+endif
HEADERS=tommath.h tommath_class.h tommath_superclass.h
#LIBPATH-The directory for libtommath to be installed to.
@@ -65,9 +80,9 @@ bn_mp_prime_random_ex.o bn_mp_get_int.o bn_mp_sqrt.o bn_mp_is_square.o bn_mp_ini
bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o \
bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o
-libtommath.a: $(OBJECTS)
- $(AR) $(ARFLAGS) libtommath.a $(OBJECTS)
- ranlib libtommath.a
+$(LIBNAME): $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $(OBJECTS)
+ ranlib $@
#make a profiled library (takes a while!!!)
#
@@ -89,23 +104,23 @@ profiled_single:
./ltmtest
rm -f *.o ltmtest
$(CC) $(CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o
- $(AR) $(ARFLAGS) libtommath.a mpi.o
- ranlib libtommath.a
+ $(AR) $(ARFLAGS) $(LIBNAME) mpi.o
+ ranlib $(LIBNAME)
-install: libtommath.a
+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)
-test: libtommath.a demo/demo.o
- $(CC) $(CFLAGS) demo/demo.o libtommath.a -o test
+test: $(LIBNAME) demo/demo.o
+ $(CC) $(CFLAGS) demo/demo.o $(LIBNAME) -o test
mtest: test
cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest
-timing: libtommath.a
- $(CC) $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o ltmtest
+timing: $(LIBNAME)
+ $(CC) $(CFLAGS) -DTIMER demo/timing.c $(LIBNAME) -o ltmtest
# makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think]
docdvi: tommath.src
@@ -151,6 +166,12 @@ clean:
cd etc ; make clean
cd pics ; make clean
+#zipup the project (take that!)
+no_oops: clean
+ cd .. ; cvs commit
+ echo Scanning for scratch/dirty files
+ find . -type f | grep -v CVS | xargs -n 1 bash mess.sh
+
zipup: clean manual poster docs
perl gen.pl ; mv mpi.c pre_gen/ ; \
cd .. ; rm -rf ltm* libtommath-$(VERSION) ; mkdir libtommath-$(VERSION) ; \