-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 813 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 813 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
NAME = fdf
SRC_DIR = ./src
SRC = $(wildcard $(SRC_DIR)/*.c)
OBJ_DIR = ./objs
OBJ = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SRC))
INC_DIR := include
LIBFT_DIR = libft
LIBFT_INC_DIR = $(LIBFT_DIR)/include
MLX_LIB = -L /usr/local/lib/ -lmlx
MLX_HEAD = -I /usr/local/include
FRAMEWORK = -framework OpenGL -framework AppKit
all: $(NAME)
$(OBJ_DIR)/%.o:$(SRC_DIR)/%.c
gcc -Wall -Werror -Wextra -I$(LIBFT_INC_DIR) -I$(INC_DIR) -o $@ -c $<
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
$(NAME): $(OBJ_DIR) $(OBJ)
@make -C $(LIBFT_DIR)
@gcc -Wall -Werror -Wextra $(MLX_HEAD) -L $(LIBFT_DIR) -l ft -o $(NAME) $(OBJ) -I$(LIBFT_INC_DIR) -I$(INC_DIR) $(MLX_LIB) $(FRAMEWORK)
clean:
@rm -rf $(OBJ_DIR)
@make -C $(LIBFT_DIR) clean
fclean: clean
@rm -f $(NAME)
@rm -f checker
@make -C $(LIBFT_DIR) fclean
re: fclean all