added libtompoly-0.03
[libtompoly.git] / makefile
blob12dd6486edf54605bddba86a310dc3b30cf7d540
1 #Makefile for GCC by Tom St Denis
2 CFLAGS += -I. -Os -Wall -W
4 VERSION=0.03
6 #default files to install
7 LIBNAME=libtompoly.a
8 HEADERS=tompoly.h
10 #LIBPATH-The directory for libtomcrypt to be installed to.
11 #INCPATH-The directory to install the header files for libtommath.
12 #DATAPATH-The directory to install the pdf docs.
13 DESTDIR=
14 LIBPATH=/usr/lib
15 INCPATH=/usr/include
16 DATAPATH=/usr/share/doc/libtompoly/pdf
18 default: libtompoly.a
20 OBJECTS = pb_init.o pb_clear.o pb_init_size.o pb_grow.o pb_copy.o pb_clamp.o pb_init_copy.o \
21 pb_add.o pb_sub.o pb_mul.o pb_div.o pb_zero.o pb_lshd.o pb_rshd.o pb_exch.o pb_mod.o \
22 pb_addmod.o pb_submod.o pb_mulmod.o pb_gcd.o pb_init_multi.o pb_clear_multi.o pb_invmod.o \
23 pb_cmp.o pb_shrink.o pb_exteuclid.o pb_monic.o pb_exptmod.o pb_isirreduc.o pb_rawsize.o \
24 pb_toraw.o pb_readraw.o
26 libtompoly.a: $(OBJECTS)
27 ar $(ARFLAGS) libtompoly.a $(OBJECTS)
29 install: libtompoly.a
30 install -d -g root -o root $(DESTDIR)$(LIBPATH)
31 install -d -g root -o root $(DESTDIR)$(INCPATH)
32 install -g root -o root $(LIBNAME) $(DESTDIR)$(LIBPATH)
33 install -g root -o root $(HEADERS) $(DESTDIR)$(INCPATH)
35 demo: demo/demo.o libtompoly.a
36 gcc demo/demo.o libtompoly.a -ltommath -o demo
38 mandvi: pb.tex
39 echo "hello" > pb.ind
40 latex pb > /dev/null
41 makeindex pb
42 latex pb > /dev/null
44 manual: mandvi
45 pdflatex pb >/dev/null
47 clean:
48 rm -f *.o *.a *.obj *.lib *.exe demo/*.o demo/*.obj demo/*.exe
49 rm -f *.idx *.ilg *.ind *.lof *.out *.toc *.dvi *.log *.aux
51 zipup: manual clean
52 cd .. ; rm -rf ltp* libtompoly-$(VERSION) ; mkdir libtompoly-$(VERSION) ; \
53 cp -R ./libtompoly/* ./libtompoly-$(VERSION)/ ; \
54 tar -c libtompoly-$(VERSION)/* | bzip2 -9vvc > ltp-$(VERSION).tar.bz2 ; \
55 zip -9 -r ltp-$(VERSION).zip libtompoly-$(VERSION)/*