-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (45 loc) · 1.22 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
SRCS = push_swap.c\
error/error.c \
check/check_arg.c \
moves/moves.c \
moves/moves1.c \
sort/sort.c \
sort/sort_aux.c \
sort/sort_aux2.c \
sort/sort_aux3.c \
list/list.c \
BONUS = checker.c \
get_next_line/get_next_line.c \
get_next_line/get_next_line_utils.c \
BONUS_OBJS = $(BONUS:.c=.o)
EXCLUDED_OBJ := push_swap.o
OBJS = $(SRCS:.c=.o)
NAME = push_swap
CHECKER = checker
LIBFT = libft.a
LIBFT_DIR := ./libft
LIBFT_LIB := $(LIBFT_DIR)/libft.a
CC = cc
FLAGS = -Wall -Wextra -Werror
RM = rm -f
all: $(NAME)
bonus: $(CHECKER)
$(NAME): $(OBJS) $(LIBFT_LIB)
$(CC) $(FLAGS) $(OBJS) $(LIBFT_LIB) -o $(NAME)
$(CHECKER): $(OBJS) $(BONUS_OBJS) $(LIBFT_LIB)
$(CC) $(FLAGS) $(filter-out $(EXCLUDED_OBJ), $(OBJS)) $(BONUS_OBJS) $(LIBFT_LIB) -o $(CHECKER)
debugbonus: $(OBJS) $(BONUS_OBJS) $(LIBFT_LIB)
$(CC) $(FLAGS) -g $(filter-out push_swap.c, $(SRCS)) $(BONUS) $(LIBFT_LIB) -o $(CHECKER)
%.o: %.c
$(CC) $(FLAGS) -c $< -o $@
debug: $(OBJS) $(LIBFT_LIB)
$(CC) $(FLAGS) -g $(SRCS) $(LIBFT_LIB) -o $(NAME)
$(LIBFT_LIB):
cd $(LIBFT_DIR) && $(MAKE)
clean:
cd $(LIBFT_DIR) && $(MAKE) clean
$(RM) $(OBJS) $(BNS_OBJS) $(BONUS_OBJS)
fclean: clean
cd $(LIBFT_DIR) && $(MAKE) fclean
$(RM) $(NAME) $(CHECKER)
re: fclean all