-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·80 lines (59 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bsouchet <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/02/04 18:49:05 by bsouchet #+# #+# #
# Updated: 2016/10/25 15:43:23 by bsouchet ### ########.fr #
# #
# **************************************************************************** #
C = clang
NAME = wolf3d
FLAGS = -Wall -Wextra -Werror -O2
LIBFT = libft
DIR_S = sources
DIR_O = temporary
DIR_MLX = libmlx
HEADER = include
SOURCES = main.c \
hook.c \
keys.c \
draw.c \
check.c \
minimap.c \
textures.c \
raycasting.c \
misc.c
SRCS = $(addprefix $(DIR_S)/,$(SOURCES))
OBJS = $(addprefix $(DIR_O)/,$(SOURCES:.c=.o))
opti:
@$(MAKE) all -j
all: temporary $(NAME)
$(NAME): $(OBJS)
@make -C $(LIBFT)
@make -C $(DIR_MLX)
@$(CC) $(FLAGS) -L $(LIBFT) -lft -o $@ $^ -framework OpenGL -framework AppKit -L $(DIR_MLX) -lmlx
temporary:
@mkdir -p temporary
$(DIR_O)/%.o: $(DIR_S)/%.c $(HEADER)/$(NAME).h
@$(CC) $(FLAGS) -I $(HEADER) -c -o $@ $<
norme:
@make norme -C $(LIBFT)
@echo
norminette ./$(HEADER)
@echo
norminette ./$(DIR_S)
clean:
@rm -f $(OBJS)
@make clean -C $(LIBFT)
@make clean -C $(DIR_MLX)
@rm -rf $(DIR_O)
fclean: clean
@rm -f $(NAME)
@make fclean -C $(LIBFT)
@make fclean -C $(DIR_MLX)
re: fclean
@$(MAKE) all -j
.PHONY: temporary, norme, clean