-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (48 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
65 lines (48 loc) · 2.08 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ttridon <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/11/24 09:52:44 by ttridon #+# #+# #
# Updated: 2016/05/25 18:45:28 by ttridon ### ########.fr #
# #
# **************************************************************************** #
NAME = libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
CPPFLAGS = -I includes
SRC_NAME = ft_strlen.c ft_bzero.c ft_itoa_base.c \
ft_itoa.c ft_putchar.c ft_putstr.c \
ft_putnbr.c ft_puissance.c ft_toupper.c \
ft_tolower.c ft_atoi.c ft_strcpy.c \
ft_strncpy.c ft_putendl.c ft_strchr.c \
ft_strjoin.c ft_isspace.c ft_strcmp.c \
ft_strncmp.c ft_strdup.c ft_strcat.c \
ft_strncat.c ft_putwchar.c ft_strtrim.c \
ft_strstr.c ft_strnstr.c ft_strrchr.c \
ft_isdigit.c ft_isascii.c ft_isalpha.c \
ft_isprint.c ft_isalnum.c ft_putchar_fd.c \
ft_putstr_fd.c ft_putendl_fd.c ft_putnbr_fd.c \
ft_strnew.c ft_strdel.c ft_strequ.c \
ft_strnequ.c
SRC_PATH = src/
SRC = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJ_NAME = $(SRC_NAME:.c=.o)
OBJ_PATH = obj/
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
.PHONY: all, clean, fclean, re
all: $(NAME)
$(NAME): $(OBJ)
@ar rc $(NAME) $(OBJ)
ranlib $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
@mkdir $(OBJ_PATH) 2> /dev/null || true
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
clean:
rm -f $(SRC:.c=.o)
rm -rf $(OBJ_PATH)
fclean: clean
rm -f $(NAME)
re: fclean all