-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
72 lines (48 loc) · 2.06 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
67
68
69
70
71
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: doberyn <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/12/18 23:40:57 by doberyn #+# #+# #
# Updated: 2020/01/23 10:43:04 by doberyn ### ########.fr #
# #
# **************************************************************************** #
NAME1 = push_swap
NAME2 = checker
CFLAGS = -Wall -Wextra -Werror
SRC1 = push_swap.c validation.c actions.c actions_2.c actions_3.c \
quick_sort.c separation.c initialization.c sort_3_and_5_element.c \
global_sort.c finding_place.c
SRC2 = checker.c validation.c actions.c actions_2.c actions_3.c \
quick_sort.c separation.c initialization.c
OBJSFD = temporary
OBJS1 = $(addprefix $(OBJSFD)/,$(SRC1:.c=.o))
OBJS2 = $(addprefix $(OBJSFD)/,$(SRC2:.c=.o))
HDR = -I./includes
LIBFT_HDR = -I./includes/libft
LIB_BINARY = -L./includes/libft -lft
LIBFT = ./includes/libft/libft.a
all: $(LIBFT) ./includes/libft/libft.a $(NAME1) $(NAME2)
FORCE: ;
LIBFT = ./includes/libft/libft.a
$(LIBFT): FORCE
make -C ./includes/libft
$(OBJSFD):
mkdir $@
$(OBJSFD)/%.o: %.c | $(OBJSFD)
gcc -g $(CFLAGS) $(HDR) $(LIBFT_HDR) -c $< -o $@
$(NAME1): $(OBJS1) $(LIBFT) ./includes/push_swap.h
gcc -g $(OBJS1) $(LIB_BINARY) -o $@
$(NAME2): $(OBJS2) $(LIBFT) ./includes/push_swap.h
gcc -g $(OBJS2) $(LIB_BINARY) -o $@
clean:
/bin/rm -f $(OBJS)
rm -rf $(OBJSFD)
make -C ./includes/libft clean
fclean: clean
/bin/rm -f $(NAME1)
/bin/rm -f $(NAME2)
make -C ./includes/libft fclean
re: fclean all