comparison makefile @ 142:d29b64170cf0 libtommath-orig

import of libtommath 0.32
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Dec 2004 11:33:56 +0000
parents 86e0b50a9b58
children d8254fc979e9
comparison
equal deleted inserted replaced
19:e1037a1e12e7 142:d29b64170cf0
10 #CFLAGS += -Os 10 #CFLAGS += -Os
11 11
12 #x86 optimizations [should be valid for any GCC install though] 12 #x86 optimizations [should be valid for any GCC install though]
13 CFLAGS += -fomit-frame-pointer 13 CFLAGS += -fomit-frame-pointer
14 14
15 VERSION=0.30 15 #debug
16 #CFLAGS += -g3
17
18 VERSION=0.32
16 19
17 default: libtommath.a 20 default: libtommath.a
18 21
19 #default files to install 22 #default files to install
20 LIBNAME=libtommath.a 23 LIBNAME=libtommath.a
21 HEADERS=tommath.h 24 HEADERS=tommath.h
22 25
23 #LIBPATH-The directory for libtomcrypt to be installed to. 26 #LIBPATH-The directory for libtommath to be installed to.
24 #INCPATH-The directory to install the header files for libtommath. 27 #INCPATH-The directory to install the header files for libtommath.
25 #DATAPATH-The directory to install the pdf docs. 28 #DATAPATH-The directory to install the pdf docs.
26 DESTDIR= 29 DESTDIR=
27 LIBPATH=/usr/lib 30 LIBPATH=/usr/lib
28 INCPATH=/usr/include 31 INCPATH=/usr/include
48 bn_mp_dr_is_modulus.o bn_mp_dr_setup.o bn_mp_reduce_setup.o \ 51 bn_mp_dr_is_modulus.o bn_mp_dr_setup.o bn_mp_reduce_setup.o \
49 bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_div_3.o bn_s_mp_exptmod.o \ 52 bn_mp_toom_mul.o bn_mp_toom_sqr.o bn_mp_div_3.o bn_s_mp_exptmod.o \
50 bn_mp_reduce_2k.o bn_mp_reduce_is_2k.o bn_mp_reduce_2k_setup.o \ 53 bn_mp_reduce_2k.o bn_mp_reduce_is_2k.o bn_mp_reduce_2k_setup.o \
51 bn_mp_radix_smap.o bn_mp_read_radix.o bn_mp_toradix.o bn_mp_radix_size.o \ 54 bn_mp_radix_smap.o bn_mp_read_radix.o bn_mp_toradix.o bn_mp_radix_size.o \
52 bn_mp_fread.o bn_mp_fwrite.o bn_mp_cnt_lsb.o bn_error.o \ 55 bn_mp_fread.o bn_mp_fwrite.o bn_mp_cnt_lsb.o bn_error.o \
53 bn_mp_init_multi.o bn_mp_clear_multi.o bn_prime_sizes_tab.o bn_mp_exteuclid.o bn_mp_toradix_n.o \ 56 bn_mp_init_multi.o bn_mp_clear_multi.o bn_mp_exteuclid.o bn_mp_toradix_n.o \
54 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 \ 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 \
55 bn_mp_init_set_int.o 58 bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o
56 59
57 libtommath.a: $(OBJECTS) 60 libtommath.a: $(OBJECTS)
58 $(AR) $(ARFLAGS) libtommath.a $(OBJECTS) 61 $(AR) $(ARFLAGS) libtommath.a $(OBJECTS)
59 ranlib libtommath.a 62 ranlib libtommath.a
63
64
65 #make a profiled library (takes a while!!!)
66 #
67 # This will build the library with profile generation
68 # then run the test demo and rebuild the library.
69 #
70 # So far I've seen improvements in the MP math
71 profiled:
72 make CFLAGS="$(CFLAGS) -fprofile-arcs -DTESTING" timing
73 ./ltmtest
74 rm -f *.a *.o ltmtest
75 make CFLAGS="$(CFLAGS) -fbranch-probabilities"
76
77 #make a single object profiled library
78 profiled_single:
79 perl gen.pl
80 $(CC) $(CFLAGS) -fprofile-arcs -DTESTING -c mpi.c -o mpi.o
81 $(CC) $(CFLAGS) -DTESTING -DTIMER demo/timing.c mpi.o -o ltmtest
82 ./ltmtest
83 rm -f *.o ltmtest
84 $(CC) $(CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o
85 $(AR) $(ARFLAGS) libtommath.a mpi.o
86 ranlib libtommath.a
60 87
61 install: libtommath.a 88 install: libtommath.a
62 install -d -g root -o root $(DESTDIR)$(LIBPATH) 89 install -d -g root -o root $(DESTDIR)$(LIBPATH)
63 install -d -g root -o root $(DESTDIR)$(INCPATH) 90 install -d -g root -o root $(DESTDIR)$(INCPATH)
64 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH) 91 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
69 96
70 mtest: test 97 mtest: test
71 cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest -s 98 cd mtest ; $(CC) $(CFLAGS) mtest.c -o mtest -s
72 99
73 timing: libtommath.a 100 timing: libtommath.a
74 $(CC) $(CFLAGS) -DTIMER demo/demo.c libtommath.a -o ltmtest -s 101 $(CC) $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o ltmtest -s
75 102
76 # makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think] 103 # makes the LTM book DVI file, requires tetex, perl and makeindex [part of tetex I think]
77 docdvi: tommath.src 104 docdvi: tommath.src
78 cd pics ; make 105 cd pics ; make
79 echo "hello" > tommath.ind 106 echo "hello" > tommath.ind
104 131
105 #LTM user manual [pdf] 132 #LTM user manual [pdf]
106 manual: mandvi 133 manual: mandvi
107 pdflatex bn >/dev/null 134 pdflatex bn >/dev/null
108 rm -f bn.aux bn.dvi bn.log bn.idx bn.lof bn.out bn.toc 135 rm -f bn.aux bn.dvi bn.log bn.idx bn.lof bn.out bn.toc
109 136
137 pretty:
138 perl pretty.build
139
110 clean: 140 clean:
111 rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \ 141 rm -f *.bat *.pdf *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \
112 *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c 142 *.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
143 rm -rf .libs
113 cd etc ; make clean 144 cd etc ; make clean
114 cd pics ; make clean 145 cd pics ; make clean
115 146
116 zipup: clean manual poster docs 147 zipup: clean manual poster docs
117 perl gen.pl ; mv mpi.c pre_gen/ ; \ 148 perl gen.pl ; mv mpi.c pre_gen/ ; \