-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·100 lines (82 loc) · 3.22 KB
/
Makefile
File metadata and controls
executable file
·100 lines (82 loc) · 3.22 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
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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: swofferh <swofferh@student.codam.nl> +#+ #
# +#+ #
# Created: 2020/06/19 21:39:04 by swofferh #+# #+# #
# Updated: 2022/07/06 18:57:27 by swofferh ######## odam.nl #
# #
# **************************************************************************** #
include inc/Makepretty.mk
PROJECT = libft
NAME = $(PROJECT).a
CFLAGS = -Wall -Wextra -Werror
LIB = ft_atoi.c ft_itoa.c ft_putendl_fd.c ft_strjoin.c ft_strrchr.c\
ft_calloc.c ft_memchr.c ft_putstr_fd.c ft_strlcpy.c ft_substr.c\
ft_bzero.c ft_memccpy.c ft_putnbr_fd.c ft_strlcat.c ft_strtrim.c\
ft_isalnum.c ft_memcmp.c ft_split.c ft_strlen.c ft_tolower.c\
ft_isalpha.c ft_memcpy.c ft_strchr.c ft_strmapi.c ft_toupper.c\
ft_isprint.c ft_putchar_fd.c ft_strdup.c ft_strnstr.c\
ft_isascii.c ft_memmove.c ft_strclen.c ft_strncmp.c\
ft_isdigit.c ft_memset.c ft_strcmp.c ft_strncpy.c
LSU = ft_atol.c ft_islower.c ft_nospace.c ft_puthexa.c ft_maxof.c \
ft_isspace.c ft_numlen.c ft_putlen.c ft_strndup.c \
ft_isupper.c ft_putnbr.c ft_wordlen.c ft_putstr.c\
ft_lenbase.c ft_putchar.c ft_putocta.c ft_words.c\
ft_strjoin_free.c ft_free_array.c ft_print_array.c\
ft_putendl.c get_next_line.c
PFT = type_c.c type_s.c type_d.c type_u.c type_p.c type_x.c\
percentage.c pfunctions.c preci_width.c ft_printf.c
LST = lst_reverse.c lst_move_front.c lst_move_back.c\
lst_last.c lst_add_back.c lst_del_one.c\
lst_new.c lst_add_front.c lst_size.c\
lst_clear.c lst_map.c lst_itter.c
INC = inc
DIR_OBJ = obj
DIR_LIB = all
DIR_LSU = extra
DIR_LST = lists
DIR_PFT = printf
O_LIB = $(LIB:%.c=$(DIR_OBJ)/$(DIR_LIB)/%.o)
O_PFT = $(PFT:%.c=$(DIR_OBJ)/$(DIR_PFT)/%.o)
O_LST = $(LST:%.c=$(DIR_OBJ)/$(DIR_LST)/%.o)
O_LSU = $(LSU:%.c=$(DIR_OBJ)/$(DIR_LSU)/%.o)
$(DIR_OBJ)/$(DIR_LIB)/%.o: $(DIR_LIB)/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -I $(INC) -c $< -o $@
$(COMPILE_MESSAGE)
$(DIR_OBJ)/$(DIR_LSU)/%.o: $(DIR_LSU)/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -I $(INC) -c $< -o $@
$(COMPILE_MESSAGE)
$(DIR_OBJ)/$(DIR_LST)/%.o: $(DIR_LST)/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -I $(INC) -c $< -o $@
$(MESSAGE_LINKED)
$(DIR_OBJ)/$(DIR_PFT)/%.o: $(DIR_PFT)/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -I $(INC) -c $< -o $@
$(MESSAGE_PRINTF)
all: $(NAME)
$(NAME): $(O_LIB) $(O_LST) $(O_PFT) $(O_LSU)
@$(AR) rcs $@ $^
@ranlib $@
$(ADD_GIT_IGNORE)
$(DONE_LIBFT)
clean:
@$(RM) -rf $(DIR_OBJ)
$(MESSY_MESSAGE)
$(DONE_MESSAGE)
fclean: clean
@$(RM) $(NAME)
$(BYE_GIT_IGNORE)
$(MESSY_MESSAGE)
$(DONE_MESSAGE)
re: fclean all
$(EMPTY_MESSAGE)
$(RESET_MESSAGE_3)
$(RESET_MESSAGE_2)
$(RESET_MESSAGE_1)
.PHONY: clean fclean re all