2016-04-25 21:45:23 +00:00
|
|
|
# cryptest.nmake - written and placed in public domain by Jeffrey Walton.
|
|
|
|
# Copyright assigned to the Crypto++ project.
|
|
|
|
|
|
|
|
# This makefile is used for testing and building cryptest.exe under nmake. Open a
|
|
|
|
# Visual Studio Developer Prompt and then run "nmake /f cryptest.nmake". The build
|
|
|
|
# procedure will reveal not-so-readily-apparent problems under Microsoft ARM and
|
|
|
|
# Metro UI apps.
|
|
|
|
|
|
|
|
# The makefile is not intended for production use, though it may be used as a starting point.
|
|
|
|
# For example, you can add switches like /MT and /MTd for dynamic runtime linking against
|
|
|
|
# the Microsoft C++ Runtime libraries. The resulting cryptlib.lib may be suitable as a
|
|
|
|
# starting point for a DLL project using Crypto++.
|
|
|
|
|
|
|
|
# The list of LIB_SRCS and TEST_SRCS was generated under Linux with "make sources". The list of
|
|
|
|
# LIB_OBJS and TEST_OBJS was generated under Linux with "make sources | sed 's|.cpp|.obj|g'".
|
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
# You are free to add and remove files to the list. For example, you can remove rdrand.asm
|
|
|
|
# build it using NASM, and then include the NASM object file rdrand_x86.obj or rdrand_x64.obj.
|
2016-04-25 21:45:23 +00:00
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
LIB_SRCS = cryptlib.cpp cpu.cpp shacal2.cpp md5.cpp shark.cpp zinflate.cpp gf2n.cpp salsa.cpp xtr.cpp oaep.cpp rc2.cpp default.cpp wait.cpp wake.cpp twofish.cpp iterhash.cpp adler32.cpp elgamal.cpp marss.cpp blowfish.cpp ecp.cpp filters.cpp strciphr.cpp camellia.cpp ida.cpp zlib.cpp des.cpp crc.cpp algparam.cpp dessp.cpp tea.cpp eax.cpp network.cpp emsa2.cpp pkcspad.cpp squaretb.cpp idea.cpp authenc.cpp hmac.cpp zdeflate.cpp xtrcrypt.cpp mars.cpp rc5.cpp queue.cpp hrtimer.cpp vmac.cpp eprecomp.cpp hex.cpp tiger.cpp dsa.cpp sha.cpp fips140.cpp gzip.cpp seal.cpp blake2.cpp files.cpp base32.cpp tigertab.cpp sharkbox.cpp safer.cpp randpool.cpp esign.cpp arc4.cpp osrng.cpp skipjack.cpp seed.cpp integer.cpp sha3.cpp sosemanuk.cpp bfinit.cpp rabin.cpp 3way.cpp rw.cpp rsa.cpp rdtables.cpp gost.cpp socketft.cpp tftables.cpp nbtheory.cpp panama.cpp modes.cpp rijndael.cpp casts.cpp chacha.cpp gfpcrypt.cpp dll.cpp ec2n.cpp polynomi.cpp blumshub.cpp algebra.cpp basecode.cpp base64.cpp cbcmac.cpp rc6.cpp dh2.cpp gf256.cpp mqueue.cpp misc.cpp pssr.cpp channels.cpp cast.cpp rng.cpp square.cpp asn.cpp whrlpool.cpp md4.cpp dh.cpp ccm.cpp md2.cpp mqv.cpp gf2_32.cpp ttmac.cpp luc.cpp trdlocal.cpp pubkey.cpp gcm.cpp ripemd.cpp eccrypto.cpp serpent.cpp cmac.cpp winpipes.cpp
|
2016-04-27 00:21:00 +00:00
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
LIB_OBJS = cryptlib.obj cpu.obj shacal2.obj md5.obj shark.obj zinflate.obj gf2n.obj salsa.obj xtr.obj oaep.obj rc2.obj default.obj wait.obj wake.obj twofish.obj iterhash.obj adler32.obj elgamal.obj marss.obj blowfish.obj ecp.obj filters.obj strciphr.obj camellia.obj ida.obj zlib.obj des.obj crc.obj algparam.obj dessp.obj tea.obj eax.obj network.obj emsa2.obj pkcspad.obj squaretb.obj idea.obj authenc.obj hmac.obj zdeflate.obj xtrcrypt.obj mars.obj rc5.obj queue.obj hrtimer.obj vmac.obj eprecomp.obj hex.obj tiger.obj dsa.obj sha.obj fips140.obj gzip.obj seal.obj blake2.obj files.obj base32.obj tigertab.obj sharkbox.obj safer.obj randpool.obj esign.obj arc4.obj osrng.obj skipjack.obj seed.obj integer.obj sha3.obj sosemanuk.obj bfinit.obj rabin.obj 3way.obj rw.obj rsa.obj rdtables.obj gost.obj socketft.obj tftables.obj nbtheory.obj panama.obj modes.obj rijndael.obj casts.obj chacha.obj gfpcrypt.obj dll.obj ec2n.obj polynomi.obj blumshub.obj algebra.obj basecode.obj base64.obj cbcmac.obj rc6.obj dh2.obj gf256.obj mqueue.obj misc.obj pssr.obj channels.obj cast.obj rng.obj square.obj asn.obj whrlpool.obj md4.obj dh.obj ccm.obj md2.obj mqv.obj gf2_32.obj ttmac.obj luc.obj trdlocal.obj pubkey.obj gcm.obj ripemd.obj eccrypto.obj serpent.obj cmac.obj winpipes.obj
|
2016-04-25 21:45:23 +00:00
|
|
|
|
2016-04-27 00:21:00 +00:00
|
|
|
TEST_SRCS = bench1.cpp bench2.cpp test.cpp validat1.cpp validat2.cpp validat3.cpp datatest.cpp regtest.cpp fipsalgt.cpp dlltest.cpp fipstest.cpp
|
2016-04-25 21:45:23 +00:00
|
|
|
|
2016-04-25 22:51:32 +00:00
|
|
|
TEST_OBJS = bench1.obj bench2.obj test.obj validat1.obj validat2.obj validat3.obj datatest.obj regtest.obj fipsalgt.obj dlltest.obj fipstest.obj
|
2016-04-25 21:45:23 +00:00
|
|
|
|
|
|
|
CXX = cl.exe
|
|
|
|
LD = link.exe
|
|
|
|
AR = lib.exe
|
|
|
|
RM = del.exe
|
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
# To test debug builds, use the following CXXFLAGS:
|
|
|
|
# - /DDEBUG /D_DEBUG /Oi /Oy- /Od
|
|
|
|
# To test release builds, use the following CXXFLAGS:
|
|
|
|
# - /DNDEBUG /D_NDEBUG /Oi /Oy /O2
|
|
|
|
# To test with dynamic C++ runtime linking, use the following CXXFLAGS:
|
|
|
|
# - /MD (release) or /MDd (debug)
|
2016-04-29 06:24:48 +00:00
|
|
|
# To test desktop app, use the following CXXFLAGS:
|
|
|
|
# - /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
2016-04-28 05:36:41 +00:00
|
|
|
# To test Windows Store app, use the following CXXFLAGS:
|
|
|
|
# - /DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
|
|
|
# To test Windows Phone, use the following CXXFLAGS:
|
|
|
|
# - /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
2016-05-01 02:48:14 +00:00
|
|
|
# To test Surface RT (ARM tablet), use the following CXXFLAGS:
|
2016-04-29 06:24:48 +00:00
|
|
|
# - /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
2016-04-28 05:36:41 +00:00
|
|
|
|
2016-05-01 02:48:14 +00:00
|
|
|
CXXFLAGS = /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapifamily.h
|
2016-04-26 21:12:21 +00:00
|
|
|
LDFLAGS = /nologo /SUBSYSTEM:CONSOLE
|
2016-04-25 21:45:23 +00:00
|
|
|
ARFLAGS = /nologo
|
2016-04-26 21:12:21 +00:00
|
|
|
LDLIBS =
|
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
!IF "$(PLATFORM)" == ""
|
|
|
|
!IF "$(PROCESSOR_ARCHITECTURE)" == "x86"
|
|
|
|
PLATFORM = x86
|
|
|
|
!ELSEIF "$(PROCESSOR_ARCHITECTURE)" == "x64"
|
|
|
|
PLATFORM = x64
|
|
|
|
!ELSE
|
|
|
|
!ERROR "Unknown platform"
|
|
|
|
!ENDIF
|
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!MESSAGE
|
|
|
|
!MESSAGE ******************************
|
|
|
|
!MESSAGE Platform is $(PLATFORM)
|
|
|
|
!MESSAGE ******************************
|
|
|
|
!MESSAGE
|
|
|
|
|
2016-05-01 02:48:14 +00:00
|
|
|
!IF "$(PLATFORM)" == "x86" || "$(PLATFORM)" == "X86"
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
2016-04-26 21:12:21 +00:00
|
|
|
AS = ml.exe
|
|
|
|
ASFLAGS = /nologo /D_M_X86 /W3 /Cx /Zi /safeseh
|
2016-05-01 02:48:14 +00:00
|
|
|
LIB_SRCS = $(LIB_SRCS) rdrand.cpp rdrand.asm
|
2016-04-28 05:36:41 +00:00
|
|
|
LIB_OBJS = $(LIB_OBJS) rdrand.obj rdrand-x86.obj
|
|
|
|
LDLIBS = $(LDLIBS) ws2_32.lib kernel32.lib
|
2016-04-26 21:12:21 +00:00
|
|
|
!ENDIF
|
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
# May need $(VCINSTALLDIR)\bin\amd64\ml64.exe
|
2016-05-01 02:48:14 +00:00
|
|
|
!IF "$(PLATFORM)" == "x64" || "$(PLATFORM)" == "X64"
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
2016-04-26 21:12:21 +00:00
|
|
|
AS = ml64.exe
|
|
|
|
ASFLAGS = /nologo /D_M_X64 /W3 /Cx /Zi
|
2016-05-01 02:48:14 +00:00
|
|
|
LIB_SRCS = $(LIB_SRCS) rdrand.cpp rdrand.asm
|
2016-04-28 05:36:41 +00:00
|
|
|
LIB_OBJS = $(LIB_OBJS) rdrand.obj rdrand-x64.obj x64masm.obj x64dll.obj
|
|
|
|
LDLIBS = $(LDLIBS) ws2_32.lib kernel32.lib
|
2016-04-26 21:12:21 +00:00
|
|
|
!ENDIF
|
|
|
|
|
|
|
|
!IF "$(PLATFORM)" == "ARM"
|
2016-05-01 02:48:14 +00:00
|
|
|
# CXXFLAGS = $(CXXFLAGS) /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 /DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
|
|
|
|
# CXXFLAGS = $(CXXFLAGS) /DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
2016-04-27 00:21:00 +00:00
|
|
|
# LDLIBS = $(LDLIBS) ws2_32.lib
|
2016-04-26 21:12:21 +00:00
|
|
|
!ENDIF
|
2016-04-25 21:45:23 +00:00
|
|
|
|
|
|
|
all: cryptest.exe
|
|
|
|
|
2016-04-27 00:21:00 +00:00
|
|
|
cryptest.exe: pch.pch cryptlib.lib $(TEST_OBJS)
|
2016-04-28 05:36:41 +00:00
|
|
|
$(LD) $(LDFLAGS) $(TEST_OBJS) cryptlib.lib $(LDLIBS) /out:$@
|
2016-04-26 21:12:21 +00:00
|
|
|
|
2016-04-28 05:36:41 +00:00
|
|
|
cryptlib.lib: $(LIB_OBJS)
|
2016-04-25 21:45:23 +00:00
|
|
|
$(AR) $(ARFLAGS) $(LIB_OBJS) /out:$@
|
|
|
|
|
|
|
|
clean:
|
2016-04-28 05:36:41 +00:00
|
|
|
$(RM) /F /Q pch.pch $(LIB_OBJS) rdrand-x86.obj rdrand-x64.obj x64masm.obj x64dll.obj cryptlib.lib $(TEST_OBJS) cryptest.exe *.pdb
|
2016-04-27 00:21:00 +00:00
|
|
|
|
|
|
|
# Precompiled header
|
|
|
|
pch.pch: pch.h pch.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) /Yc"pch.h" /Fp"pch.pch" /c pch.cpp
|
|
|
|
|
|
|
|
# No precompiled headers
|
|
|
|
iterhash.obj:
|
|
|
|
$(CXX) $(CXXFLAGS) /Y- /c iterhash.cpp
|
|
|
|
dll.obj:
|
|
|
|
$(CXX) $(CXXFLAGS) /Y- /c dll.cpp
|
2016-04-28 05:36:41 +00:00
|
|
|
rdrand.obj:
|
|
|
|
$(CXX) $(CXXFLAGS) /c rdrand.cpp
|
2016-04-26 21:12:21 +00:00
|
|
|
|
|
|
|
# Built for x86/x64
|
2016-04-28 05:36:41 +00:00
|
|
|
rdrand-x86.obj:
|
|
|
|
$(AS) $(ASFLAGS) /Fo rdrand-x86.obj /c rdrand.asm
|
|
|
|
rdrand-x64.obj:
|
|
|
|
$(AS) $(ASFLAGS) /Fo rdrand-x64.obj /c rdrand.asm
|
2016-04-26 21:12:21 +00:00
|
|
|
x64masm.obj:
|
|
|
|
$(AS) $(ASFLAGS) /Fo x64masm.obj /c x64masm.asm
|
|
|
|
x64dll.obj:
|
|
|
|
$(AS) $(ASFLAGS) /Fo x64dll.obj /c x64dll.asm
|
|
|
|
|
2016-04-27 00:21:00 +00:00
|
|
|
.cpp.obj:
|
2016-04-26 21:12:21 +00:00
|
|
|
$(CXX) $(CXXFLAGS) /c $<
|
2016-04-28 05:36:41 +00:00
|
|
|
|
|
|
|
.asm.obj:
|
|
|
|
$(AS) $(ASFLAGS) /c $<
|