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)
commit26f5dd27bff32dd05b568f2b116a04f01d96c05a (patch)
treee0c3d30912f2b67d620d935f3dead47ac4f3533d /libtommath/makefile
parent163b211fb73a0d795aa73236805b5b97386dd4f3 (diff)
downloadtcl-26f5dd27bff32dd05b568f2b116a04f01d96c05a.zip
tcl-26f5dd27bff32dd05b568f2b116a04f01d96c05a.tar.gz
tcl-26f5dd27bff32dd05b568f2b116a04f01d96c05a.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) ; \