-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 1.56 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ygolshan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/04/24 11:48:42 by ygolshan #+# #+# #
# Updated: 2023/04/28 20:44:48 by ygolshan ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Werror -Wextra -g
NAME = push_swap
SRC_PATH = src/
OBJ_PATH = obj/
SRC = push_swap.c utils.c radix.c accredit.c \
goal.c sort_three.c midpoint.c value.c ruls.c \
reset.c status.c regulate.c stack.c pair_rules.c main.c
SRCS = $(addprefix $(SRC_PATH), $(SRC))
OBJ = $(SRC:.c=.o)
OBJS = $(addprefix $(OBJ_PATH), $(OBJ))
INCS = -I ./includes/
all: $(OBJ_PATH) $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
$(CC) $(CFLAGS) -c $< -o $@ $(INCS)
$(OBJ_PATH):
mkdir $(OBJ_PATH)
$(NAME): $(OBJS)
cd ./libft && make
$(CC) $(CFLAGS) $(OBJS) ./libft/libft.a -o $(NAME)
clean:
cd ./libft && make fclean
rm -rf $(OBJ_PATH)
fclean: clean
rm -f $(NAME)
re: fclean all