-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·90 lines (60 loc) · 2.06 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
84
85
86
87
88
89
90
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kperreau <kperreau@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2014/12/05 14:10:51 by kperreau #+# #+# #
# Updated: 2016/10/21 15:24:56 by kperreau ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
# Dir vars
SRCDIR = src
INCLUDESDIR = includes
LIBDIR = libft
# Files vars
MAIN = main.c
CFILES = ft_event.c ft_init_mlx.c ft_run.c \
ft_bmp.c ft_fractals.c ft_sub_event.c \
SRC = $(patsubst %, $(SRCDIR)/%, $(CFILES))
OBJ = $(SRC:.c=.o) $(MAIN:.c=.o)
HFILES = fractol.h
HEADERS = $(patsubst %, $(INCLUDESDIR)/%, $(HFILES))
# COMPILATION
ERRORFLAGS = -Wall -Werror -Wextra -W -march=native -Ofast
INCLUDEFLAGS = -I $(INCLUDESDIR)/ -I $(LIBDIR)/includes/ -I./minilibx #-lpthread -D_REENTRANT
# MLX = -L./minilibx -lmlx -L/lib -lXext -lx11
MLX = -L./minilibx -lmlx -framework OpenGL -framework AppKit
LIBFLAGS = -L $(LIBDIR)/ -lft
FLAGS = $(ERRORFLAGS) $(INCLUDEFLAGS)
CC = gcc
# Git vars
TOGIT = $(SRC) \
$(HEADERS) \
$(MAIN) \
Makefile \
auteur \
$(LIBDIR) \
minilibx
# Rules
all: $(NAME)
$(NAME): $(OBJ)
@make -j -C $(LIBDIR)/
@$(CC) $(FLAGS) $(OBJ) $(LIBFLAGS) $(MLX) -o $(NAME)
re: fclean all
clean:
@rm -f $(OBJ)
@make -C $(LIBDIR)/ clean
fclean: clean
@rm -f $(NAME)
@make -j -C $(LIBDIR)/ fclean
relib:
@make -j -C $(LIBDIR)/ re
%.o: %.c
@$(CC) -o $@ -c $< $(FLAGS)
git:
git add $(TOGIT)
git commit -m 'auto update'
git push