-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 869 Bytes
/
Makefile
File metadata and controls
48 lines (37 loc) · 869 Bytes
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
NAME = solong
LIBFTNAME = libft.a
CC = cc
CFLAGS = -Wall -Wextra -Werror
LIBFTPATH = ./libft
SRCS = main.c \
read_map.c \
valid_map.c \
valid_map2.c \
free_memory.c \
flood_fill.c \
render_game.c \
OBJS = $(SRCS:.c=.o)
MLX_LIB = mlx/
MLX_FLAGS = -Lmlx -lmlx -L/usr/lib/X11 -lXext -lX11
all: $(NAME)
makelibft:
@make -C $(LIBFTPATH)
@cp $(LIBFTPATH)/$(LIBFTNAME) .
@mv $(LIBFTNAME) $(NAME)
$(NAME): makelibft $(OBJS)
@if [ ! -d "mlx" ]; then \
git clone https://github.com/42Paris/minilibx-linux.git mlx; \
fi
@make -C $(MLX_LIB)
$(CC) $(OBJS) -L./libft -lft $(MLX_FLAGS) -o $(NAME)
%.o: %.c
$(CC) $(CFLAGS) -I/usr/include -Imlx_linux -c $^ -o $@
clean:
@rm -f $(OBJS)
@cd $(LIBFTPATH) && make clean
fclean: clean
@rm -f $(NAME)
@rm -rf $(MLX_LIB)
@cd $(LIBFTPATH) && make fclean
re: fclean all
.PHONY: all clean fclean re libft