1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/freebl/mpi/Makefile.win Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,254 @@ 1.4 +# 1.5 +# Makefile.win - gmake Makefile for building MPI with MSVC on NT 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 +CC=cl.exe 1.16 +ifeq ($(CPU_ARCH),x86_64) 1.17 +AS=ml64.exe 1.18 +else 1.19 +AS=ml.exe 1.20 +endif 1.21 + 1.22 +## 1.23 +## Define PERL to point to your local Perl interpreter. It 1.24 +## should be Perl 5.x, although it's conceivable that Perl 4 1.25 +## might work ... I haven't tested it. 1.26 +## 1.27 +#PERL=/usr/bin/perl 1.28 +#PERL=perl 1.29 + 1.30 +## 1.31 +## Define CFLAGS to contain any local options your compiler 1.32 +## setup requires. 1.33 +## 1.34 +## Conditional compilation options are no longer here; see 1.35 +## the file 'mpi-config.h' instead. 1.36 +## 1.37 +MPICMN = -I. -DMP_API_COMPATIBLE -DMP_IOFUNC 1.38 + 1.39 +ifeq ($(CPU_ARCH),x86_64) 1.40 +AS_SRCS = mpi_x86_64.asm 1.41 +CFLAGS = -O2 -Z7 -MD -W3 -nologo -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ 1.42 + -DWIN32 -D_WIN64 -D_AMD64_ -D_M_AMD64 -D_WINDOWS -DWIN95 $(MPICMN) 1.43 +ASFLAGS = -Cp -Sn -Zi -I. 1.44 +else 1.45 +#NT 1.46 +AS_SRCS = mpi_x86.asm 1.47 +MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D 1.48 +#CFLAGS= -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC \ 1.49 + -DDEBUG -D_DEBUG -UNDEBUG -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) 1.50 +#CFLAGS = -O2 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ 1.51 + -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) 1.52 +#CFLAGS = -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ 1.53 + -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) 1.54 +CFLAGS = -O2 -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \ 1.55 + -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN) 1.56 +ASFLAGS = -Cp -Sn -Zi -coff -I. 1.57 +endif 1.58 + 1.59 +## 1.60 +## Define LIBS to include any libraries you need to link against. 1.61 +## If NO_TABLE is define, LIBS should include '-lm' or whatever is 1.62 +## necessary to bring in the math library. Otherwise, it can be 1.63 +## left alone, unless your system has other peculiar requirements. 1.64 +## 1.65 +LIBS=#-lmalloc#-lefence#-lm 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 +## This is the version string used for the documentation and 1.76 +## building the distribution tarball. Don't mess with it unless 1.77 +## you are releasing a new version 1.78 +VERS=1.7p6 1.79 + 1.80 +## ---------------------------------------------------------------------- 1.81 +## You probably don't need to change anything below this line... 1.82 +## 1.83 + 1.84 +## 1.85 +## This is the list of source files that need to be packed into 1.86 +## the distribution file 1.87 +SRCS= mpi.c mpprime.c mplogic.c mpmontg.c mpi-test.c primes.c tests/ \ 1.88 + utils/gcd.c utils/invmod.c utils/lap.c \ 1.89 + utils/ptab.pl utils/sieve.c utils/isprime.c\ 1.90 + utils/dec2hex.c utils/hex2dec.c utils/bbs_rand.c \ 1.91 + utils/bbsrand.c utils/prng.c utils/primegen.c \ 1.92 + utils/basecvt.c utils/makeprime.c\ 1.93 + utils/fact.c utils/exptmod.c utils/pi.c utils/metime.c \ 1.94 + utils/mpi.h utils/mpprime.h mulsqr.c \ 1.95 + make-test-arrays test-arrays.txt all-tests make-logtab \ 1.96 + types.pl stats timetest multest 1.97 + 1.98 +## These are the header files that go into the distribution file 1.99 +HDRS=mpi.h mpi-config.h utils/mpi.h utils/mpi-config.h mpprime.h mplogic.h \ 1.100 + utils/bbs_rand.h tests/mpi.h tests/mpprime.h 1.101 + 1.102 +## These are the documentation files that go into the distribution file 1.103 +DOCS=README doc utils/README utils/PRIMES 1.104 + 1.105 +## This is the list of tools built by 'make tools' 1.106 +TOOLS=gcd.exe invmod.exe isprime.exe lap.exe dec2hex.exe hex2dec.exe \ 1.107 + primegen.exe prng.exe basecvt.exe fact.exe exptmod.exe pi.exe makeprime.exe 1.108 + 1.109 +AS_OBJS = $(AS_SRCS:.asm=.obj) 1.110 +LIBOBJS = mpprime.obj mpmontg.obj mplogic.obj mpi.obj $(AS_OBJS) 1.111 +LIBHDRS = mpi-config.h mpi-priv.h mpi.h 1.112 +APPHDRS = mpi-config.h mpi.h mplogic.h mpprime.h 1.113 + 1.114 + 1.115 +help: 1.116 + @ echo "" 1.117 + @ echo "The following targets can be built with this Makefile:" 1.118 + @ echo "" 1.119 + @ echo "mpi.lib - arithmetic and prime testing library" 1.120 + @ echo "mpi-test - test driver (requires MP_IOFUNC)" 1.121 + @ echo "tools - command line tools" 1.122 + @ echo "doc - manual pages for tools" 1.123 + @ echo "clean - clean up objects and such" 1.124 + @ echo "distclean - get ready for distribution" 1.125 + @ echo "dist - distribution tarball" 1.126 + @ echo "" 1.127 + 1.128 +.SUFFIXES: .c .obj .i .lib .exe .asm 1.129 + 1.130 +.c.i: 1.131 + $(CC) $(CFLAGS) -E $< > $@ 1.132 + 1.133 +.c.obj: 1.134 + $(CC) $(CFLAGS) -c $< 1.135 + 1.136 +.asm.obj: 1.137 + $(AS) $(ASFLAGS) -c $< 1.138 + 1.139 +.obj.exe: 1.140 + $(CC) $(CFLAGS) -Fo$@ $< 1.141 + 1.142 +#--------------------------------------- 1.143 + 1.144 +$(LIBOBJS): $(LIBHDRS) 1.145 + 1.146 +logtab.h: make-logtab 1.147 + $(PERL) make-logtab > logtab.h 1.148 + 1.149 +mpi.obj: mpi.c logtab.h $(LIBHDRS) 1.150 + 1.151 +mplogic.obj: mplogic.c mpi-priv.h mplogic.h $(LIBHDRS) 1.152 + 1.153 +mpmontg.obj: mpmontg.c mpi-priv.h mplogic.h mpprime.h $(LIBHDRS) 1.154 + 1.155 +mpprime.obj: mpprime.c mpi-priv.h mpprime.h mplogic.h primes.c $(LIBHDRS) 1.156 + 1.157 +mpi_mips.obj: mpi_mips.s 1.158 + $(CC) -Fo$@ $(ASFLAGS) -c mpi_mips.s 1.159 + 1.160 +mpi.lib: $(LIBOBJS) 1.161 + ar -cvr mpi.lib $(LIBOBJS) 1.162 + $(RANLIB) mpi.lib 1.163 + 1.164 +lib libs: mpi.lib 1.165 + 1.166 +#--------------------------------------- 1.167 + 1.168 +MPTESTOBJS = mptest1.obj mptest2.obj mptest3.obj mptest3a.obj mptest4.obj \ 1.169 + mptest4a.obj mptest4b.obj mptest6.obj mptest7.obj mptest8.obj mptest9.obj 1.170 +MPTESTS = $(MPTESTOBJS:.obj=.exe) 1.171 + 1.172 +$(MPTESTOBJS): mptest%.obj: tests/mptest-%.c $(LIBHDRS) 1.173 + $(CC) $(CFLAGS) -Fo$@ -c $< 1.174 + 1.175 +$(MPTESTS): mptest%.exe: mptest%.obj mpi.lib $(LIBS) 1.176 + $(CC) $(CFLAGS) -Fo$@ $^ 1.177 + 1.178 +tests: mptest1.exe mptest2.exe mptest3.exe mptest3a.exe mptest4.exe \ 1.179 + mptest4a.exe mptest4b.exe mptest6.exe bbsrand.exe 1.180 + 1.181 +utests: mptest7.exe mptest8.exe mptest9.exe 1.182 + 1.183 +#--------------------------------------- 1.184 + 1.185 +EXTRAOBJS = bbsrand.obj bbs_rand.obj prng.obj 1.186 +UTILOBJS = primegen.obj metime.obj identest.obj basecvt.obj fact.obj \ 1.187 + exptmod.obj pi.obj makeprime.obj karatsuba.obj gcd.obj invmod.obj lap.obj \ 1.188 + isprime.obj dec2hex.obj hex2dec.obj 1.189 +UTILS = $(UTILOBJS:.obj=.exe) 1.190 + 1.191 +$(UTILS): %.exe : %.obj mpi.lib $(LIBS) 1.192 + $(CC) $(CFLAGS) -Fo$@ $^ 1.193 + 1.194 +$(UTILOBJS) $(EXTRAOBJS): %.obj : utils/%.c $(LIBHDRS) 1.195 + $(CC) $(CFLAGS) -Fo$@ -c $< 1.196 + 1.197 +prng.exe: prng.obj bbs_rand.obj mpi.lib $(LIBS) 1.198 + $(CC) $(CFLAGS) -Fo$@ $^ 1.199 + 1.200 +bbsrand.exe: bbsrand.obj bbs_rand.obj mpi.lib $(LIBS) 1.201 + $(CC) $(CFLAGS) -Fo$@ $^ 1.202 + 1.203 +utils: $(UTILS) prng.exe bbsrand.exe 1.204 + 1.205 +#--------------------------------------- 1.206 + 1.207 +test-info.c: test-arrays.txt 1.208 + $(PERL) make-test-arrays test-arrays.txt > test-info.c 1.209 + 1.210 +mpi-test.obj: mpi-test.c test-info.c $(LIBHDRS) 1.211 + $(CC) $(CFLAGS) -Fo$@ -c $< 1.212 + 1.213 +mpi-test.exe: mpi-test.obj mpi.lib $(LIBS) 1.214 + $(CC) $(CFLAGS) -Fo$@ $^ 1.215 + 1.216 +mdxptest.obj: mdxptest.c $(LIBHDRS) mpi-priv.h 1.217 + 1.218 +mdxptest.exe: mdxptest.obj mpi.lib $(LIBS) 1.219 + $(CC) $(CFLAGS) -Fo$@ $^ 1.220 + 1.221 +mulsqr.obj: mulsqr.c logtab.h mpi.h mpi-config.h mpprime.h 1.222 + $(CC) $(CFLAGS) -DMP_SQUARE=1 -Fo$@ -c mulsqr.c 1.223 + 1.224 +mulsqr.exe: mulsqr.obj mpi.lib $(LIBS) 1.225 + $(CC) $(CFLAGS) -Fo$@ $^ 1.226 + 1.227 +#--------------------------------------- 1.228 + 1.229 +alltests: tests utests mpi-test.exe 1.230 + 1.231 +tools: $(TOOLS) 1.232 + 1.233 +doc: 1.234 + (cd doc; ./build) 1.235 + 1.236 +clean: 1.237 + rm -f *.obj *.lib *.pdb *.ilk 1.238 + cd utils; rm -f *.obj *.lib *.pdb *.ilk 1.239 + 1.240 +distclean: clean 1.241 + rm -f mptest? mpi-test metime mulsqr karatsuba 1.242 + rm -f mptest?a mptest?b 1.243 + rm -f utils/mptest? 1.244 + rm -f test-info.c logtab.h 1.245 + rm -f mpi.lib 1.246 + rm -f $(TOOLS) 1.247 + 1.248 +dist: Makefile $(HDRS) $(SRCS) $(DOCS) 1.249 + tar -cvf mpi-$(VERS).tar Makefile $(HDRS) $(SRCS) $(DOCS) 1.250 + pgps -ab mpi-$(VERS).tar 1.251 + chmod +r mpi-$(VERS).tar.asc 1.252 + gzip -9 mpi-$(VERS).tar 1.253 + 1.254 + 1.255 +print: 1.256 + @echo LIBOBJS = $(LIBOBJS) 1.257 +# END