From 0348ff7a11f55a8bd45f147bb8710e7ed91fbd16 Mon Sep 17 00:00:00 2001 From: Joost Rijneveld Date: Wed, 27 Feb 2019 09:15:00 +0100 Subject: [PATCH] Also include implementation namespace in Makefiles --- Makefile | 6 +++--- test/Makefile.Microsoft_nmake | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4c77e7f6..44d53d92 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ endif bin/functest_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))functest.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme mkdir -p bin $(CC) $(CFLAGS) \ - -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ + -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME)))_CLEAN | tr a-z A-Z) \ -iquote "./common/" \ -iquote "$(SCHEME)/clean/" \ -o bin/functest_$(subst /,_,$(SCHEME)) \ @@ -44,7 +44,7 @@ endif bin/sanitizer_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))functest.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme mkdir -p bin $(CC) $(CFLAGS) -fsanitize=address,undefined \ - -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ + -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME)))_CLEAN | tr a-z A-Z) \ -iquote "./common/" \ -iquote "$(SCHEME)/clean/" \ -o bin/sanitizer_$(subst /,_,$(SCHEME)) \ @@ -59,7 +59,7 @@ sanitizer: bin/sanitizer_$(subst /,_,$(SCHEME)) bin/shared_$(subst /,_,$(SCHEME))_clean.so: $(wildcard $(SCHEME)/clean/*.c) | require_scheme mkdir -p bin $(CC) $(CFLAGS) \ - -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ + -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME)))_CLEAN | tr a-z A-Z) \ -nostdlib \ -shared \ -fPIC \ diff --git a/test/Makefile.Microsoft_nmake b/test/Makefile.Microsoft_nmake index bf86a0cc..afc082c2 100644 --- a/test/Makefile.Microsoft_nmake +++ b/test/Makefile.Microsoft_nmake @@ -6,6 +6,7 @@ TYPE=kem SCHEME=kyber768 SCHEME_UPPERCASE=KYBER768 IMPLEMENTATION=clean +IMPLEMENTATION_UPPERCASE=CLEAN SCHEME_DIR=..\crypto_$(TYPE)\$(SCHEME)\$(IMPLEMENTATION) @@ -27,12 +28,12 @@ rebuild-scheme: $(DEST_DIR)\functest_$(SCHEME)_$(IMPLEMENTATION).EXE: rebuild-scheme $(COMMON_OBJECTS) $(COMMON_DIR)\randombytes.obj -MKDIR $(DEST_DIR) - $(CC) /c crypto_$(TYPE)\functest.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE) + $(CC) /c crypto_$(TYPE)\functest.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE) 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) - $(CC) /c crypto_$(TYPE)\testvectors.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE) + $(CC) /c crypto_$(TYPE)\testvectors.c $(CFLAGS) /I $(SCHEME_DIR) /DPQCLEAN_NAMESPACE=PQCLEAN_$(SCHEME_UPPERCASE)_$(IMPLEMENTATION_UPPERCASE) LINK.EXE /OUT:$@ testvectors.obj $(COMMON_OBJECTS_NOPATH) notrandombytes.obj $(SCHEME_DIR)\lib$(SCHEME)_$(IMPLEMENTATION).lib clean: