tomsfastmath/makefile

148 lines
3.6 KiB
Makefile
Raw Normal View History

2004-08-25 04:43:43 +02:00
#makefile for TomsFastMath
#
#
2005-10-31 16:32:05 +01:00
VERSION=0.06
2005-08-01 18:37:35 +02:00
CFLAGS += -Wall -W -Wshadow -I./
ifndef IGNORE_SPEED
CFLAGS += -O3 -funroll-all-loops
2004-08-25 04:43:43 +02:00
#profiling
#PROF=-pg -g
#CFLAGS += $(PROF)
#speed
CFLAGS += -fomit-frame-pointer
2005-08-01 18:37:35 +02:00
endif
2004-08-25 04:43:43 +02:00
OBJECTS = \
fp_set.o \
\
fp_rshd.o fp_lshd.o fp_div_2d.o fp_mod_2d.o fp_mul_2d.o fp_2expt.o \
fp_mul_2.o fp_div_2.o \
\
fp_cnt_lsb.o \
\
fp_add.o fp_sub.o fp_mul.o fp_sqr.o fp_div.o fp_mod.o \
s_fp_add.o s_fp_sub.o \
\
fp_cmp_d.o fp_add_d.o fp_sub_d.o fp_mul_d.o fp_div_d.o fp_mod_d.o \
fp_addmod.o fp_submod.o fp_mulmod.o fp_sqrmod.o fp_invmod.o \
fp_gcd.o fp_lcm.o fp_prime_miller_rabin.o fp_isprime.o \
fp_prime_random_ex.o fp_mul_comba.o fp_sqr_comba.o \
\
fp_montgomery_setup.o fp_montgomery_calc_normalization.o fp_montgomery_reduce.o \
\
fp_exptmod.o \
\
fp_cmp.o fp_cmp_mag.o \
\
fp_unsigned_bin_size.o fp_read_unsigned_bin.o fp_to_unsigned_bin.o \
fp_signed_bin_size.o fp_read_signed_bin.o fp_to_signed_bin.o \
2004-09-19 03:31:44 +02:00
fp_read_radix.o fp_toradix.o fp_radix_size.o fp_count_bits.o fp_reverse.o fp_s_rmap.o \
2004-08-25 04:43:43 +02:00
\
2004-09-19 03:31:44 +02:00
fp_ident.o
2004-08-25 04:43:43 +02:00
2005-07-23 12:43:03 +02:00
HEADERS=tfm.h
ifndef LIBPATH
LIBPATH=/usr/lib
endif
ifndef INCPATH
INCPATH=/usr/include
endif
2005-08-01 18:37:35 +02:00
ifndef INSTALL_GROUP
2005-07-23 12:43:03 +02:00
GROUP=wheel
2005-08-01 18:37:35 +02:00
else
GROUP=$(INSTALL_GROUP)
2005-07-23 12:43:03 +02:00
endif
2005-08-01 18:37:35 +02:00
ifndef INSTALL_USER
2005-07-23 12:43:03 +02:00
USER=root
2005-08-01 18:37:35 +02:00
else
USER=$(INSTALL_USER)
2005-07-23 12:43:03 +02:00
endif
ifndef LIBNAME
LIBNAME=libtfm.a
endif
2005-08-01 18:37:35 +02:00
default: $(LIBNAME)
2005-07-23 12:43:03 +02:00
$(LIBNAME): $(OBJECTS)
2005-08-01 18:37:35 +02:00
$(AR) $(ARFLAGS) $@ $(OBJECTS)
ranlib $@
2005-07-23 12:43:03 +02:00
2005-08-01 18:37:35 +02:00
install: $(LIBNAME)
2005-07-23 12:43:03 +02:00
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)
2004-08-25 04:43:43 +02:00
mtest/mtest: mtest/mtest.c
2005-10-31 16:32:05 +01:00
cd mtest ; CFLAGS="$(CFLAGS) -I../" make mtest
2004-08-25 04:43:43 +02:00
2005-08-01 18:37:35 +02:00
test: $(LIBNAME) demo/test.o mtest/mtest
$(CC) $(CFLAGS) demo/test.o $(LIBNAME) $(PROF) -o test
2004-08-25 04:43:43 +02:00
2005-08-01 18:37:35 +02:00
timing: $(LIBNAME) demo/test.o
$(CC) $(CFLAGS) demo/test.o $(LIBNAME) $(PROF) -o test
2005-07-23 12:43:03 +02:00
2005-08-01 18:37:35 +02:00
stest: $(LIBNAME) demo/stest.o
$(CC) $(CFLAGS) demo/stest.o $(LIBNAME) -o stest
2005-07-23 12:43:03 +02:00
2005-08-01 18:37:35 +02:00
rsatest: $(LIBNAME) demo/rsa.o
$(CC) $(CFLAGS) demo/rsa.o $(LIBNAME) -o rsatest
2004-08-25 04:43:43 +02:00
docdvi: tfm.tex
touch tfm.ind
latex tfm >/dev/null
latex tfm >/dev/null
makeindex tfm
latex tfm >/dev/null
docs: docdvi
latex tfm >/dev/null
dvipdf tfm
mv -f tfm.pdf doc
2005-08-01 18:37:35 +02:00
#This rule cleans the source tree of all compiled code, not including the pdf
#documentation.
2004-08-25 04:43:43 +02:00
clean:
2005-08-01 18:37:35 +02:00
rm -f `find . -type f | grep "[.]o" | xargs`
rm -f `find . -type f | grep "[.]lo" | xargs`
rm -f `find . -type f | grep "[.]a" | xargs`
rm -f `find . -type f | grep "[.]la" | xargs`
rm -f `find . -type f | grep "[.]obj" | xargs`
rm -f `find . -type f | grep "[.]lib" | xargs`
rm -f `find . -type f | grep "[.]exe" | xargs`
rm -f `find . -type f | grep "[.]gcda" | xargs`
rm -f `find . -type f | grep "[.]gcno" | xargs`
rm -f `find . -type f | grep "[.]il" | xargs`
rm -f `find . -type f | grep "[.]dyn" | xargs`
rm -f `find . -type f | grep "[.]dpi" | xargs`
rm -rf `find . -type d | grep "[.]libs" | xargs`
rm -f tfm.aux tfm.dvi tfm.idx tfm.ilg tfm.ind tfm.lof tfm.log tfm.toc
2004-08-25 04:43:43 +02:00
cd mtest ; make clean
2005-07-23 12:43:03 +02:00
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: no_oops docs clean
2004-08-25 04:43:43 +02:00
perl gen.pl ; mv mpi.c pre_gen/ ; \
cd .. ; rm -rf tfm* tomsfastmath-$(VERSION) ; mkdir tomsfastmath-$(VERSION) ; \
cp -R ./tomsfastmath/* ./tomsfastmath-$(VERSION)/ ; \
tar -c tomsfastmath-$(VERSION)/* | bzip2 -9vvc > tfm-$(VERSION).tar.bz2 ; \
zip -9r tfm-$(VERSION).zip tomsfastmath-$(VERSION)/*
2005-08-01 18:37:35 +02:00
# $Source: /cvs/libtom/tomsfastmath/makefile,v $
2005-10-31 16:32:05 +01:00
# $Revision: 1.19 $
# $Date: 2005/08/25 23:53:40 $