2
0

Makefile.in 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. #
  2. # This code is pretty well tested, but not optimizing it will have
  3. # a *major* effect on speed, so its optimzation flags are separate
  4. # from the rest of the release.
  5. #
  6. # For the SPARC v8, at least, gcc produces a *much* faster library than
  7. # the SunPro C compiler. On a 50 MHz TI TMS390Z50 SuperSPARC:
  8. # 14.5 vs. 47.2 ms per 256-bit modular exponentiation.
  9. # 77.4 vs. 317.8 ms per 512-bit modular exponentiation.
  10. # 249.0 vs. 1031.5 ms per 1024-bit modular exponentiation
  11. #
  12. CC=@CC@
  13. # for libzrtp support
  14. CFLAGS=@CFLAGS@ @CPPFLAGS@ @WARN@ @TUNE@ @DEFS@ $(DEFINE) -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes
  15. srcdir=@srcdir@
  16. VPATH=@srcdir@
  17. # Extra object files (e.g. lbnalpha.o for Alpha assembly routines)
  18. AUXOBJS=
  19. # Extra definitions (e.g. -DBNINCLUDE=lbnalpha.h)
  20. DEFINE=
  21. SHELL = /bin/sh
  22. .SUFFIXES:
  23. .SUFFIXES: .c .h .o .s
  24. LD =$(CC)
  25. LDFLAGS =@LDFLAGS@
  26. LIBS=@LIBS@
  27. RANLIB=@RANLIB@
  28. # If you have a machine-specific assembly file, add it to AUXOBJS.
  29. OBJS = bn00.o lbn00.o bn.o lbnmem.o sieve.o prime.o \
  30. bnprint.o jacobi.o germain.o $(AUXOBJS)
  31. BNLIB = libbn.a
  32. # for libzrtp support
  33. all: $(BNLIB) bntest32.c bntest64.c
  34. # bntest germtest
  35. # for libzrtp support
  36. install: all
  37. test -d /usr/local/include/libzrtp || mkdir /usr/local/include/libzrtp
  38. cp *.h /usr/local/include/libzrtp
  39. cp 'libbn.a' '/usr/local/lib/libbn.a'
  40. chmod 644 /usr/local/lib/libbn.a
  41. chown 0:0 /usr/local/lib/libbn.a
  42. $(RANLIB) '/usr/local/lib/libbn.a'
  43. # for libzrtp support
  44. #check: bntest
  45. # ./bntest
  46. check:
  47. bntest: bntest00.o $(BNLIB)
  48. $(LD) $(LDFLAGS) -o $@ bntest00.o $(BNLIB) $(LIBS)
  49. germtest: germtest.o $(BNLIB)
  50. $(LD) $(LDFLAGS) -o $@ germtest.o $(BNLIB) $(LIBS)
  51. $(BNLIB): $(OBJS)
  52. $(AR) r $@ $?
  53. $(RANLIB) $@
  54. # Here we get tricky... if we're compiling with GCC, then GCCMAGIC1 and
  55. # GCCMAGIC2 are set so that we actually do a link, but with the -r flag
  56. # (produce relocatable output) and with -lgcc *only*. This is so that
  57. # the result can be linked cleanly with code compiled with another cc,
  58. # which doesn't know about -lgcc. Presumably the lbnXX.o file, which
  59. # has by far the most math in it, will have a call to every interesting
  60. # support-library function.
  61. lbn00.o: $(srcdir)/lbn00.c $(HDRS) bnconfig.h
  62. $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn00.c @GCCMAGIC2@
  63. lbn16.o: $(srcdir)/lbn16.c $(HDRS) bnconfig.h
  64. $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn16.c @GCCMAGIC2@
  65. lbn32.o: $(srcdir)/lbn32.c $(HDRS) bnconfig.h
  66. $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn32.c @GCCMAGIC2@
  67. lbn64.o: $(srcdir)/lbn64.c $(HDRS) bnconfig.h
  68. $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ @GCCMAGIC1@ lbn64.c @GCCMAGIC2@
  69. # The default .o rule.
  70. .c.o: bnconfig.h
  71. $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I$(srcdir) -o $@ -c $<
  72. # Extra, non-obvious dependencies. Bnlib can be compiled in three
  73. # word sizes, and the *00.c files #include the right .c files based
  74. # on <limits.h>, which means that a single compilation will only use a
  75. # subset of these files. Duplicated here in case someone regenerates
  76. # dependencies with cc -M and they get lost.
  77. lbn00.o: lbn16.c lbn32.c lbn64.c lbn16.h lbn32.h lbn64.h
  78. bn00.o: bn16.c bn32.c bn64.c bn16.h bn32.h bn64.h \
  79. bninit16.c bninit32.c bninit64.c
  80. bntest00.o: bntest16.c bntest32.c bntest64.c lbn16.h lbn32.h lbn64.h
  81. # Actual build commented out to prevent confusion by people without autoconf.
  82. # Do it manually for now.
  83. configure: configure.in
  84. @echo "configure script is out of date; run autoconf"
  85. # autoconf
  86. clean:
  87. $(RM) -f *.o *32.[ch] *64.[ch]
  88. distclean: clean
  89. -rm -f Makefile
  90. BNSOURCES = lbn32.c lbn32.h bn32.c bn32.h bninit32.c bntest32.c \
  91. lbn64.c lbn64.h bn64.c bn64.h bninit64.c bntest64.c
  92. # An explicit target that can be made before distribution for
  93. # machines that don't have sed.
  94. bnsources: $(BNSOURCES)
  95. # The 16-bit versions of the code are the master versions; all else is
  96. # generated from them. This fiddling about makes them unwriteable
  97. # to discourage improper edits.
  98. # (You didn't know that suffixes for suffix rules didn't have to begin
  99. # with a period, did you?)
  100. .SUFFIXES: 16.c 16.h 32.c 32.h 64.c 64.h
  101. 16.c32.c:
  102. @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@
  103. sed -e s/32/64/g -e s/16/32/g $< > $@
  104. @chmod a-w $@
  105. 16.h32.h:
  106. @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@
  107. sed -e s/32/64/g -e s/16/32/g $< > $@
  108. @chmod a-w $@
  109. 16.c64.c:
  110. @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@
  111. sed -e s/32/128/g -e s/16/64/g $< > $@
  112. @chmod a-w $@
  113. 16.h64.h:
  114. @test ! -f $@ -o -w $@ || chmod u+w $@ && test -w $@ || rm -f $@
  115. sed -e s/32/128/g -e s/16/64/g $< > $@
  116. @chmod a-w $@
  117. ### Dependencies
  118. bn.o: bn.c bn.h
  119. bn00.o: bn00.c bnsize00.h lbn.h bn16.c bn32.c bn64.c lbn16.c lbn32.h \
  120. lbn64.h lbnmem.h bn16.h bn32.h bn64.h bn.h kludge.h bninit16.c \
  121. bninit32.c bninit64.c
  122. bn16.o: bn16.c lbn.h lbn16.h lbnmem.h bn16.h bn.h kludge.h
  123. bn32.o: bn32.c lbn.h lbn32.h lbnmem.h bn32.h bn.h kludge.h
  124. bn64.o: bn64.c lbn.h lbn64.h lbnmem.h bn64.h bn.h kludge.h
  125. bn68000.o: bn68000.c lbn.h lbn68000.h bn16.h bn32.h
  126. bn8086.o: bn8086.c lbn.h bn64.h lbn8086.h bn32.h
  127. bninit16.o: bninit16.c bn.h bn16.h
  128. bninit32.o: bninit32.c bn.h bn32.h
  129. bninit64.o: bninit64.c bn.h bn64.h
  130. bnprint.o: bnprint.c bn.h bnprint.h kludge.h
  131. bntest00.o: bntest00.c bnsize00.h lbn.h bntest16.c bntest32.c \
  132. bntest64.c cputime.h lbn16.h lbn32.h lbn64.h kludge.h
  133. bntest16.o: bntest16.c cputime.h lbn16.h lbn.h kludge.h
  134. bntest32.o: bntest32.c cputime.h lbn32.h lbn.h kludge.h
  135. bntest64.o: bntest64.c cputime.h lbn64.h lbn.h kludge.h
  136. germain.o: germain.c bn.h germain.h jacobi.h lbnmem.h sieve.h kludge.h
  137. germtest.o: germtest.c bn.h germain.h sieve.h cputime.h bnprint.h
  138. jacobi.o: jacobi.c bn.h jacobi.h
  139. lbn00.o: lbn00.c bnsize00.h lbn.h lbn16.c lbn16.h lbn32.c lbn32.h \
  140. lbn64.c lbn64.h lbnmem.h kludge.h
  141. lbn16.o: lbn16.c lbn.h lbn16.h lbnmem.h kludge.h
  142. lbn32.o: lbn32.c lbn.h lbn32.h lbnmem.h kludge.h
  143. lbn64.o: lbn64.c lbn.h lbn64.h lbnmem.h kludge.h
  144. lbn68000.o: lbn68000.c lbn.h lbn68000.h
  145. lbn68020.o: lbn68020.c lbn.h lbn68020.h
  146. lbnmem.o: lbnmem.c lbn.h lbnmem.h kludge.h
  147. lbnppc.o: lbnppc.c lbnppc.h ppcasm.h
  148. prime.o: prime.c bn.h lbnmem.h prime.h sieve.h kludge.h
  149. sieve.o: sieve.c bn.h sieve.h kludge.h
  150. sizetest.c: bnsize00.h
  151. distdir: