diff --git a/libft/Makefile b/libft/Makefile index a6349ed..7849653 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -6,7 +6,7 @@ # By: gbaconni +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2021/10/22 09:10:00 by gbaconni #+# #+# # -# Updated: 2021/10/22 21:24:29 by gbaconni ### ########.fr # +# Updated: 2021/10/23 10:30:24 by gbaconni ### ########.fr # # # # **************************************************************************** # # @@ -32,13 +32,26 @@ SRC = \ $(HDRDIR)/munit.c CC = gcc -CFLAGS = -Wall -Wextra -Werror -O1 +CFLAGS = -Wall -Wextra -Werror +ifeq ($(DEBUG), 1) + CFLAGS += -g -fsanitize=address -O1 +endif RM = rm RMFLAGS = -f all: compile test +debug: + @make re DEBUG=1 + +setup: + @echo "Set the location of your libft to:" + @ln -snvf $$(find ~ -mindepth 2 -maxdepth 4 -name libft.a -type f -exec dirname "{}" \; 2>/dev/null | head -n1) libft + @echo "" + @echo "If the above is not correct the correct location of your libft, use one of the following command to fix it:" + @find ~ -mindepth 2 -maxdepth 4 -name libft.h -type f -exec dirname "{}" \; 2>/dev/null | xargs -r -I{} echo ln -snvf {} libft + help: @echo "a: nemequ/µnit" @echo "b: Tripouille/libftTester" @@ -89,4 +102,3 @@ fclean: clean re: fclean all - diff --git a/libft/README.md b/libft/README.md index cb68299..f3e8bfb 100644 --- a/libft/README.md +++ b/libft/README.md @@ -6,25 +6,24 @@ Create a link to the base of your libft (the one with libft.a and all ft_ and Makefile files) ``` -cd 42test/libft +cd libft -ln -snf $(find ~ -mindepth 2 -maxdepth 4 -name libft.h -exec dirname "{}" \; 2>/dev/null | head -n1) libft +make setup -# You can also specify the path to your libft -ln -snf ~/Projects/libft/git libft -ln -snf ~/42/libft/git libft -ln -snf $HOME/libft libft +# You can also specify the path to your libft manually +ln -snvf $HOME/libft libft ``` Only for Linux ``` -sudo apt-get install -qq -y make gcc clang valgrind build-essential +sudo apt-get install -qq -y make gcc clang valgrind libbsd-dev libncurses-dev build-essential ``` ## Update ``` -cd 42test/libft +cd libft + make update ``` diff --git a/libft/libft b/libft/libft index 37dc26e..285cd2c 120000 --- a/libft/libft +++ b/libft/libft @@ -1 +1 @@ -/home/baco/42/libft/git \ No newline at end of file +/Users/baco/42/libft/git \ No newline at end of file