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
|
|
|
|
|
|
|
|
# override as desired
|
|
|
|
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)
|
|
|
|
|
|
|
|
COMMON_DIR=..\common
|
|
|
|
COMMON_OBJECTS=$(COMMON_DIR)\fips202.obj $(COMMON_DIR)\sha2.obj
|
|
|
|
COMMON_OBJECTS_NOPATH=fips202.obj sha2.obj
|
|
|
|
|
|
|
|
DEST_DIR=..\bin
|
|
|
|
|
|
|
|
CFLAGS=/I $(COMMON_DIR) /W1 /WX # FIXME: Should be /W4 but many compiler warnings in common files
|
|
|
|
|
|
|
|
all: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).EXE $(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).EXE
|
|
|
|
|
|
|
|
rebuild-scheme:
|
|
|
|
cd $(SCHEME_DIR)
|
|
|
|
nmake /f Makefile.Microsoft_nmake clean
|
|
|
|
nmake /f Makefile.Microsoft_nmake
|
|
|
|
cd ..\..\..\test
|
|
|
|
|
|
|
|
$(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).EXE: rebuild-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\randombytes.obj
|
|
|
|
-MKDIR $(DEST_DIR)
|
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-02-26 02:40:43 +00:00
|
|
|
LINK.EXE /OUT:$@ functest.obj $(COMMON_OBJECTS_NOPATH) randombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib Advapi32.lib
|
|
|
|
|
|
|
|
$(DEST_DIR)\testvectors_$(SCHEME)_$(IMPLEMENTATION).EXE: rebuild-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\notrandombytes.obj
|
|
|
|
-MKDIR $(DEST_DIR)
|
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-02-26 02:40:43 +00:00
|
|
|
LINK.EXE /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
|