vpath du makefile cheche a la racine de source

This commit is contained in:
Hugo LAMY
2019-11-27 19:01:28 +01:00
parent 8392fd20f0
commit 4804efecb2
83 changed files with 40 additions and 16 deletions

BIN
.Makefile.swp Normal file

Binary file not shown.

BIN
.testresults.swp Normal file

Binary file not shown.

View File

@@ -4,13 +4,14 @@
NAME = libft.a NAME = libft.a
CC = gcc CC = gcc
VPATH = srcs/part1/ \ VPATH = srcs/ \
srcs/part1/ \
srcs/part2/ \ srcs/part2/ \
srcs/bonus/ \ srcs/bonus/ \
srcs/add/ srcs/add/
IDIR = . IDIR = .
_DEP = libft.h \ _DEP = libft.h
DEPS = $(_DEP:%.h=$(IDIR)/%.h) DEPS = $(_DEP:%.h=$(IDIR)/%.h)
CFLAGS = -I$(IDIR) CFLAGS = -I$(IDIR)
@@ -99,6 +100,7 @@ SRCB = ft_lstnew.c \
OBJB = $(SRCB:%.c=$(ODIR)/%.o) OBJB = $(SRCB:%.c=$(ODIR)/%.o)
ECHO = "\033[33mcompiling objetcs\033[0m"
# - - - - - - - - - - - # # - - - - - - - - - - - #
# rules to execute # # rules to execute #
@@ -107,29 +109,31 @@ OBJB = $(SRCB:%.c=$(ODIR)/%.o)
all: $(ODIR) $(NAME) all: $(ODIR) $(NAME)
echo:
@echo "\033[33mcompiling objetcs\033[0m"
echob:
@echo "\033[33mcompiling objetcs for bonus\033[0m"
$(ODIR): $(ODIR):
@echo "\033[33mcreate $(ODIR)\033[0m" # @echo "\033[33mcreate $(ODIR)\033[0m"
@echo ""
mkdir -p $(ODIR) mkdir -p $(ODIR)
ls
@echo ""
ls srcs/
@echo ""
$(NAME): echo $(OBJS) $(DEPS) $(NAME): $(OBJS) $(DEPS)
@echo "\033[33mbuilding $(NAME)\033[0m" # @echo "\033[33mbuilding $(NAME)\033[0m"
ar -rc $@ $(OBJS) ar -rc $@ $(OBJS)
@ranlib $@ @ranlib $@
bonus: echob $(OBJB) bonus: $(OBJB)
@echo "\033[33madding the bonus functions to $(NAME)\033[0m" # @echo "\033[33madding the bonus functions to $(NAME)\033[0m"
ar -rc $(NAME) $(OBJB) ar -rc $(NAME) $(OBJB)
@ranlib $(NAME) @ranlib $(NAME)
$(ODIR)/%.o: %.c $(ODIR)/%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $< $(CC) $(CFLAGS) -c -o $@ $<
announce:
@echo $(ECHO)
clean: clean:
/bin/rm -rf $(ODIR) /bin/rm -rf $(ODIR)
@@ -724,6 +728,11 @@ re: fclean all
# creates the list of .o from the .c with addition of the # creates the list of .o from the .c with addition of the
# path directory "builds/main.o" # path directory "builds/main.o"
# #
# it could be :
# $(patsubst %.c,$(ODIR)/%.o,$(SRCS))
# or :
# $(addprefix $(ODIR)/, $(SRCS:.c=.o))
#
# ----- # -----
# #
# $(NAME): $(OBJS) $(DEPS) # $(NAME): $(OBJS) $(DEPS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
echo.txt Normal file
View File

BIN
libft.a

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */ /* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:45:53 by hulamy #+# #+# */ /* Created: 2019/11/25 14:45:53 by hulamy #+# #+# */
/* Updated: 2019/11/25 17:11:09 by hulamy ### ########.fr */ /* Updated: 2019/11/26 18:46:22 by hulamy ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */ /* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:00:13 by hulamy #+# #+# */ /* Created: 2019/11/25 14:00:13 by hulamy #+# #+# */
/* Updated: 2019/11/25 15:54:07 by hulamy ### ########.fr */ /* Updated: 2019/11/26 16:18:35 by hulamy ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */ /* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:01:58 by hulamy #+# #+# */ /* Created: 2019/11/25 14:01:58 by hulamy #+# #+# */
/* Updated: 2019/11/25 14:19:11 by hulamy ### ########.fr */ /* Updated: 2019/11/26 16:18:25 by hulamy ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

15
testresults Normal file
View File

@@ -0,0 +1,15 @@
memcpy:
does not behave well with null as both params with size
memmove:
does not work well with null as both parameters and size
calloc:
does not work with 0 size
lstlast:
does not work with basic input
lstclear:
does not free the list
does not work with basic input
lstiter:
does not work with basic input
lstmap:
does not work with basic input