summaryrefslogtreecommitdiffstats
path: root/libft/Makefile
blob: fbe5c6e46e915a5e0575cc44f93d125c4e66a625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# **************************************************************************** #
#                                                           LE - /             #
#                                                               /              #
#    Makefile                                         .::    .:/ .      .::    #
#                                                  +:+:+   +:    +:  +:+:+     #
#    By: rbousset <marvin@le-101.fr>                +:+   +:    +:    +:+      #
#                                                  #+#   #+    #+    #+#       #
#    Created: 2019/10/08 15:04:55 by rbousset     #+#   ##    ##    #+#        #
#    Updated: 2019/10/13 14:01:21 by rbousset    ###    #+. /#+    ###.fr      #
#                                                          /                   #
#                                                         /                    #
# **************************************************************************** #

SRCS_DIR		= ./

SRCS			= \
			  ft_memset.c \
			  ft_bzero.c \
			  ft_memcpy.c \
			  ft_memccpy.c \
			  ft_memmove.c \
			  ft_memchr.c \
			  ft_memcmp.c \
			  ft_strlen.c \
			  ft_isalpha.c \
			  ft_isdigit.c \
			  ft_isalnum.c \
			  ft_isascii.c \
			  ft_isprint.c \
			  ft_tolower.c \
			  ft_toupper.c \
			  ft_strchr.c \
			  ft_strrchr.c \
			  ft_strncmp.c \
			  ft_strlcpy.c \
			  ft_strlcat.c \
			  ft_strnstr.c \
			  ft_atoi.c \
			  ft_calloc.c \
			  ft_strdup.c \
			  \
			  ft_substr.c \
			  ft_strjoin.c \
			  ft_strtrim.c \
			  ft_split.c \
			  ft_itoa.c \
			  ft_strmapi.c \
			  ft_putchar_fd.c \
			  ft_putstr_fd.c \
			  ft_putendl_fd.c \
			  ft_putnbr_fd.c

BONUS_SRCS_DIR	= ./

BONUS_SRCS		= \
			  ft_lstnew_bonus.c \
			  ft_lstadd_front_bonus.c \
			  ft_lstsize_bonus.c \
			  ft_lstlast_bonus.c \
			  ft_lstadd_back_bonus.c \
			  ft_lstdelone_bonus.c \
			  ft_lstclear_bonus.c \
			  ft_lstiter_bonus.c \
			  ft_lstmap_bonus.c \
			  ft_putchar_bonus.c \
			  ft_putstr_bonus.c \
			  ft_putendl_bonus.c \
			  ft_putnbr_bonus.c \
			  ft_strcat_bonus.c \
			  ft_strcmp_bonus.c \
			  ft_isspace_bonus.c \
			  ft_sqrt_bonus.c

OBJS_DIR		= ./

#OBJS			= $(patsubst ${SRCS_DIR}%.c,${OBJS_DIR}%.o,${SRCS})

OBJS			= ${SRCS:.c=.o}

BONUS_OBJS_DIR	= ./

B_OBJS			= ${BONUS_SRCS:.c=.o}

#B_OBJS	= \
 $(patsubst ${SRCS_DIR}bonus/%.c,${OBJS_DIR}bonus/%.o,${BONUS_SRCS})

INCS_DIR		= ./

CC				= gcc

CFLAGS			= -Wall -Wextra -Werror

NAME			= libft.a

RM				= rm -rf

AR				= ar rcs

%.o:		%.c
	${CC} ${CFLAGS} -I${INCS_DIR} -c $< -o $@

$(NAME):	${OBJS}
	${AR} ${NAME} ${OBJS}

all:		${NAME}

bonus: 		all ${B_OBJS} 
	${AR} ${NAME} ${B_OBJS}

clean: 
	${RM} ${OBJS} ${B_OBJS}

fclean:		clean
	${RM} ${NAME}

re:		fclean all

build:	${OBJS} ${B_OBJS}
	${CC} ${CFLAGS} -g3 -fsanitize=address -I./ -o a.out \
		${OBJS} ${B_OBJS} main.c

default: all

.PHONY:	all clean clean fclean re bonus run