-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (40 loc) · 1.67 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hyap <hyap@student.42kl.edu.my> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/10/19 15:59:25 by hyap #+# #+# #
# Updated: 2022/11/14 14:10:01 by hyap ### ########.fr #
# #
# **************************************************************************** #
SRCSDIR = srcs
SRCS = ${wildcard $(SRCSDIR)/*.c} \
${wildcard $(SRCSDIR)/gnl/*.c} \
${wildcard $(SRCSDIR)/utils/*.c} \
${wildcard $(SRCSDIR)/parsing/*.c} \
${wildcard $(SRCSDIR)/render/*.c}
OBJSDIR = objs
OBJS = $(SRCS:%.c=$(OBJSDIR)/%.o)
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LIBMLX = libmlx.dylib
FSANITIZE = -fsanitize=address -g
NAME = cub3D
RM = rm -f
MINIMAP = srcs/minimap/minimaptmp.c ${wildcard $(SRCSDIR)/utils/*.c} ${wildcard $(SRCSDIR)/gnl/*.c}
all: ${NAME}
$(OBJSDIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -I includes -c $< -o $@
${NAME}: $(OBJS)
${CC} ${LIBMLX} $(OBJS) -o ${NAME}
minimap:
$(CC) ${FSANITIZE} $(CFLAGS) -I includes $(LIBMLX) $(MINIMAP) -o minimap
clean:
${RM} -rv $(OBJSDIR)
fclean: clean
${RM} ${NAME}
re: clean all
.PHONY: all clean fclean re minimap