1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 23:48:58 +00:00
pqcrypto/test/Makefile.Microsoft_nmake
Douglas Stebila 0145ddaa1b More stack!
2019-04-04 12:45:24 -04:00

54 lines
2.0 KiB
Makefile

# This Makefile can be used with Microsoft Visual Studio's nmake using the command:
# nmake /f Makefile.Microsoft_nmake
# override as desired, use /E
# vim: set ts=4 sw=4 et:
TYPE=kem
SCHEME=kyber768
SCHEME_UPPERCASE=KYBER768
IMPLEMENTATION=clean
IMPLEMENTATION_UPPERCASE=CLEAN
SCHEME_DIR=..\crypto_$(TYPE)\$(SCHEME)\$(IMPLEMENTATION)
COMMON_DIR=..\common
COMMON_OBJECTS=$(COMMON_DIR)\fips202.obj $(COMMON_DIR)\sha2.obj
COMMON_OBJECTS_NOPATH=fips202.obj sha2.obj
DEST_DIR=..\bin
CFLAGS=/nologo /I $(COMMON_DIR) /W4 /WX
all: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).EXE $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).EXE
build-scheme:
cd $(SCHEME_DIR)
nmake /f Makefile.Microsoft_nmake
cd ..\..\..\test
clean-scheme:
cd $(SCHEME_DIR)
nmake /f Makefile.Microsoft_nmake clean
cd ..\..\..\test
functest: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe
testvectors: $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).exe
$(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe: build-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\randombytes.obj
-MKDIR $(DEST_DIR)
-DEL functest.obj
$(CC) /c crypto_$(TYPE)\functest.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
LINK.EXE /STACK:8192000 /OUT:$@ functest.obj $(COMMON_OBJECTS_NOPATH) randombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib Advapi32.lib
$(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).exe: build-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\notrandombytes.obj
-MKDIR $(DEST_DIR)
-DEL testvectors.obj
$(CC) /c crypto_$(TYPE)\testvectors.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
LINK.EXE /STACK:8192000 /OUT:$@ testvectors.obj $(COMMON_OBJECTS_NOPATH) notrandombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib
clean:
-DEL functest.obj testvectors.obj
-DEL $(COMMON_OBJECTS_NOPATH) randombytes.obj notrandombytes.obj
-DEL $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe