-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (44 loc) · 1.02 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
NAME = push_swap
NAME_B = checker
CC = gcc
CFLAGS = -Wall -Wextra -Werror
SRCS_DIR = ./srcs/
OBJ_DIR = ./objs/
SRCS = push_swap.c
SRCS += stack_tools.c
SRCS += instruction.c
SRCS += parse.c
SRCS += sort.c
SRCS += sort_a.c
SRCS += utils.c
SRCS_B = checker.c
SRCS_B += stack_tools.c
SRCS_B += instruction.c
SRCS_B += parse.c
SRCS_B += utils.c
SRCS_B += get_next_line.c
OBJ = $(addprefix $(OBJ_DIR),$(SRCS:.c=.o))
OBJ_B = $(addprefix $(OBJ_DIR),$(SRCS_B:.c=.o))
RM = /bin/rm -f
RM_DIR = /bin/rm -rf
$(OBJ_DIR)%.o:$(SRCS_DIR)%.c
$(CC) $(CFLAGS) $(INC) -c $< -o $@
all:
@mkdir -p $(OBJ_DIR)
@make $(NAME)
make_libft:
@make -C libft/
$(NAME): $(OBJ) make_libft
@$(CC) $(CFLAGS) $(OBJ) ./libft/libft.a -o $(NAME)
bonus:
@mkdir -p $(OBJ_DIR)
@make $(NAME_B)
$(NAME_B): $(OBJ_B) make_libft
@$(CC) $(CFLAGS) $(OBJ_B) ./libft/libft.a -o $(NAME_B)
clean:
@make clean -C libft/
$(RM_DIR) $(OBJ_DIR)
fclean: clean
rm -rf ${NAME_B} ${NAME}
@make fclean -C libft/
re: clean all