diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-21 16:38:48 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-21 16:38:48 +0100 |
| commit | 9bb8e5cd549eca189ce183f40f771c2a614ea8f6 (patch) | |
| tree | 8f21166e4e4e9fe8a4969f802e84750b026066d5 /Makefile | |
| parent | a8f7e6e83bc4846c94c0489e0f6e0f807b35073e (diff) | |
| download | Libft-9bb8e5cd549eca189ce183f40f771c2a614ea8f6.tar.gz Libft-9bb8e5cd549eca189ce183f40f771c2a614ea8f6.zip | |
Add make sanitize target for AddressSanitizer leak checks
Add EXTRA variable to both Makefiles for passing extra compiler flags.
Update _s_crashes() to detect ASan-intercepted crashes (non-zero exit)
and suppress ASan noise from intentional NULL dereference tests.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1,5 +1,5 @@ CC = cc -CFLAGS = -Wall -Wextra -Werror +CFLAGS = -Wall -Wextra -Werror $(EXTRA) SRCDIR = src INCDIR = inc @@ -45,8 +45,11 @@ re: fclean all test: $(NAME) $(MAKE) -C tests +sanitize: fclean + $(MAKE) EXTRA="-fsanitize=address -g" test + compile_commands.json: $(SRCS:%=$(SRCDIR)/%) @echo '$(foreach src,$(SRCS),{"directory":"$(CURDIR)","command":"$(CC) $(CFLAGS) -I $(INCDIR) -c $(SRCDIR)/$(src)","file":"$(SRCDIR)/$(src)"})' \ | jq -s '.' > $@ -.PHONY: all clean fclean re test +.PHONY: all clean fclean re test sanitize |
