-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (62 loc) · 1.92 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
75
76
77
78
79
80
81
82
83
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ale-baux <ale-baux@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/01/30 11:56:06 by ale-baux #+# #+# #
# Updated: 2020/02/04 13:44:05 by ale-baux ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
NAME = cub3D
# FLAGS = -Wall -Wextra -Werror
LIBFT = libft
DIR_S = sources
DIR_O = temporary
HEADER = includes
SOURCES = main.c\
terminal_output.c\
get_next_line.c\
initialize_global_struct.c\
get_screenshot.c\
parsing.c\
is_line_valid.c\
remove_spaces.c\
parse_line_resolution.c\
allocate_map.c\
parse_line.c\
parse_line_map.c\
put_map_line_in_struct.c\
parse_line_texture.c\
get_path.c\
parse_line_floor_and_ceiling.c\
SRCS = $(addprefix $(DIR_S)/,$(SOURCES))
OBJS = $(addprefix $(DIR_O)/,$(SOURCES:.c=.o))
all: temporary $(NAME)
$(NAME): $(OBJS)
@make -C $(LIBFT)
@$(CC) $(FLAGS) -L $(LIBFT) -lft -o $@ $^
temporary:
@mkdir -p temporary
$(DIR_O)/%.o: $(DIR_S)/%.c $(HEADER)/cub3d.h
@$(CC) $(FLAGS) -I $(HEADER) -c -o $@ $<
bonus: all
norme:
@echo
norminette ./$(LIBFT)
@echo
norminette ./$(HEADER)
@echo
norminette ./$(DIR_S)
clean:
@rm -f $(OBJS)
@make clean -C $(LIBFT)
@rm -rf $(DIR_O)
fclean: clean
@rm -f $(NAME)
@make fclean -C $(LIBFT)
re: fclean
@$(MAKE) all
.PHONY: temporary, norme, clean