xref: /minix3/crypto/external/bsd/heimdal/dist/lib/hcrypto/libtommath/etc/makefile (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel SambucCFLAGS += -Wall -W -Wshadow -O3 -fomit-frame-pointer -funroll-loops -I../
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambuc# default lib name (requires install with root)
4*ebfedea0SLionel Sambuc# LIBNAME=-ltommath
5*ebfedea0SLionel Sambuc
6*ebfedea0SLionel Sambuc# libname when you can't install the lib with install
7*ebfedea0SLionel SambucLIBNAME=../libtommath.a
8*ebfedea0SLionel Sambuc
9*ebfedea0SLionel Sambuc#provable primes
10*ebfedea0SLionel Sambucpprime: pprime.o
11*ebfedea0SLionel Sambuc	$(CC) pprime.o $(LIBNAME) -o pprime
12*ebfedea0SLionel Sambuc
13*ebfedea0SLionel Sambuc# portable [well requires clock()] tuning app
14*ebfedea0SLionel Sambuctune: tune.o
15*ebfedea0SLionel Sambuc	$(CC) tune.o $(LIBNAME) -o tune
16*ebfedea0SLionel Sambuc
17*ebfedea0SLionel Sambuc# same app but using RDTSC for higher precision [requires 80586+], coff based gcc installs [e.g. ming, cygwin, djgpp]
18*ebfedea0SLionel Sambuctune86: tune.c
19*ebfedea0SLionel Sambuc	nasm -f coff timer.asm
20*ebfedea0SLionel Sambuc	$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o  $(LIBNAME) -o tune86
21*ebfedea0SLionel Sambuc
22*ebfedea0SLionel Sambuc# for cygwin
23*ebfedea0SLionel Sambuctune86c: tune.c
24*ebfedea0SLionel Sambuc	nasm -f gnuwin32 timer.asm
25*ebfedea0SLionel Sambuc	$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o  $(LIBNAME) -o tune86
26*ebfedea0SLionel Sambuc
27*ebfedea0SLionel Sambuc#make tune86 for linux or any ELF format
28*ebfedea0SLionel Sambuctune86l: tune.c
29*ebfedea0SLionel Sambuc	nasm -f elf -DUSE_ELF timer.asm
30*ebfedea0SLionel Sambuc	$(CC) -DX86_TIMER $(CFLAGS) tune.c timer.o $(LIBNAME) -o tune86l
31*ebfedea0SLionel Sambuc
32*ebfedea0SLionel Sambuc# spits out mersenne primes
33*ebfedea0SLionel Sambucmersenne: mersenne.o
34*ebfedea0SLionel Sambuc	$(CC) mersenne.o $(LIBNAME) -o mersenne
35*ebfedea0SLionel Sambuc
36*ebfedea0SLionel Sambuc# fines DR safe primes for the given config
37*ebfedea0SLionel Sambucdrprime: drprime.o
38*ebfedea0SLionel Sambuc	$(CC) drprime.o $(LIBNAME) -o drprime
39*ebfedea0SLionel Sambuc
40*ebfedea0SLionel Sambuc# fines 2k safe primes for the given config
41*ebfedea0SLionel Sambuc2kprime: 2kprime.o
42*ebfedea0SLionel Sambuc	$(CC) 2kprime.o $(LIBNAME) -o 2kprime
43*ebfedea0SLionel Sambuc
44*ebfedea0SLionel Sambucmont: mont.o
45*ebfedea0SLionel Sambuc	$(CC) mont.o $(LIBNAME) -o mont
46*ebfedea0SLionel Sambuc
47*ebfedea0SLionel Sambuc
48*ebfedea0SLionel Sambucclean:
49*ebfedea0SLionel Sambuc	rm -f *.log *.o *.obj *.exe pprime tune mersenne drprime tune86 tune86l mont 2kprime pprime.dat \
50*ebfedea0SLionel Sambuc         *.da *.dyn *.dpi *~
51