-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (53 loc) · 2.01 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: eel-abed <eel-abed@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/08/12 12:22:21 by eel-abed #+# #+# #
# Updated: 2024/09/08 15:30:56 by eel-abed ### ########.fr #
# #
# **************************************************************************** #
# Makefile for 42 project respecting 42 school rules
# Compiler
CC = gcc
# Flags
CFLAGS = -Wall -Wextra -Werror -Iinclude -I/Users/eel-abed/Documents/Ecole42/Push_swap-42/libft -g
# Program name
NAME = push_swap
# Source and include directories
SRC_DIR = srcs/
INCLUDE_DIR = include/
LIBFT_DIR = /Users/eel-abed/Documents/Ecole42/Push_swap-42/libft
# Source files
SRCS = $(SRC_DIR)operations_rotate.c \
$(SRC_DIR)operations.c \
$(SRC_DIR)push_swap.c \
$(SRC_DIR)sort.c \
$(SRC_DIR)stack.c \
$(SRC_DIR)utils.c \
$(SRC_DIR)sort2-3-5.c \
$(SRC_DIR)parsing.c
# Object files
OBJS = $(SRCS:.c=.o)
# Rule to compile the program
all: $(NAME)
$(NAME): $(OBJS) | libft
$(CC) $(CFLAGS) -o $@ $^ -L$(LIBFT_DIR) -lft
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
libft:
@make -C $(LIBFT_DIR)
# Rule to clean object files
clean:
rm -f $(OBJS)
make -C $(LIBFT_DIR) clean
# Rule to clean everything including the program
fclean: clean
rm -f $(NAME)
make -C $(LIBFT_DIR) fclean
# Rule to recompile everything
re: fclean all
# .PHONY to avoid conflicts with files named clean, fclean, re, all
.PHONY: all clean fclean re libft