security/nss/lib/freebl/mpi/Makefile.os2

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 #
     2 # Makefile.win - gmake Makefile for building MPI with VACPP on OS/2
     3 #
     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
    12 CC=icc.exe
    13 AS=alp.exe
    15 ## 
    16 ## Define PERL to point to your local Perl interpreter.  It
    17 ## should be Perl 5.x, although it's conceivable that Perl 4
    18 ## might work ... I haven't tested it.
    19 ##
    20 #PERL=/usr/bin/perl
    21 #PERL=perl
    23 ##
    24 ## Define CFLAGS to contain any local options your compiler
    25 ## setup requires.
    26 ##
    27 ## Conditional compilation options are no longer here; see
    28 ## the file 'mpi-config.h' instead.
    29 ##
    30 MPICMN = -I. -DMP_API_COMPATIBLE -DMP_IOFUNC -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
    32 #OS/2
    33 AS_SRCS = mpi_x86.asm
    34 MPICMN += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D
    35 #CFLAGS= -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC \
    36  -DDEBUG -D_DEBUG -UNDEBUG -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN)
    37 #CFLAGS = -O2 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \
    38  -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN)
    39 #CFLAGS = -Od -Z7 -MD -W3 -nologo -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \
    40  -DWIN32 -D_WINDOWS -DWIN95 $(MPICMN)
    41 CFLAGS = /Ti+ -D_X86_ -DXP_PC -UDEBUG -U_DEBUG -DNDEBUG \
    42  $(MPICMN)
    43 ASFLAGS =
    45 ##
    46 ## Define LIBS to include any libraries you need to link against.
    47 ## If NO_TABLE is define, LIBS should include '-lm' or whatever is
    48 ## necessary to bring in the math library.  Otherwise, it can be
    49 ## left alone, unless your system has other peculiar requirements.
    50 ##
    51 LIBS=#-lmalloc#-lefence#-lm
    53 ## 
    54 ## Define RANLIB to be the library header randomizer; you might not
    55 ## need this on some systems (just set it to 'echo' on these systems,
    56 ## such as IRIX)
    57 ##
    58 RANLIB=echo
    60 ##
    61 ## This is the version string used for the documentation and 
    62 ## building the distribution tarball.  Don't mess with it unless
    63 ## you are releasing a new version
    64 VERS=1.7p6
    66 ## ----------------------------------------------------------------------
    67 ## You probably don't need to change anything below this line...
    68 ##
    70 ##
    71 ## This is the list of source files that need to be packed into
    72 ## the distribution file
    73 SRCS=   mpi.c mpprime.c mplogic.c mpmontg.c mpi-test.c primes.c tests/ \
    74 	utils/gcd.c utils/invmod.c utils/lap.c \
    75 	utils/ptab.pl utils/sieve.c utils/isprime.c\
    76 	utils/dec2hex.c utils/hex2dec.c utils/bbs_rand.c \
    77 	utils/bbsrand.c utils/prng.c utils/primegen.c \
    78 	utils/basecvt.c utils/makeprime.c\
    79 	utils/fact.c utils/exptmod.c utils/pi.c utils/metime.c \
    80 	utils/mpi.h utils/mpprime.h mulsqr.c \
    81 	make-test-arrays test-arrays.txt all-tests make-logtab \
    82 	types.pl stats timetest multest
    84 ## These are the header files that go into the distribution file
    85 HDRS=mpi.h mpi-config.h utils/mpi.h utils/mpi-config.h mpprime.h mplogic.h \
    86      utils/bbs_rand.h tests/mpi.h tests/mpprime.h
    88 ## These are the documentation files that go into the distribution file
    89 DOCS=README doc utils/README utils/PRIMES 
    91 ## This is the list of tools built by 'make tools'
    92 TOOLS=gcd.exe invmod.exe isprime.exe lap.exe dec2hex.exe hex2dec.exe \
    93  primegen.exe prng.exe basecvt.exe fact.exe exptmod.exe pi.exe makeprime.exe
    95 AS_OBJS = $(AS_SRCS:.asm=.obj)
    96 LIBOBJS = mpprime.obj mpmontg.obj mplogic.obj mpi.obj $(AS_OBJS)
    97 LIBHDRS = mpi-config.h mpi-priv.h mpi.h
    98 APPHDRS = mpi-config.h mpi.h mplogic.h mpprime.h
   101 help:
   102 	@ echo ""
   103 	@ echo "The following targets can be built with this Makefile:"
   104 	@ echo ""
   105 	@ echo "mpi.lib      - arithmetic and prime testing library"
   106 	@ echo "mpi-test.exe - test driver (requires MP_IOFUNC)"
   107 	@ echo "tools        - command line tools"
   108 	@ echo "doc          - manual pages for tools"
   109 	@ echo "clean        - clean up objects and such"
   110 	@ echo "distclean    - get ready for distribution"
   111 	@ echo "dist         - distribution tarball"
   112 	@ echo ""
   114 .SUFFIXES: .c .obj .i .lib .exe .asm
   116 .c.i:
   117 	$(CC) $(CFLAGS) -E $< > $@
   119 .c.obj: 
   120 	$(CC) $(CFLAGS) -c $<
   122 .asm.obj:
   123 	$(AS) $(ASFLAGS) $<
   125 .obj.exe:
   126 	$(CC) $(CFLAGS) -Fo$@ $<
   128 #---------------------------------------
   130 $(LIBOBJS): $(LIBHDRS)
   132 logtab.h: make-logtab
   133 	$(PERL) make-logtab > logtab.h
   135 mpi.obj: mpi.c logtab.h $(LIBHDRS)
   137 mplogic.obj: mplogic.c mpi-priv.h mplogic.h $(LIBHDRS)
   139 mpmontg.obj: mpmontg.c mpi-priv.h mplogic.h mpprime.h $(LIBHDRS)
   141 mpprime.obj: mpprime.c mpi-priv.h mpprime.h mplogic.h primes.c $(LIBHDRS)
   143 mpi_mips.obj: mpi_mips.s
   144 	$(CC) -Fo$@ $(ASFLAGS) -c mpi_mips.s
   146 mpi.lib: $(LIBOBJS)
   147 	ilib /out:mpi.lib $(LIBOBJS)
   148 	$(RANLIB) mpi.lib
   150 lib libs: mpi.lib
   152 #---------------------------------------
   154 MPTESTOBJS = mptest1.obj mptest2.obj mptest3.obj mptest3a.obj mptest4.obj \
   155  mptest4a.obj mptest4b.obj mptest6.obj mptest7.obj mptest8.obj mptest9.obj
   156 MPTESTS = $(MPTESTOBJS:.obj=.exe)
   158 $(MPTESTOBJS): mptest%.obj: tests/mptest-%.c $(LIBHDRS)
   159 	$(CC) $(CFLAGS) -Fo$@ -c $<
   161 $(MPTESTS): mptest%.exe: mptest%.obj mpi.lib $(LIBS)
   162 	$(CC) $(CFLAGS) -Fo$@ $^ 
   164 tests: mptest1.exe mptest2.exe mptest3.exe mptest3a.exe mptest4.exe \
   165  mptest4a.exe mptest4b.exe mptest6.exe bbsrand.exe
   167 utests: mptest7.exe mptest8.exe mptest9.exe
   169 #---------------------------------------
   171 EXTRAOBJS = bbsrand.obj bbs_rand.obj prng.obj
   172 UTILOBJS = primegen.obj metime.obj identest.obj basecvt.obj fact.obj \
   173  exptmod.obj pi.obj makeprime.obj karatsuba.obj gcd.obj invmod.obj lap.obj \
   174  isprime.obj dec2hex.obj hex2dec.obj
   175 UTILS = $(UTILOBJS:.obj=.exe) 
   177 $(UTILS): %.exe : %.obj mpi.lib $(LIBS)
   178 	$(CC) $(CFLAGS) -Fo$@ $^ 
   180 $(UTILOBJS) $(EXTRAOBJS): %.obj : utils/%.c $(LIBHDRS)
   181 	$(CC) $(CFLAGS) -Fo$@ -c $<
   183 prng.exe: prng.obj bbs_rand.obj mpi.lib $(LIBS)
   184 	$(CC) $(CFLAGS) -Fo$@ $^
   186 bbsrand.exe: bbsrand.obj bbs_rand.obj mpi.lib $(LIBS)
   187 	$(CC) $(CFLAGS) -Fo$@ $^
   189 utils: $(UTILS) prng.exe bbsrand.exe
   191 #---------------------------------------
   193 test-info.c: test-arrays.txt
   194 	$(PERL) make-test-arrays test-arrays.txt > test-info.c
   196 mpi-test.obj: mpi-test.c test-info.c $(LIBHDRS)
   197 	$(CC) $(CFLAGS) -Fo$@ -c $<
   199 mpi-test.exe: mpi-test.obj mpi.lib $(LIBS)
   200 	$(CC) $(CFLAGS) -Fo$@ $^
   202 mdxptest.obj: mdxptest.c $(LIBHDRS) mpi-priv.h
   204 mdxptest.exe: mdxptest.obj mpi.lib $(LIBS)
   205 	$(CC) $(CFLAGS) -Fo$@ $^
   207 mulsqr.obj: mulsqr.c logtab.h mpi.h mpi-config.h mpprime.h 
   208 	$(CC) $(CFLAGS) -DMP_SQUARE=1 -Fo$@ -c mulsqr.c 
   210 mulsqr.exe: mulsqr.obj mpi.lib $(LIBS)
   211 	$(CC) $(CFLAGS) -Fo$@ $^
   213 #---------------------------------------
   215 alltests: tests utests mpi-test.exe
   217 tools: $(TOOLS)
   219 doc:
   220 	(cd doc; ./build)
   222 clean:
   223 	rm -f *.obj *.lib *.pdb *.ilk
   224 	cd utils; rm -f *.obj *.lib *.pdb *.ilk
   226 distclean: clean
   227 	rm -f mptest? mpi-test metime mulsqr karatsuba
   228 	rm -f mptest?a mptest?b
   229 	rm -f utils/mptest?
   230 	rm -f test-info.c logtab.h
   231 	rm -f mpi.lib
   232 	rm -f $(TOOLS)
   234 dist: Makefile $(HDRS) $(SRCS) $(DOCS)
   235 	tar -cvf mpi-$(VERS).tar Makefile $(HDRS) $(SRCS) $(DOCS)
   236 	pgps -ab mpi-$(VERS).tar
   237 	chmod +r mpi-$(VERS).tar.asc
   238 	gzip -9 mpi-$(VERS).tar
   241 print: 
   242 	@echo LIBOBJS = $(LIBOBJS)
   243 # END

mercurial