security/nss/lib/freebl/ecl/Makefile

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/lib/freebl/ecl/Makefile	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,195 @@
     1.4 +#
     1.5 +# Makefile for elliptic curve library
     1.6 +
     1.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.10 +
    1.11 +## Define CC to be the C compiler you wish to use.  The GNU cc
    1.12 +## compiler (gcc) should work, at the very least
    1.13 +#CC=cc
    1.14 +#CC=gcc
    1.15 +
    1.16 +## 
    1.17 +## Define PERL to point to your local Perl interpreter.  It
    1.18 +## should be Perl 5.x, although it's conceivable that Perl 4
    1.19 +## might work ... I haven't tested it.
    1.20 +##
    1.21 +#PERL=/usr/bin/perl
    1.22 +#PERL=perl
    1.23 +
    1.24 +include ../mpi/target.mk
    1.25 +
    1.26 +##
    1.27 +## Define platform-dependent variables for use of floating-point code.
    1.28 +##
    1.29 +ifeq ($(TARGET),v9SOLARIS)
    1.30 +ECL_USE_FP=1
    1.31 +else
    1.32 +ifeq ($(TARGET),v8plusSOLARIS)
    1.33 +ECL_USE_FP=1
    1.34 +else
    1.35 +ifeq ($(TARGET),v8SOLARIS)
    1.36 +ECL_USE_FP=1
    1.37 +else
    1.38 +ifeq ($(TARGET),x86LINUX)
    1.39 +ECL_USE_FP=1
    1.40 +endif
    1.41 +endif
    1.42 +endif
    1.43 +endif
    1.44 +
    1.45 +##
    1.46 +## Add to definition of CFLAGS depending on use of floating-point code.
    1.47 +##
    1.48 +ifeq ($(ECL_USE_FP),1)
    1.49 +CFLAGS+= -DECL_USE_FP
    1.50 +endif
    1.51 +
    1.52 +##
    1.53 +## Define LIBS to include any libraries you need to link against.
    1.54 +## If NO_TABLE is define, LIBS should include '-lm' or whatever is
    1.55 +## necessary to bring in the math library.  Otherwise, it can be
    1.56 +## left alone, unless your system has other peculiar requirements.
    1.57 +##
    1.58 +LIBS=-L../mpi -lmpi -lm#-lmalloc#-lefence
    1.59 +
    1.60 +##
    1.61 +## Define INCLUDES to include any include directories you need to 
    1.62 +## compile with.  
    1.63 +##
    1.64 +INCLUDES=-I../mpi
    1.65 +CFLAGS+= $(INCLUDES) $(XCFLAGS)
    1.66 +
    1.67 +## 
    1.68 +## Define RANLIB to be the library header randomizer; you might not
    1.69 +## need this on some systems (just set it to 'echo' on these systems,
    1.70 +## such as IRIX)
    1.71 +##
    1.72 +RANLIB=echo
    1.73 +
    1.74 +## 
    1.75 +## Define LIBOBJS to be the object files that will be created during
    1.76 +## the build process.
    1.77 +##
    1.78 +LIBOBJS = ecl.o ecl_curve.o ecl_mult.o ecl_gf.o \
    1.79 +	ec2_aff.o ec2_mont.o ec2_proj.o \
    1.80 +	ec2_163.o ec2_193.o ec2_233.o \
    1.81 +	ecp_aff.o ecp_jac.o ecp_mont.o \
    1.82 +	ec_naf.o ecp_jm.o \
    1.83 +	ecp_192.o ecp_224.o ecp_256.o ecp_384.o ecp_521.o \
    1.84 +	ecp_256_32.o
    1.85 +ifeq ($(ECL_USE_FP),1)
    1.86 +LIBOBJS+= ecp_fp160.o ecp_fp192.o ecp_fp224.o ecp_fp.o
    1.87 +endif
    1.88 +
    1.89 +## The headers contained in this library.
    1.90 +LIBHDRS = ecl-exp.h ecl.h ec2.h ecp.h ecl-priv.h ecl-curve.h
    1.91 +APPHDRS = ecl-exp.h ecl.h ec2.h ecp.h ecl-priv.h ecl-curve.h
    1.92 +ifeq ($(ECL_GFP_ASSEMBLY_FP),1)
    1.93 +LIBHDRS += ecp_fp.h
    1.94 +APPHDRS += ecp_fp.h
    1.95 +endif
    1.96 +
    1.97 +
    1.98 +help:
    1.99 +	@ echo ""
   1.100 +	@ echo "The following targets can be built with this Makefile:"
   1.101 +	@ echo ""
   1.102 +	@ echo "libecl.a     - elliptic curve library"
   1.103 +	@ echo "tests        - build command line tests"
   1.104 +	@ echo "test         - run command line tests"
   1.105 +	@ echo "clean        - clean up objects and such"
   1.106 +	@ echo ""
   1.107 +
   1.108 +.SUFFIXES: .c .o .i
   1.109 +
   1.110 +.c.i:
   1.111 +	$(CC) $(CFLAGS) -E $< > $@
   1.112 +
   1.113 +#---------------------------------------
   1.114 +
   1.115 +$(LIBOBJS): $(LIBHDRS)
   1.116 +
   1.117 +ecl.o: ecl.c $(LIBHDRS)
   1.118 +ecl_curve.o: ecl_curve.c $(LIBHDRS)
   1.119 +ecl_mult.o: ecl_mult.c $(LIBHDRS)
   1.120 +ecl_gf.o: ecl_gf.c $(LIBHDRS)
   1.121 +ec2_aff.o: ec2_aff.c $(LIBHDRS)
   1.122 +ec2_mont.o: ec2_mont.c $(LIBHDRS)
   1.123 +ec2_proj.o: ec2_proj.c $(LIBHDRS)
   1.124 +ec2_163.o: ec2_163.c $(LIBHDRS)
   1.125 +ec2_193.o: ec2_193.c $(LIBHDRS)
   1.126 +ec2_233.o: ec2_233.c $(LIBHDRS)
   1.127 +ecp_aff.o: ecp_aff.c $(LIBHDRS)
   1.128 +ecp_jac.o: ecp_jac.c $(LIBHDRS)
   1.129 +ecp_jm.o: ecp_jm.c $(LIBHDRS)
   1.130 +ecp_mont.o: ecp_mont.c $(LIBHDRS)
   1.131 +ecp_192.o: ecp_192.c $(LIBHDRS)
   1.132 +ecp_224.o: ecp_224.c $(LIBHDRS)
   1.133 +ecp_256.o: ecp_256.c $(LIBHDRS)
   1.134 +ecp_384.o: ecp_384.c $(LIBHDRS)
   1.135 +ecp_521.o: ecp_521.c $(LIBHDRS)
   1.136 +ecp_fp.o: ecp_fp.c $(LIBHDRS)
   1.137 +ifeq ($(ECL_USE_FP),1)
   1.138 +ecp_fp160.o: ecp_fp160.c ecp_fpinc.c $(LIBHDRS)
   1.139 +ecp_fp192.o: ecp_fp192.c ecp_fpinc.c $(LIBHDRS)
   1.140 +ecp_fp224.o: ecp_fp224.c ecp_fpinc.c $(LIBHDRS)
   1.141 +endif
   1.142 +
   1.143 +libecl.a: $(LIBOBJS)
   1.144 +	ar -cvr libecl.a $(LIBOBJS)
   1.145 +	$(RANLIB) libecl.a
   1.146 +
   1.147 +lib libs: libecl.a
   1.148 +
   1.149 +ecl.i: ecl.h
   1.150 +
   1.151 +#---------------------------------------
   1.152 +
   1.153 +ECLTESTOBJS = ec2_test.o ecp_test.o ec_naft.o
   1.154 +ifeq ($(ECL_USE_FP),1)
   1.155 +ECLTESTOBJS+= ecp_fpt.o
   1.156 +endif
   1.157 +ECLTESTS = $(ECLTESTOBJS:.o=)
   1.158 +
   1.159 +$(ECLTESTOBJS): %.o: tests/%.c $(LIBHDRS)
   1.160 +	$(CC) $(CFLAGS) -o $@ -c $<  $(INCLUDES)
   1.161 +
   1.162 +$(ECLTESTS): %: %.o libecl.a
   1.163 +	$(CC) $(CFLAGS) -o $@ $^  $(LIBS)
   1.164 +
   1.165 +ifeq ($(ECL_USE_FP),1)
   1.166 +tests: ec2_test ecp_test ec_naft ecp_fpt 
   1.167 +else
   1.168 +tests: ec2_test ecp_test ec_naft
   1.169 +endif
   1.170 +
   1.171 +#---------------------------------------
   1.172 +
   1.173 +ifeq ($(ECL_USE_FP),1)
   1.174 +test: tests
   1.175 +	./ecp_test
   1.176 +	./ec2_test
   1.177 +	./ec_naft
   1.178 +	./ecp_fpt
   1.179 +else
   1.180 +test: tests
   1.181 +	./ecp_test
   1.182 +	./ec_naft
   1.183 +	./ec2_test
   1.184 +endif
   1.185 +
   1.186 +#---------------------------------------
   1.187 +
   1.188 +alltests: tests
   1.189 +
   1.190 +clean:
   1.191 +	rm -f *.o *.a *.i
   1.192 +	rm -f core
   1.193 +	rm -f *~ .*~
   1.194 +	rm -f $(ECLTESTS)
   1.195 +
   1.196 +clobber: clean
   1.197 +
   1.198 +# END

mercurial