2020-12-17 19:10:23 +00:00
|
|
|
# **************************************************************************** #
|
|
|
|
# #
|
|
|
|
# ::: :::::::: #
|
|
|
|
# Makefile :+: :+: :+: #
|
|
|
|
# +:+ +:+ +:+ #
|
|
|
|
# By: gbrochar <gbrochar@student.42.fr> +#+ +:+ +#+ #
|
|
|
|
# +#+#+#+#+#+ +#+ #
|
|
|
|
# Created: 2020/12/17 19:47:03 by gbrochar #+# #+# #
|
2020-12-26 08:48:19 +00:00
|
|
|
# Updated: 2020/12/26 09:13:13 by gbrochar ### ########.fr #
|
2020-12-17 19:10:23 +00:00
|
|
|
# #
|
|
|
|
# **************************************************************************** #
|
|
|
|
|
|
|
|
NAME = scop
|
|
|
|
|
|
|
|
SRC_FILE = main.c \
|
2020-12-22 18:15:25 +00:00
|
|
|
parse_file.c \
|
|
|
|
parse_line.c \
|
2020-12-23 16:58:47 +00:00
|
|
|
parse_token.c \
|
2020-12-26 05:41:27 +00:00
|
|
|
center_vertices.c \
|
2020-12-22 18:15:25 +00:00
|
|
|
env.c \
|
2020-12-23 19:38:33 +00:00
|
|
|
run.c \
|
2020-12-22 19:50:00 +00:00
|
|
|
mat4_transpose.c \
|
2020-12-23 09:51:35 +00:00
|
|
|
mat4_multiply.c \
|
2020-12-23 16:06:42 +00:00
|
|
|
mat4_perspective.c \
|
|
|
|
mat4_lookat.c \
|
2020-12-23 19:38:33 +00:00
|
|
|
mat4_identity.c \
|
|
|
|
mat4_inverse.c \
|
2020-12-24 12:17:43 +00:00
|
|
|
mat4_rotate.c \
|
2020-12-26 08:48:19 +00:00
|
|
|
mat4_translate.c \
|
|
|
|
mat4_scale.c \
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
OBJ_FILE = $(SRC_FILE:.c=.o)
|
|
|
|
|
2020-12-22 18:15:25 +00:00
|
|
|
INC_FILE = scop.h \
|
|
|
|
|
2020-12-17 19:10:23 +00:00
|
|
|
SRC_DIR = src/
|
|
|
|
OBJ_DIR = obj/
|
2020-12-22 18:15:25 +00:00
|
|
|
INC_DIR = inc/
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
SRC = $(addprefix $(SRC_DIR), $(SRC_FILE))
|
|
|
|
OBJ = $(addprefix $(OBJ_DIR), $(OBJ_FILE))
|
2020-12-22 18:15:25 +00:00
|
|
|
INC = $(addprefix $(INC_DIR), $(INC_FILE))
|
2020-12-17 19:10:23 +00:00
|
|
|
|
2020-12-25 13:58:25 +00:00
|
|
|
LIB = -lm -lGL -lglfw -lGLEW
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
|
|
|
|
CFLAGS = -Wall -Werror -Wextra
|
|
|
|
|
|
|
|
RED = \033[31m
|
|
|
|
GREEN = \033[32m
|
|
|
|
YELLOW = \033[33m
|
|
|
|
BLUE = \033[34m
|
|
|
|
CYAN = \033[36m
|
|
|
|
WHITE = \033[0m
|
|
|
|
|
|
|
|
all: $(NAME)
|
|
|
|
|
2020-12-22 19:16:36 +00:00
|
|
|
$(NAME): $(OBJ) $(INC)
|
2020-12-22 18:15:25 +00:00
|
|
|
@$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR)
|
2020-12-17 19:10:23 +00:00
|
|
|
@mv $(OBJ_FILE) $(OBJ_DIR)
|
|
|
|
@$(CC) $(CFLAGS) $(OBJ) -o $(NAME) $(LIB)
|
2020-12-22 18:15:25 +00:00
|
|
|
@echo -e "$(GREEN)[OK]$(WHITE) $(NAME)"
|
2020-12-17 19:10:23 +00:00
|
|
|
|
2020-12-22 18:15:25 +00:00
|
|
|
$(OBJ_DIR)%.o: $(SRC_DIR)%.c inc/
|
2020-12-17 19:10:23 +00:00
|
|
|
@if [ ! -d ./obj ]; then \
|
|
|
|
mkdir -p ./obj; \
|
|
|
|
fi;
|
2020-12-22 18:15:25 +00:00
|
|
|
@$(CC) $(CFLAGS) -I $(INC_DIR) -o $@ -c $<
|
|
|
|
@echo -e "$(CYAN)[CC]$(WHITE) $<"
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@rm -rf $(OBJ_DIR)
|
2020-12-22 18:15:25 +00:00
|
|
|
@echo -e "$(RED)[REMOVED]$(WHITE) obj files"
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
fclean: clean
|
|
|
|
@rm -f $(NAME)
|
2020-12-22 18:15:25 +00:00
|
|
|
@echo -e "$(RED)[REMOVED]$(WHITE) $(NAME)"
|
2020-12-17 19:10:23 +00:00
|
|
|
|
|
|
|
re: fclean all
|
|
|
|
|
|
|
|
.PHONY: all clean fclean re
|