<commit_before>NAME = 					rtv1

CC = 					clang
CFLAGS +=				-Wall -Wextra -Werror
OFLAGS := 				-O3 -Ofast
RM := 					rm -rf

INC = 					$(addprefix $(INC_PATH)/,$(INC_NAMES))
INC_PATH =				./includes

LIBFT :=				$(LIBFT_PATH)/libft.a
LIBFT_PATH :=			./libft
LIBFT_INC_PATH :=		./libft
LIBFTFLAGS :=			-lft

LIBMATHFLAGS :=			-lm

OS_TEST := $(shell uname)
ifeq ($(OS_TEST), Darwin)
INC_NAMES = 			$(NAME).h \
						mac_keys.h
MLXFLAGS =				-framework OpenGL -framework AppKit
KEYS =					-DMAC_KEYS
OS_VERSION_TEST := $(shell uname -r | cut -d . -f 1)
endif
ifeq  ($(OS_VERSION_TEST),16)
OS_NAME =				"Sierra"
MLX_PATH =				./mlx/mlx_sierra
else ifeq ($(OS_TEST), Darwin)
OS_NAME =				"El_Capitan"
MLX_PATH =				./mlx/mlx_capitan
endif
ifeq ($(OS_TEST),"Linux")
OS_NAME =				"Linux"
MLX_PATH =				./mlx/mlx_x11
INC_NAMES = 			$(NAME).h \
						linux_keys.h
MLXFLAGS =				-lmlx -lXext -lX11
KEYS =					-DLINUX_KEYS
endif

MLX =					$(MLX_PATH)/libmlx.a

OBJ =					$(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
OBJ_PATH =				./obj
OBJ_NAME =				$(SRC_NAME:.c=.o)

SRC =					$(addprefix $(SRC_PATH)/,$(SRC_NAME))
SRC_PATH =				./src
SRC_NAME =  			init.c \
						main.c \
						mlx_image_draw.c \
						mlx_key_press.c \
						mlx_key_release.c \
						mlx_key_events.c \
						mlx_main_loop.c \
						mlx_mouse.c \
						opencl_compute.c \
						opencl_init.c \
						tools.c

default: gpu

all: $(NAME)

$(NAME): libft mlx $(SRC) $(INC) $(OBJ_PATH) $(OBJ)
	@echo "$(GREEN)Compiling $(NAME) with $(OS_NAME) MLX version$(EOC)"
	$(CC) -o $@ $(OBJ) -L$(LIBFT_PATH) $(LIBFTFLAGS) $(MLX) $(MLXFLAGS) $(LIBMATHFLAGS) $(GPU_L) $(ASANFLAGS)

$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(INCLUDES_PATH) $(INC)
	$(CC) $(CFLAGS) $(OFLAGS) -c $< -o $@ -I $(INC_PATH) -I $(LIBFT_INC_PATH) -I $(MLX_PATH) $(GPU_MACRO) $(KEYS) $(DEBUG_MACRO) $(ASANFLAGS)

$(OBJ_PATH):
	@echo "$(GREEN)Creating ./obj path and making binaries from source files$(EOC)"
	@mkdir $(OBJ_PATH)

CPU: all
cpu: CPU

GPU: gpu_flags all
gpu: GPU
gpu_flags:<commit_msg>added the new source files<commit_after>NAME = 					rtv1

CC = 					clang
CFLAGS +=				-Wall -Wextra -Werror
OFLAGS := 				-O3 -Ofast
RM := 					rm -rf

INC = 					$(addprefix $(INC_PATH)/,$(INC_NAMES))
INC_PATH =				./includes

LIBFT :=				$(LIBFT_PATH)/libft.a
LIBFT_PATH :=			./libft
LIBFT_INC_PATH :=		./libft
LIBFTFLAGS :=			-lft

LIBMATHFLAGS :=			-lm

OS_TEST := $(shell uname)
ifeq ($(OS_TEST), Darwin)
INC_NAMES = 			$(NAME).h \
						mac_keys.h
MLXFLAGS =				-framework OpenGL -framework AppKit
KEYS =					-DMAC_KEYS
OS_VERSION_TEST := $(shell uname -r | cut -d . -f 1)
endif
ifeq  ($(OS_VERSION_TEST),16)
OS_NAME =				"Sierra"
MLX_PATH =				./mlx/mlx_sierra
else ifeq ($(OS_TEST), Darwin)
OS_NAME =				"El_Capitan"
MLX_PATH =				./mlx/mlx_capitan
endif
ifeq ($(OS_TEST),"Linux")
OS_NAME =				"Linux"
MLX_PATH =				./mlx/mlx_x11
INC_NAMES = 			$(NAME).h \
						linux_keys.h
MLXFLAGS =				-lmlx -lXext -lX11
KEYS =					-DLINUX_KEYS
endif

MLX =					$(MLX_PATH)/libmlx.a

OBJ =					$(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
OBJ_PATH =				./obj
OBJ_NAME =				$(SRC_NAME:.c=.o)

SRC =					$(addprefix $(SRC_PATH)/,$(SRC_NAME))
SRC_PATH =				./src
SRC_NAME =  			init.c \
						main.c \
						mlx_image_draw.c \
						mlx_key_press.c \
						mlx_key_release.c \
						mlx_key_events.c \
						mlx_main_loop.c \
						mlx_mouse.c \
						opencl_compute.c \
						opencl_init.c \
						tools.c \
						xml_file.c

default: gpu

all: $(NAME)

$(NAME): libft mlx $(SRC) $(INC) $(OBJ_PATH) $(OBJ)
	@echo "$(GREEN)Compiling $(NAME) with $(OS_NAME) MLX version$(EOC)"
	$(CC) -o $@ $(OBJ) -L$(LIBFT_PATH) $(LIBFTFLAGS) $(MLX) $(MLXFLAGS) $(LIBMATHFLAGS) $(GPU_L) $(ASANFLAGS)

$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c $(INCLUDES_PATH) $(INC)
	$(CC) $(CFLAGS) $(OFLAGS) -c $< -o $@ -I $(INC_PATH) -I $(LIBFT_INC_PATH) -I $(MLX_PATH) $(GPU_MACRO) $(KEYS) $(DEBUG_MACRO) $(ASANFLAGS)

$(OBJ_PATH):
	@echo "$(GREEN)Creating ./obj path and making binaries from source files$(EOC)"
	@mkdir $(OBJ_PATH)

CPU: all
cpu: CPU

GPU: gpu_flags all
gpu: GPU
gpu_flags:
{'fraction_non_alphanumeric': 0.17588932806324112, 'fraction_numerical': 0.004446640316205534, 'mean_word_length': 2.8895292987512007, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1098431', 'n_tokens_mistral': 2128, 'n_tokens_neox': 1794, 'n_words': 366}