2019-02-26 02:40:43 +00:00
|
|
|
# This Makefile can be used with Microsoft Visual Studio's nmake using the command:
|
|
|
|
# nmake /f Makefile.Microsoft_nmake
|
|
|
|
|
2019-03-04 14:12:38 +00:00
|
|
|
# override as desired, use /E
|
2019-02-27 11:44:21 +00:00
|
|
|
# vim: set ts=4 sw=4 et:
|
2019-02-26 02:40:43 +00:00
|
|
|
TYPE=kem
|
|
|
|
SCHEME=kyber768
|
|
|
|
SCHEME_UPPERCASE=KYBER768
|
|
|
|
IMPLEMENTATION=clean
|
2019-02-27 08:15:00 +00:00
|
|
|
IMPLEMENTATION_UPPERCASE=CLEAN
|
2019-02-26 02:40:43 +00:00
|
|
|
|
|
|
|
SCHEME_DIR=..\crypto_$(TYPE)\$(SCHEME)\$(IMPLEMENTATION)
|
|
|
|
|
2019-07-26 09:26:14 +01:00
|
|
|
TEST_COMMON_DIR=..\test\common
|
2019-02-26 02:40:43 +00:00
|
|
|
COMMON_DIR=..\common
|
2019-06-07 10:46:55 +01:00
|
|
|
COMMON_OBJECTS=$(COMMON_DIR)\aes.obj $(COMMON_DIR)\fips202.obj $(COMMON_DIR)\sha2.obj $(COMMON_DIR)\sp800-185.obj
|
|
|
|
COMMON_OBJECTS_NOPATH=aes.obj fips202.obj sha2.obj sp800-185.obj
|
2019-02-26 02:40:43 +00:00
|
|
|
|
|
|
|
DEST_DIR=..\bin
|
|
|
|
|
2019-10-21 13:23:59 +01:00
|
|
|
CFLAGS=/nologo /O2 /I $(COMMON_DIR) /W4 /WX
|
2019-02-26 02:40:43 +00:00
|
|
|
|
|
|
|
all: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).EXE $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).EXE
|
|
|
|
|
2019-02-27 10:29:39 +00:00
|
|
|
build-scheme:
|
2019-02-26 02:40:43 +00:00
|
|
|
cd $(SCHEME_DIR)
|
|
|
|
nmake /f Makefile.Microsoft_nmake
|
|
|
|
cd ..\..\..\test
|
2019-02-27 11:44:21 +00:00
|
|
|
|
|
|
|
clean-scheme:
|
|
|
|
cd $(SCHEME_DIR)
|
|
|
|
nmake /f Makefile.Microsoft_nmake clean
|
|
|
|
cd ..\..\..\test
|
2019-02-26 02:40:43 +00:00
|
|
|
|
2019-03-04 14:12:38 +00:00
|
|
|
functest: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
|
|
|
|
testvectors: $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
|
2019-04-05 16:21:56 +01:00
|
|
|
printparams: $(DEST_DIR)\printparams_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
|
2019-04-15 00:31:15 +01:00
|
|
|
nistkat: $(DEST_DIR)\nistkat_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
|
2019-03-04 14:12:38 +00:00
|
|
|
$(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe: build-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\randombytes.obj
|
2019-02-26 02:40:43 +00:00
|
|
|
-MKDIR $(DEST_DIR)
|
2019-03-04 14:12:38 +00:00
|
|
|
-DEL functest.obj
|
2019-02-27 08:15:00 +00:00
|
|
|
$(CC) /c crypto_$(TYPE)\functest.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
|
2019-04-04 17:45:24 +01:00
|
|
|
LINK.EXE /STACK:8192000 /OUT:$@ functest.obj $(COMMON_OBJECTS_NOPATH) randombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib Advapi32.lib
|
2019-02-26 02:40:43 +00:00
|
|
|
|
2019-07-26 09:26:14 +01:00
|
|
|
$(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).exe: build-scheme $(COMMON_OBJECTS) $(TEST_COMMON_DIR)\notrandombytes.obj
|
2019-02-26 02:40:43 +00:00
|
|
|
-MKDIR $(DEST_DIR)
|
2019-03-04 14:12:38 +00:00
|
|
|
-DEL testvectors.obj
|
2019-02-27 08:15:00 +00:00
|
|
|
$(CC) /c crypto_$(TYPE)\testvectors.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
|
2019-04-04 17:45:24 +01:00
|
|
|
LINK.EXE /STACK:8192000 /OUT:$@ testvectors.obj $(COMMON_OBJECTS_NOPATH) notrandombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib
|
2019-02-26 02:40:43 +00:00
|
|
|
|
2019-04-05 16:21:56 +01:00
|
|
|
$(DEST_DIR)\printparams_$(SCHEME)_$(IMPLEMENTATION).exe: crypto_$(TYPE)\printparams.c $(SCHEME_DIR)\api.h
|
|
|
|
-MKDIR $(DEST_DIR)
|
|
|
|
-DEL printparams.obj
|
|
|
|
$(CC) /c crypto_$(TYPE)\printparams.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
|
|
|
|
LINK.EXE /OUT:$@ printparams.obj
|
|
|
|
|
2019-07-26 09:26:14 +01:00
|
|
|
$(DEST_DIR)\nistkat_$(SCHEME)_$(IMPLEMENTATION).exe: build-scheme $(COMMON_OBJECTS) $(TEST_COMMON_DIR)\nistkatrng.obj
|
2019-04-15 00:31:15 +01:00
|
|
|
-MKDIR $(DEST_DIR)
|
|
|
|
-DEL nistkat.obj
|
|
|
|
$(CC) /c crypto_$(TYPE)\nistkat.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE)
|
2019-04-15 00:35:28 +01:00
|
|
|
LINK.EXE /STACK:8192000 /OUT:$@ nistkat.obj $(COMMON_OBJECTS_NOPATH) nistkatrng.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib
|
2019-04-15 00:31:15 +01:00
|
|
|
|
2019-02-26 02:40:43 +00:00
|
|
|
clean:
|
2019-04-15 00:31:15 +01:00
|
|
|
-DEL functest.obj testvectors.obj printparams.obj nistkat.obj
|
2019-02-26 02:40:43 +00:00
|
|
|
-DEL $(COMMON_OBJECTS_NOPATH) randombytes.obj notrandombytes.obj
|
2019-03-04 14:12:38 +00:00
|
|
|
-DEL $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).exe
|
2019-04-15 00:31:15 +01:00
|
|
|
-DEL $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
-DEL $(DEST_DIR)\printparams_$(SCHEME)_$(IMPLEMENTATION).exe
|
|
|
|
-DEL $(DEST_DIR)\nistkat_$(SCHEME)_$(IMPLEMENTATION).exe
|