-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (36 loc) · 1.27 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
PUSH_SW_NAME = push_swap
CHECKER_NAME = checker
CC := clang
SANIT := -g -fsanitize=address
CFLAGS := -Wall -Wextra -Werror
OFLAGS :=
LINK_LIB := -L libqueue -lqueue
SRCS = push_swap_rotate.c \
print_error.c check_args.c init_stack_a.c \
bubblesort.c issorted.c \
ctype_functions.c split.c string_utils.c string_len.c string_array.c \
SRCS_PUSH_SW = main.c pa_pb.c sa_sb_ss.c \
ra_rb_rr.c rra_rrb_rrr.c \
trinity.c infinity.c send_all_to_stack_b.c \
nearest_value.c insert_all_to_stack_a.c insert_all_to_stack_a_utils.c \
prepare_stacks.c
SRCS_CHECKER = main.c apply_instructions.c gnl.c \
PATH_SRCS = $(addprefix srcs/, $(SRCS))
PATH_PUSH_SW = $(addprefix push_swap_srcs/, $(SRCS_PUSH_SW))
PATH_CHECKER = $(addprefix checker_srcs/, $(SRCS_CHECKER))
SRCS_LIBS = libqueue/libqueue.a
INC = include
all: $(PUSH_SW_NAME) $(CHECKER_NAME)
$(PUSH_SW_NAME): $(PATH_PUSH_SW) $(SRCS_LIBS) $(PATH_SRCS)
$(CC) $(CFLAGS) $(SANIT) $(PATH_PUSH_SW) $(PATH_SRCS) $(LINK_LIB) -o $@ -I $(INC)
$(CHECKER_NAME): $(PATH_CHECKER) $(SRCS_LIBS)
$(CC) $(CFLAGS) $(SANIT) $(PATH_CHECKER) $(PATH_SRCS) $(LINK_LIB) -o $@ -I $(INC)
$(SRCS_LIBS):
make -C libqueue
clean:
@$(RM) $(PUSH_SW_NAME)
@$(RM) $(CHECKER_NAME)
fclean: clean
make fclean -C libqueue
re: fclean all
.PHONY: all clean fclean re