-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (61 loc) · 2.08 KB
/
Makefile
File metadata and controls
72 lines (61 loc) · 2.08 KB
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
72
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: manufern <manufern@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/16 18:07:32 by manufern #+# #+# #
# Updated: 2024/01/24 16:19:50 by manufern ### ########.fr #
# #
# **************************************************************************** #
# Compiler and flags
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LFLAGS = -lmlx -framework OpenGL -framework AppKit
# Target and sources
NAME = fdf
SRCS = src/1_main.c \
src/2_get_line_map.c \
src/3_list.c \
src/4_drow_map.c \
src/ft_atoy_hexa.c \
src/free.c \
src/ft_atoi.c \
src/ft_dda.c \
src/ft_isalpha.c \
src/ft_isdigit.c \
src/ft_split.c \
src/ft_strcpy_to_char.c \
src/ft_strlen.c \
src/ft_toupper.c \
src/get_next_line.c \
src/get_next_line_utils.c
# Libraries and objects
LIB = ar rcs
OBJS = $(SRCS:.c=.o)
# Colors
RESET = \033[0m
GREEN = \033[32m
RED = \033[31m
# Rules
all: $(NAME)
$(NAME): $(OBJS)
@echo "$(GREEN)Compiling $(NAME)$(RESET)"
@$(CC) $(LFLAGS) -o $(NAME) $(OBJS)
@echo "$(GREEN)Compilation complete$(RESET)"
@echo "$(GREEN)Displaying image$(RESET)"
%.o: %.c
@echo "$(GREEN)Compiling $<$(RESET)"
@$(CC) $(CFLAGS) -c $< -o $@
@echo "$(GREEN)[$(RESET)$(RED)$@$(RESET)$(GREEN)] $(NAME)$(RESET)"
# Clean
clean:
@echo "$(RED)Removing object files$(RESET)"
@$(RM) $(OBJS)
fclean: clean
@echo "$(RED)Removing $(NAME)$(RESET)"
@$(RM) $(NAME)
re: fclean all
# Phony targets
.PHONY: all clean fclean re