~maelkum/viuavm

c6d1d0886a2dbbc28f78e7d4bf8b349c3ed9cf1b — Marek Marecki 9 months ago 580e359
Improve build and test scripts

A better "clean" production (that also picks up the cache emitted by the
test suite now).

Different build presets for testing ("test") and debugging ("debug"),
with the difference between them being that the "debug" preset does not
include sanitisers as they do not play nice with GDB.
3 files changed, 21 insertions(+), 5 deletions(-)

M new/Makefile
M new/Makefile.d/Preset/debug
A new/Makefile.d/Preset/test
M new/Makefile => new/Makefile +3 -0
@@ 110,6 110,9 @@ clean-test:
	find ./tests -type f -name '*.o' -delete
	find ./tests -type f -name '*.asm~' -delete
	find ./tests -type f -name '*.log' -delete
	find ./tests -type d -name '.cache' -print0 |\
		xargs --null -I CACHE_DIR find CACHE_DIR -type f -delete
	find ./tests -type d -name '.cache' -delete

clean: clean-test clean-bin


M new/Makefile.d/Preset/debug => new/Makefile.d/Preset/debug +2 -5
@@ 4,11 4,8 @@ CXXFLAGS_OPTIMISATION?=-Og
CXXFLAGS_DEBUG?=-ggdb

# Default sanitiser is for GCC.
# Remember to build without sanitisers if you want to use Valgrind.
CXXFLAGS_SANITISER?=\
					-fsanitize=leak \
					-fsanitize=address \
					-fsanitize=undefined
# Remember to build without sanitisers if you want to use Valgrind or GDB.
CXXFLAGS_SANITISER?=

CXXFLAGS_OPTION?=\
				 -fstack-protector-all \

A new/Makefile.d/Preset/test => new/Makefile.d/Preset/test +16 -0
@@ 0,0 1,16 @@
# vim:ft=make:

CXXFLAGS_OPTIMISATION?=-Og
CXXFLAGS_DEBUG?=-ggdb

# Default sanitiser is for GCC.
# Remember to build without sanitisers if you want to use Valgrind.
CXXFLAGS_SANITISER?=\
					-fsanitize=leak \
					-fsanitize=address \
					-fsanitize=undefined

CXXFLAGS_OPTION?=\
				 -fstack-protector-all \
				 -fstrict-aliasing \
				 -fstrict-overflow