security/nss/lib/freebl/mpi/Makefile

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #
     2 # Makefile for MPI library
     4 # This Source Code Form is subject to the terms of the Mozilla Public
     5 # License, v. 2.0. If a copy of the MPL was not distributed with this
     6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     8 ## Define CC to be the C compiler you wish to use.  The GNU cc
     9 ## compiler (gcc) should work, at the very least
    10 #CC=cc
    11 #CC=gcc
    13 ## 
    14 ## Define PERL to point to your local Perl interpreter.  It
    15 ## should be Perl 5.x, although it's conceivable that Perl 4
    16 ## might work ... I haven't tested it.
    17 ##
    18 #PERL=/usr/bin/perl
    19 #PERL=perl
    21 include target.mk
    23 CFLAGS+= $(XCFLAGS)
    25 ##
    26 ## Define LIBS to include any libraries you need to link against.
    27 ## If NO_TABLE is define, LIBS should include '-lm' or whatever is
    28 ## necessary to bring in the math library.  Otherwise, it can be
    29 ## left alone, unless your system has other peculiar requirements.
    30 ##
    31 LIBS=#-lmalloc#-lefence#-lm
    33 ## 
    34 ## Define RANLIB to be the library header randomizer; you might not
    35 ## need this on some systems (just set it to 'echo' on these systems,
    36 ## such as IRIX)
    37 ##
    38 RANLIB=echo
    40 ##
    41 ## This is the version string used for the documentation and 
    42 ## building the distribution tarball.  Don't mess with it unless
    43 ## you are releasing a new version
    44 VERS=1.7p6
    46 ## ----------------------------------------------------------------------
    47 ## You probably don't need to change anything below this line...
    48 ##
    50 ##
    51 ## This is the list of source files that need to be packed into
    52 ## the distribution file
    53 SRCS=   mpi.c mpprime.c mplogic.c mp_gf2m.c mpmontg.c mpi-test.c primes.c \
    54 	mpcpucache.c tests/ \
    55 	utils/gcd.c utils/invmod.c utils/lap.c \
    56 	utils/ptab.pl utils/sieve.c utils/isprime.c\
    57 	utils/dec2hex.c utils/hex2dec.c utils/bbs_rand.c \
    58 	utils/bbsrand.c utils/prng.c utils/primegen.c \
    59 	utils/basecvt.c utils/makeprime.c\
    60 	utils/fact.c utils/exptmod.c utils/pi.c utils/metime.c \
    61 	utils/mpi.h utils/mpprime.h mulsqr.c \
    62 	make-test-arrays test-arrays.txt all-tests make-logtab \
    63 	types.pl stats timetest multest
    65 ## These are the header files that go into the distribution file
    66 HDRS=mpi.h mpi-config.h utils/mpi.h utils/mpi-config.h mpprime.h mplogic.h mp_gf2m.h \
    67      mp_gf2m-priv.h utils/bbs_rand.h tests/mpi.h tests/mpprime.h
    69 ## These are the documentation files that go into the distribution file
    70 DOCS=README doc utils/README utils/PRIMES 
    72 ## This is the list of tools built by 'make tools'
    73 TOOLS=gcd invmod isprime lap dec2hex hex2dec primegen prng \
    74 	basecvt fact exptmod pi makeprime identest
    76 LIBOBJS = mpprime.o mpmontg.o mplogic.o mp_gf2m.o mpi.o mpcpucache.o $(AS_OBJS)
    77 LIBHDRS = mpi-config.h mpi-priv.h mpi.h
    78 APPHDRS = mpi-config.h mpi.h mplogic.h mp_gf2m.h mpprime.h
    80 help:
    81 	@ echo ""
    82 	@ echo "The following targets can be built with this Makefile:"
    83 	@ echo ""
    84 	@ echo "libmpi.a     - arithmetic and prime testing library"
    85 	@ echo "mpi-test     - test driver (requires MP_IOFUNC)"
    86 	@ echo "tools        - command line tools"
    87 	@ echo "doc          - manual pages for tools"
    88 	@ echo "clean        - clean up objects and such"
    89 	@ echo "distclean    - get ready for distribution"
    90 	@ echo "dist         - distribution tarball"
    91 	@ echo ""
    93 .SUFFIXES: .c .o .i
    95 .c.i:
    96 	$(CC) $(CFLAGS) -E $< > $@
    98 #.c.o: $*.h $*.c
    99 #	$(CC) $(CFLAGS) -c $<
   101 #---------------------------------------
   103 $(LIBOBJS): $(LIBHDRS)
   105 logtab.h: make-logtab
   106 	$(PERL) make-logtab > logtab.h
   108 mpi.o: mpi.c logtab.h $(LIBHDRS)
   110 mplogic.o: mplogic.c mpi-priv.h mplogic.h $(LIBHDRS)
   112 mp_gf2m.o: mp_gf2m.c mpi-priv.h mp_gf2m.h mp_gf2m-priv.h $(LIBHDRS)
   114 mpmontg.o: mpmontg.c mpi-priv.h mplogic.h mpprime.h $(LIBHDRS)
   116 mpprime.o: mpprime.c mpi-priv.h mpprime.h mplogic.h primes.c $(LIBHDRS)
   118 mpcpucache.o: mpcpucache.c $(LIBHDRS)
   120 mpi_mips.o: mpi_mips.s
   121 	$(CC) -o $@ $(ASFLAGS) -c mpi_mips.s
   123 mpi_sparc.o : montmulf.h
   125 mpv_sparcv9.s: vis_64.il mpv_sparc.c
   126 	$(CC) -o $@ $(SOLARIS_FPU_FLAGS) -S vis_64.il mpv_sparc.c
   128 mpv_sparcv8.s: vis_64.il mpv_sparc.c
   129 	$(CC) -o $@ $(SOLARIS_FPU_FLAGS) -S vis_32.il mpv_sparc.c
   131 montmulfv8.o montmulfv9.o mpv_sparcv8.o mpv_sparcv9.o : %.o : %.s 
   132 	$(CC) -o $@ $(SOLARIS_ASM_FLAGS) -c $<
   134 mpi_arm.o: mpi_arm.c $(LIBHDRS)
   136 # This rule is used to build the .s sources, which are then hand optimized.
   137 #montmulfv8.s montmulfv9.s : montmulf%.s : montmulf%.il montmulf.c montmulf.h 
   138 #	$(CC) -o $@ $(SOLARIS_ASM_FLAGS) -S montmulf$*.il montmulf.c
   141 libmpi.a: $(LIBOBJS)
   142 	ar -cvr libmpi.a $(LIBOBJS)
   143 	$(RANLIB) libmpi.a
   145 lib libs: libmpi.a
   147 mpi.i: mpi.h
   149 #---------------------------------------
   151 MPTESTOBJS = mptest1.o mptest2.o mptest3.o mptest3a.o mptest4.o mptest4a.o \
   152 	mptest4b.o mptest6.o mptest7.o mptest8.o mptest9.o mptestb.o
   153 MPTESTS = $(MPTESTOBJS:.o=)
   155 $(MPTESTOBJS): mptest%.o: tests/mptest-%.c $(LIBHDRS)
   156 	$(CC) $(CFLAGS) -o $@ -c $<
   158 $(MPTESTS): mptest%: mptest%.o libmpi.a
   159 	$(CC) $(CFLAGS) -o $@ $^  $(LIBS)
   161 tests: mptest1 mptest2 mptest3 mptest3a mptest4 mptest4a mptest4b mptest6 \
   162 	mptestb bbsrand
   164 utests: mptest7 mptest8 mptest9
   166 #---------------------------------------
   168 EXTRAOBJS = bbsrand.o bbs_rand.o prng.o
   169 UTILOBJS = primegen.o metime.o identest.o basecvt.o fact.o exptmod.o pi.o \
   170 	makeprime.o gcd.o invmod.o lap.o isprime.o \
   171 	dec2hex.o hex2dec.o
   172 UTILS = $(UTILOBJS:.o=) 
   174 $(UTILS): % : %.o libmpi.a
   175 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   177 $(UTILOBJS) $(EXTRAOBJS): %.o : utils/%.c $(LIBHDRS)
   178 	$(CC) $(CFLAGS) -o $@ -c $<
   180 prng: prng.o bbs_rand.o libmpi.a
   181 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   183 bbsrand: bbsrand.o bbs_rand.o libmpi.a
   184 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   186 utils: $(UTILS) prng bbsrand
   188 #---------------------------------------
   190 test-info.c: test-arrays.txt
   191 	$(PERL) make-test-arrays test-arrays.txt > test-info.c
   193 mpi-test.o: mpi-test.c test-info.c $(LIBHDRS)
   194 	$(CC) $(CFLAGS) -o $@ -c $<
   196 mpi-test: mpi-test.o libmpi.a
   197 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   199 mdxptest.o: mdxptest.c $(LIBHDRS) mpi-priv.h
   201 mdxptest: mdxptest.o libmpi.a
   202 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   204 mulsqr.o: mulsqr.c logtab.h mpi.h mpi-config.h mpprime.h 
   205 	$(CC) $(CFLAGS) -DMP_SQUARE=1 -o $@ -c mulsqr.c 
   207 mulsqr: mulsqr.o libmpi.a
   208 	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
   210 #---------------------------------------
   212 alltests: tests utests mpi-test
   214 tools: $(TOOLS)
   216 doc:
   217 	(cd doc; ./build)
   219 clean:
   220 	rm -f *.o *.a *.i
   221 	rm -f core
   222 	rm -f *~ .*~
   223 	rm -f utils/*.o
   224 	rm -f utils/core
   225 	rm -f utils/*~ utils/.*~
   227 clobber: clean
   228 	rm -f $(TOOLS) $(UTILS)
   230 distclean: clean
   231 	rm -f mptest? mpi-test metime mulsqr karatsuba
   232 	rm -f mptest?a mptest?b
   233 	rm -f utils/mptest?
   234 	rm -f test-info.c logtab.h
   235 	rm -f libmpi.a
   236 	rm -f $(TOOLS)
   238 dist: Makefile $(HDRS) $(SRCS) $(DOCS)
   239 	tar -cvf mpi-$(VERS).tar Makefile $(HDRS) $(SRCS) $(DOCS)
   240 	pgps -ab mpi-$(VERS).tar
   241 	chmod +r mpi-$(VERS).tar.asc
   242 	gzip -9 mpi-$(VERS).tar
   244 # END

mercurial