aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCabergs Charles <cacharle@w-r5-p6.s19.be>2019-10-09 09:12:43 +0200
committerCabergs Charles <cacharle@w-r5-p6.s19.be>2019-10-09 09:12:43 +0200
commit840957aee277e7c426647cc133b2a41e7cecd9a9 (patch)
tree96eaae76f3586e9fa141cd94b95e92b7a6db3d09 /Makefile
parentf723389e5143c9ee0bc3d9774bb523b1c752b74c (diff)
downloadlibft-840957aee277e7c426647cc133b2a41e7cecd9a9.tar.gz
libft-840957aee277e7c426647cc133b2a41e7cecd9a9.tar.bz2
libft-840957aee277e7c426647cc133b2a41e7cecd9a9.zip
Normed, Makefile bonus rule
- bonus rule to add the *_bonus files to libft.a - normed memmove, calloc and bonus
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 29 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 7051af4..3689094 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,20 @@
+# **************************************************************************** #
+# #
+# ::: :::::::: #
+# Makefile :+: :+: :+: #
+# +:+ +:+ +:+ #
+# By: cacharle <marvin@42.fr> +#+ +:+ +#+ #
+# +#+#+#+#+#+ +#+ #
+# Created: 2019/10/08 15:45:53 by cacharle #+# #+# #
+# Updated: 2019/10/09 08:56:04 by cacharle ### ########.fr #
+# #
+# **************************************************************************** #
+
+LIB = ar rc
+RM = rm -f
+
CC = gcc
-CCFLAGS = -Wall -Wextra -Werror -fPIC
+CCFLAGS = -Wall -Wextra -Werror
NAME = libft.a
SRC = ft_atoi.c ft_bzero.c ft_isalnum.c ft_isalpha.c ft_isascii.c ft_isdigit.c ft_isprint.c \
@@ -12,17 +27,27 @@ SRC = ft_atoi.c ft_bzero.c ft_isalnum.c ft_isalpha.c ft_isascii.c ft_isdigit.c f
ft_strrchr.c ft_split.c ft_strstr.c ft_substr.c ft_strtrim.c ft_tolower.c \
ft_toupper.c ft_strlcpy.c ft_calloc.c
OBJ = $(SRC:.c=.o)
+INCLUDE = libft.h
+
+BONUSSRC = ft_lstadd_back_bonus.c ft_lstadd_front_bonus.c ft_lstclear_bonus.c \
+ ft_lstdelone_bonus.c ft_lstiter_bonus.c ft_lstlast_bonus.c \
+ ft_lstmap_bonus.c ft_lstnew_bonus.c ft_lstsize_bonus.c
+BONUSOBJ = $(BONUSSRC:.c=.o)
+BONUSINCLUDE = libft_bonus.h
all: $(NAME)
-$(NAME): $(OBJ) libft.h
- ar rc $(NAME) $(OBJ)
+$(NAME): $(OBJ) $(INCLUDE)
+ $(LIB) $(NAME) $(OBJ)
+
+bonus: $(OBJ) $(BONUSOBJ) $(INCLUDE) $(BONUSINCLUDE)
+ $(LIB) $(NAME) $(OBJ) $(BONUSOBJ)
%.o: %.c
$(CC) $(CCFLAGS) -c -o $@ $<
clean:
- rm -f $(OBJ)
+ rm -f $(OBJ) $(BONUSOBJ)
fclean: clean
rm -f $(NAME)