From e19a0a3afa40500855954e4dba32580942461d77 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 23 Jan 2019 12:11:09 +0100 Subject: [PATCH] Add debugging symbols for Valgrind We need to use find loops to exclude *.dSYM folders created by -g on OSX. --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 604e1b5b..9e21dbda 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # This -Wall was supported by the European Commission through the ERC Starting Grant 805031 (EPOQUE) -CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 $(EXTRAFLAGS) +CFLAGS=-Wall -Wextra -Wpedantic -Werror -std=c99 -g $(EXTRAFLAGS) ALL_SCHEMES=$(filter-out crypto_%.c, $(wildcard crypto_*/*)) @@ -15,7 +15,6 @@ 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) \ - -g \ -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ -iquote "./common/" \ -iquote "$(SCHEME)/clean/" \ @@ -38,7 +37,6 @@ run-valgrind: bin/functest_$(subst /,_,$(SCHEME)) 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 \ - -g \ -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ -iquote "./common/" \ -iquote "$(SCHEME)/clean/" \ @@ -53,7 +51,6 @@ sanitizer: bin/sanitizer_$(subst /,_,$(SCHEME)) bin/testvectors_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))testvectors.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme mkdir -p bin $(CC) $(CFLAGS) \ - -g \ -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ -iquote "./common/" \ -iquote "$(SCHEME)/clean/" \ @@ -69,7 +66,6 @@ bin/shared_$(subst /,_,$(SCHEME))_clean.so: $(wildcard $(SCHEME)/clean/*.c) | re mkdir -p bin gcc $(CFLAGS) \ -DPQCLEAN_NAMESPACE=$(shell echo PQCLEAN_$(subst -,,$(notdir $(SCHEME))) | tr a-z A-Z) \ - -g \ -nostdlib \ -shared \ -fPIC \ @@ -175,7 +171,7 @@ run-symbol-namespace-all: .PHONY: run-functest-all run-functest-all: functest-all - @for functest in bin/functest_* ; do \ + @for functest in $$(find bin/ -maxdepth 1 -name 'functest_*' -not -type d) ; do \ echo ./$$functest ; \ ./$$functest || exit 1 ;\ done @@ -183,7 +179,7 @@ run-functest-all: functest-all .PHONY: run-sanitizer-all run-sanitizer-all: sanitizer-all - @for sanitizer in bin/sanitizer_* ; do \ + @for sanitizer in $$(find bin/ -maxdepth 1 -name 'sanitizer_*' -not -type d) ; do \ echo ./$$sanitizer ; \ ./$$sanitizer || exit 1 ;\ done