-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (34 loc) · 856 Bytes
/
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
NAME = push_swap
SRCS = functions/parse/init.c \
functions/helper/tools.c \
functions/helper/parse_checks.c \
functions/helper/fivesort_checks.c \
functions/sorting/operations.c \
functions/sorting/order.c \
push_swap.c
INCLUDES = headers/pushswp.h
FLAGS = -Wall -Wextra -Werror
DEBUG_FLAGS = -Wall -Wextra -Werror -g3 -fsanitize=address
OBJS = $(SRCS:.c=.o)
LIBFT= ./libft/libft.a
CC = gcc
.PHONY: all clean fclean re
all: $(NAME)
%.o: %.c
$(CC) $(FLAGS) -c $< -o $@
$(NAME): $(LIBFT) $(OBJS)
$(CC) $(FLAGS) $(SRCS) -o $(NAME) $(LIBFT)
$(LIBFT):
@make bonus -C ./libft/
norme:
@norminette $(SRCS) $(INCLUDES)
debug: $(NAME)
$(CC) $(DEBUG_FLAGS) $(SRCS) -o $(NAME) $(LIBFT)
clean:
@make clean -C ./libft/
@rm -rf $(OBJS)
@echo "cleaning .o files"
fclean: clean
@make fclean -C ./libft/
@rm -rf $(NAME)
re: fclean all