-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
74 lines (55 loc) · 2.38 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
69
70
71
72
73
74
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ratavare <ratavare@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/10 15:49:55 by apereira #+# #+# #
# Updated: 2024/02/14 16:26:24 by ratavare ### ########.fr #
# #
# **************************************************************************** #
########## NAMES ##########
NAME = cub3D
CC = cc
CFLAGS = -Wall -Wextra -Werror -g
INCLUDES = -Lmlx_linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm
RM = rm -rf
PRINTF = libft/ft_printf/libftprintf.a
MLX_PATH = ./includes/mlx_linux/libmlx_Linux.a
SRC = main.c parser/parser.c parser/map.c parser/parser_utils.c parser/parser_utils2.c parser/extract.c free.c error.c utils.c events.c math.c distance.c drawing.c drawing_aux.c moves.c minimap.c
SRC_GNL = libft/GNL/get_next_line.c libft/GNL/get_next_line_utils.c
OBJ = $(SRC:.c=.o)
OBJ_GNL = $(SRC_GNL:.c=.o)
########## TARGETS ##########
all: $(NAME)
%.o: %.c
@$(CC) $(CFLAGS) -c $< -o $@
$(NAME): $(addprefix src/,$(OBJ)) $(OBJ_GNL)
@make -s -C libft/ft_printf
@make -s -C libft
@$(CC) $(addprefix src/,$(OBJ)) $(OBJ_GNL) $(MLX_PATH) -o $(NAME) $(PRINTF) libft/libft.a $(INCLUDES)
test:
./cub3D includes/maps/valid/normal.cub
git: fclean
@git add .
@git commit
@git push
@clear
@echo "| |"
@echo "| |"
@echo "| -------{ Commited and Pushed }------- |"
@echo "| |"
@echo "| |"
commit: fclean
clean:
@make clean -s -C libft/ft_printf
@make clean -s -C libft
@$(RM) $(addprefix src/,$(OBJ))
@$(RM) $(OBJ_GNL)
fclean: clean
@make fclean -s -C libft/ft_printf
@make fclean -s -C libft
@$(RM) $(NAME) $(LIB)
re: fclean all
.PHONY: all clean fclean re