comparison makefile.shared @ 386:97db060d0ef5 libtommath-orig libtommath-0.40

Update to LibTomMath 0.40
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 03:11:15 +0000
parents 91fbc376f010
children
comparison
equal deleted inserted replaced
282:91fbc376f010 386:97db060d0ef5
1 #Makefile for GCC 1 #Makefile for GCC
2 # 2 #
3 #Tom St Denis 3 #Tom St Denis
4 VERSION=0:35 4 VERSION=0:40
5 5
6 CC = libtool --mode=compile gcc 6 CC = libtool --mode=compile --tag=CC gcc
7
7 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare 8 CFLAGS += -I./ -Wall -W -Wshadow -Wsign-compare
9
10 ifndef IGNORE_SPEED
8 11
9 #for speed 12 #for speed
10 CFLAGS += -O3 -funroll-loops 13 CFLAGS += -O3 -funroll-loops
11 14
12 #for size 15 #for size
13 #CFLAGS += -Os 16 #CFLAGS += -Os
14 17
15 #x86 optimizations [should be valid for any GCC install though] 18 #x86 optimizations [should be valid for any GCC install though]
16 CFLAGS += -fomit-frame-pointer 19 CFLAGS += -fomit-frame-pointer
17 20
21 endif
22
18 #install as this user 23 #install as this user
19 USER=root 24 ifndef INSTALL_GROUP
20 GROUP=root 25 GROUP=wheel
26 else
27 GROUP=$(INSTALL_GROUP)
28 endif
29
30 ifndef INSTALL_USER
31 USER=root
32 else
33 USER=$(INSTALL_USER)
34 endif
21 35
22 default: libtommath.la 36 default: libtommath.la
23 37
24 #default files to install 38 #default files to install
25 LIBNAME=libtommath.la 39 ifndef LIBNAME
40 LIBNAME=libtommath.la
41 endif
42 ifndef LIBNAME_S
43 LIBNAME_S=libtommath.a
44 endif
26 HEADERS=tommath.h tommath_class.h tommath_superclass.h 45 HEADERS=tommath.h tommath_class.h tommath_superclass.h
27 46
28 #LIBPATH-The directory for libtommath to be installed to. 47 #LIBPATH-The directory for libtommath to be installed to.
29 #INCPATH-The directory to install the header files for libtommath. 48 #INCPATH-The directory to install the header files for libtommath.
30 #DATAPATH-The directory to install the pdf docs. 49 #DATAPATH-The directory to install the pdf docs.
59 bn_mp_init_multi.o bn_mp_clear_multi.o bn_mp_exteuclid.o bn_mp_toradix_n.o \ 78 bn_mp_init_multi.o bn_mp_clear_multi.o bn_mp_exteuclid.o bn_mp_toradix_n.o \
60 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 \ 79 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 \
61 bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o \ 80 bn_mp_init_set_int.o bn_mp_invmod_slow.o bn_mp_prime_rabin_miller_trials.o \
62 bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o 81 bn_mp_to_signed_bin_n.o bn_mp_to_unsigned_bin_n.o
63 82
83 objs: $(OBJECTS)
64 84
65 libtommath.la: $(OBJECTS) 85 $(LIBNAME): $(OBJECTS)
66 libtool --mode=link gcc *.lo -o libtommath.la -rpath $(LIBPATH) -version-info $(VERSION) 86 libtool --mode=link gcc *.lo -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION)
67 libtool --mode=link gcc *.o -o libtommath.a 87
68 libtool --mode=install install -c libtommath.la $(LIBPATH)/libtommath.la 88 install: $(LIBNAME)
89 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
90 libtool --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
69 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH) 91 install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
70 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH) 92 install -g $(GROUP) -o $(USER) $(HEADERS) $(DESTDIR)$(INCPATH)
71 93
72 test: libtommath.a demo/demo.o 94 test: $(LIBNAME) demo/demo.o
73 gcc $(CFLAGS) -c demo/demo.c -o demo/demo.o 95 gcc $(CFLAGS) -c demo/demo.c -o demo/demo.o
74 libtool --mode=link gcc -o test demo/demo.o libtommath.la 96 libtool --mode=link gcc -o test demo/demo.o $(LIBNAME_S)
75 97
76 mtest: test 98 mtest: test
77 cd mtest ; gcc $(CFLAGS) mtest.c -o mtest -s 99 cd mtest ; gcc $(CFLAGS) mtest.c -o mtest
78 100
79 timing: libtommath.la 101 timing: $(LIBNAME)
80 gcc $(CFLAGS) -DTIMER demo/timing.c libtommath.a -o ltmtest -s 102 gcc $(CFLAGS) -DTIMER demo/timing.c $(LIBNAME_S) -o ltmtest