comparison makefile @ 190:d8254fc979e9 libtommath-orig LTM_0.35

Initial import of libtommath 0.35
author Matt Johnston <matt@ucc.asn.au>
date Fri, 06 May 2005 08:59:30 +0000
parents d29b64170cf0
children
comparison
equal deleted inserted replaced
142:d29b64170cf0 190:d8254fc979e9
1 #Makefile for GCC 1 #Makefile for GCC
2 # 2 #
3 #Tom St Denis 3 #Tom St Denis
4
5 #version of library
6 VERSION=0.35
7
4 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare 8 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
5 9
6 #for speed 10 #for speed
7 CFLAGS += -O3 -funroll-loops 11 CFLAGS += -O3 -funroll-all-loops
8 12
9 #for size 13 #for size
10 #CFLAGS += -Os 14 #CFLAGS += -Os
11 15
12 #x86 optimizations [should be valid for any GCC install though] 16 #x86 optimizations [should be valid for any GCC install though]
13 CFLAGS += -fomit-frame-pointer 17 CFLAGS += -fomit-frame-pointer
14 18
15 #debug 19 #debug
16 #CFLAGS += -g3 20 #CFLAGS += -g3
17 21
18 VERSION=0.32 22 #install as this user
23 USER=root
24 GROUP=root
19 25
20 default: libtommath.a 26 default: libtommath.a
21 27
22 #default files to install 28 #default files to install
23 LIBNAME=libtommath.a 29 LIBNAME=libtommath.a
24 HEADERS=tommath.h 30 HEADERS=tommath.h tommath_class.h tommath_superclass.h
25 31
26 #LIBPATH-The directory for libtommath to be installed to. 32 #LIBPATH-The directory for libtommath to be installed to.
27 #INCPATH-The directory to install the header files for libtommath. 33 #INCPATH-The directory to install the header files for libtommath.
28 #DATAPATH-The directory to install the pdf docs. 34 #DATAPATH-The directory to install the pdf docs.
29 DESTDIR= 35 DESTDIR=
49 bn_mp_prime_is_divisible.o bn_prime_tab.o bn_mp_prime_fermat.o bn_mp_prime_miller_rabin.o \ 55 bn_mp_prime_is_divisible.o bn_prime_tab.o bn_mp_prime_fermat.o bn_mp_prime_miller_rabin.o \
50 bn_mp_prime_is_prime.o bn_mp_prime_next_prime.o bn_mp_dr_reduce.o \ 56 bn_mp_prime_is_prime.o bn_mp_prime_next_prime.o bn_mp_dr_reduce.o \
51 bn_mp_dr_is_modulus.o bn_mp_dr_setup.o bn_mp_reduce_setup.o \ 57 bn_mp_dr_is_modulus.o bn_mp_dr_setup.o bn_mp_reduce_setup.o \
52 bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_div_3.o bn_s_mp_exptmod.o \ 58 bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_div_3.o bn_s_mp_exptmod.o \
53 bn_mp_reduce_2k.o bn_mp_reduce_is_2k.o bn_mp_reduce_2k_setup.o \ 59 bn_mp_reduce_2k.o bn_mp_reduce_is_2k.o bn_mp_reduce_2k_setup.o \
60 bn_mp_reduce_2k_l.o bn_mp_reduce_is_2k_l.o bn_mp_reduce_2k_setup_l.o \
54 bn_mp_radix_smap.o bn_mp_read_radix.o bn_mp_toradix.o bn_mp_radix_size.o \ 61 bn_mp_radix_smap.o bn_mp_read_radix.o bn_mp_toradix.o bn_mp_radix_size.o \
55 bn_mp_fread.o bn_mp_fwrite.o bn_mp_cnt_lsb.o bn_error.o \ 62 bn_mp_fread.o bn_mp_fwrite.o bn_mp_cnt_lsb.o bn_error.o \
56 bn_mp_init_multi.o bn_mp_clear_multi.o bn_mp_exteuclid.o bn_mp_toradix_n.o \ 63 bn_mp_init_multi.o bn_mp_clear_multi.o bn_mp_exteuclid.o bn_mp_toradix_n.o \
57 bn_mp_prime_random_ex.o bn_mp_get_int.o bn_mp_sqrt.o bn_mp_is_square.o bn_mp_init_set.o \ 64 bn_mp_prime_random_ex.o bn_mp_get_int.o bn_mp_sqrt.o bn_mp_is_square.o bn_mp_init_set.o \
58 bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o 65 bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o \
66 bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o
59 67
60 libtommath.a: $(OBJECTS) 68 libtommath.a: $(OBJECTS)
61 $(AR) $(ARFLAGS) libtommath.a $(OBJECTS) 69 $(AR) $(ARFLAGS) libtommath.a $(OBJECTS)
62 ranlib libtommath.a 70 ranlib libtommath.a
63
64 71
65 #make a profiled library (takes a while!!!) 72 #make a profiled library (takes a while!!!)
66 # 73 #
67 # This will build the library with profile generation 74 # This will build the library with profile generation
68 # then run the test demo and rebuild the library. 75 # then run the test demo and rebuild the library.
84 $(CC) $(CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o 91 $(CC) $(CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o
85 $(AR) $(ARFLAGS) libtommath.a mpi.o 92 $(AR) $(ARFLAGS) libtommath.a mpi.o
86 ranlib libtommath.a 93 ranlib libtommath.a
87 94
88 install: libtommath.a 95 install: libtommath.a
89 install -d -g root -o root $(DESTDIR)$(LIBPATH) 96 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
90 install -d -g root -o root $(DESTDIR)$(INCPATH) 97 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
91 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) 98 install -g $(GROUP) -o $(USER) $(LIBNAME) $(DESTDIR)$(LIBPATH)
92 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH) 99 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
93 100
94 test: libtommath.a demo/demo.o 101 test: libtommath.a demo/demo.o
95 $(CC) demo/demo.o libtommath.a -o test 102 $(CC) $(CFLAGS) demo/demo.o libtommath.a -o test
96 103
97 mtest: test 104 mtest: test
98 cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest -s 105 cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest
99 106
100 timing: libtommath.a 107 timing: libtommath.a
101 $(CC) $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o ltmtest -s 108 $(CC) $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o ltmtest
102 109
103 # makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think] 110 # makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think]
104 docdvi: tommath.src 111 docdvi: tommath.src
105 cd pics ; make 112 cd pics ; make
106 echo "hello" > tommath.ind 113 echo "hello" > tommath.ind