-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (53 loc) · 1.86 KB
/
Makefile
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kyung-ki <kyung-ki@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/13 21:13:41 by kyung-ki #+# #+# #
# Updated: 2023/11/25 17:05:44 by kyung-ki ### ########.fr #
# #
# **************************************************************************** #
#Standard
CC = cc
CFLAGS = -Wall -Werror -Wextra -g #-fsanitize=address
NAME = push_swap
#Colors
DEF_COLOR = \033[0;39m
GRAY = \033[0;90m
RED = \033[0;91m
GREEN = \033[0;92m
YELLOW = \033[0;93m
BLUE = \033[0;94m
MAGENTA = \033[0;95m
CYAN = \033[0;96m
WHITE = \033[0;97m
#Sources
SRCS = src/instruction.c src/list.c src/main.c src/utils.c src/quicksort.c src/mergesort.c src/quicksort2.c
OBJS = $(SRCS:.c=.o)
#Library
LIBFT = ./library/libft
LIBPF = ./library/ft_printf
LIBS = $(LIBFT)/libft.a $(LIBPF)/libftprintf.a
HEADERS = -I$(LIBFT)/include -I$(LIBPF) -Iinclude
###
all : libft libpf $(NAME)
libft :
$(MAKE) -C $(LIBFT)
libpf :
$(MAKE) -C $(LIBPF)
%.o: %.c
${CC} ${CFLAGS} -o $@ -c $< ${HEADERS}
$(NAME) : $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIBS) $(HEADERS) -o $(NAME)
clean :
rm -rf $(OBJS)
$(MAKE) -C $(LIBFT) clean
$(MAKE) -C $(LIBPF) clean
fclean : clean
rm -rf $(NAME)
$(MAKE) -C $(LIBFT) fclean
$(MAKE) -C $(LIBPF) fclean
re : fclean all
.PHONY : all libft libpf clean fclean re