-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.67 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jbadia <jbadia@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/29 14:55:10 by jbadia #+# #+# #
# Updated: 2021/08/30 12:00:16 by jbadia ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
LIBFT = libft
MAKELIBFT = $(MAKE) -C $(LIBFT)
SRCS_DIR = srcs
OBJ_DIR = obj
HDRS = include
CFILES = push_swap.c check_error.c func_free.c swap_op.c push_op.c \
rotate_op.c reverse_rotate_op.c resolve.c sort_small.c sort_big.c\
quicksort.c utils_sort.c utils.c \
OFILES = $(CFILES:.c=.o)
SRCS = $(addprefix $(SRCS_DIR)/, $(CFILES))
OBJS = $(addprefix $(OBJ_DIR)/, $(OFILES))
CC = gcc
CFLAGS = -Wall -Wextra -Werror
RM = rm -rf
$(OBJ_DIR)/%.o : $(SRCS_DIR)/%.c
${CC} ${CFLAGS} -I ${HDRS} -I $(LIBFT) -c $< -o $@
$(NAME): $(OBJ_DIR) $(OBJS)
$(MAKELIBFT)
$(CC) $(OBJS) -L $(LIBFT) -lft -o $@
$(OBJ_DIR) :
mkdir -p $(OBJ_DIR)
all : $(NAME)
clean :
$(MAKELIBFT) clean
$(RM) $(OBJS)
fclean : clean
$(MAKELIBFT) fclean
$(RM) $(NAME)
re : fclean all
.PHONY: all clean fclean re