-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (50 loc) · 1.87 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: emende <[email protected]> +#+ +:+ +#+ #
:# +#+#+#+#+#+ +#+ #
# Created: 2022/03/22 12:46:17 by emende #+# #+# #
# Updated: 2022/04/07 12:46:12 by emende ### ########.fr #
# #
# **************************************************************************** #
NAME = fdf
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LIBFT = -I libft/includes -L libft -lft
ifneq (,$(wildcard /usr/local/include/mlx.h))
MLX = -I /usr/local/include
else
MLX = -I /usr/X11/include
endif
ifneq (,$(wildcard /usr/local/lib/libmlx.a))
MLX += -L /usr/local/lib -lmlx
else ifneq (,$(wildcard /usr/local/lib/libmlx.dylib))
MLX += -L /usr/local/lib -lmlx
else
MLX += -L /usr/X11/lib -lmlx
endif
UNAME := $(shell uname -s)
ifeq ($(UNAME), Darwin)
FRAMEWORKS = -framework OpenGL -framework AppKit
endif
ifeq ($(UNAME), Linux)
MLX += -lX11 -lXext
endif
OBJS = main.o ft_mlx_pixel_put.o draw_line.o hook_key.o free_arrays.o \
read_values.o draw_projection.o images.o color.o
all: $(NAME)
%.o: %.c Makefile fdf.h
$(CC) $(CFLAGS) -I libft/includes -c $< -o $@
$(NAME): $(OBJS)
make -C libft/
$(CC) -o $(NAME) $(OBJS) $(MLX) $(LIBFT) $(CFLAGS) $(FRAMEWORKS)
clean:
make clean -C libft/
rm -f $(OBJS)
fclean: clean
make fclean -C libft/
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re