-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 1.88 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yli <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/27 19:19:34 by yli #+# #+# #
# Updated: 2023/02/27 19:19:36 by yli ### ########.fr #
# #
# **************************************************************************** #
GREEN = \033[0;32m
BLUE = \033[0;34m
RESET = \033[0m
CC = cc
CFLAGS = -Wall -Werror -Wextra
NAME = push_swap
SRC_PATH = src/
OBJ_PATH = obj/
SRC = main.c\
0ft_utils.c 1check_argv.c 2init_stack.c 2init_stack_2.c 3sort_rules_swap.c \
4sort_rules_push.c 5sort_rules_rotate.c 6sort_rules_reverse_rotate.c\
7sort_size_small.c 7sort_size_small_2.c \
8sort_size_big.c 8sort_size_big_2.c 8sort_size_big_3.c 9sort_size_500.c
SRCS = $(addprefix $(SRC_PATH), $(SRC))
OBJ = $(SRC:.c=.o)
OBJS = $(addprefix $(OBJ_PATH), $(OBJ))
INCS = -I ./includes/
LIBGNL = LIBGNL/libgnl.a
all: $(OBJ_PATH) $(NAME) $(LIBGNL)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
$(CC) $(CFLAGS) -c $< -o $@ $(INCS)
$(OBJ_PATH):
mkdir $(OBJ_PATH)
$(NAME): $(OBJS)
@make -C LIBGNL
@cp $(LIBGNL) $(NAME)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
clean:
rm -rf $(OBJ_PATH)
fclean: clean
rm -f $(NAME)
re: fclean all
norm:
@echo "$(GREEN)\nmandatory norminette$(RESET)"
@norminette $(SRCS)
##run: $(NAME)
## $(VALGRIND) ./$(NAME)
.PHONY: all clean fclean re norm