mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
+ | First commit, makefile and basic compilation
This commit is contained in:
75
Makefile
Normal file
75
Makefile
Normal file
@ -0,0 +1,75 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# Makefile :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: TheRed <TheRed@students.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2024/09/27 14:52:58 by TheRed #+# #+# #
|
||||
# Updated: 2024/09/27 14:52:58 by TheRed ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
BLACK = [90m
|
||||
RED = [91m
|
||||
GREEN = [92m
|
||||
YELLOW = [93m
|
||||
BLUE = [94m
|
||||
MAGENTA = [95m
|
||||
CYAN = [96m
|
||||
WHITE = [97m
|
||||
|
||||
RESET = [0m
|
||||
|
||||
LINE_CLR = \33[2K\r
|
||||
|
||||
NAME := RT
|
||||
|
||||
SRCS_DIR := srcs
|
||||
|
||||
OBJS_DIR := .objs
|
||||
|
||||
ALL_SRCS := RT.cpp \
|
||||
|
||||
|
||||
SRCS := $(ALL_SRCS:%=$(SRCS_DIR)/%)
|
||||
|
||||
|
||||
OBJS := $(addprefix $(OBJS_DIR)/, $(SRCS:%.cpp=%.o))
|
||||
|
||||
CC := g++
|
||||
|
||||
IFLAGS := -Ofast -I./includes -L./lib -lglfw3 -lopengl32 -lgdi32 -lcglm
|
||||
|
||||
RM := del /f /s /q
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
DIR_DUP = if not exist "$(@D)" mkdir "$(@D)"
|
||||
|
||||
# RULES ********************************************************************** #
|
||||
|
||||
all: $(NAME)
|
||||
|
||||
$(NAME): $(OBJS) $(HEADERS)
|
||||
@$(CC) -o $(NAME) $(OBJS) $(IFLAGS)
|
||||
@echo $(WHITE) $(NAME): PROJECT COMPILED !$(RESET) & echo:
|
||||
|
||||
$(OBJS_DIR)/%.o: %.cpp
|
||||
@$(DIR_DUP)
|
||||
@echo $(WHITE) $(NAME): $(WHITE)$<$(RESET) $(GREEN)compiling...$(RESET)
|
||||
@$(CC) -c $^ $(IFLAGS) -o $@
|
||||
|
||||
|
||||
fclean:
|
||||
@echo $(WHITE)$(NAME):$(RED) cleaned.$(RESET)
|
||||
@del /f /s /q $(NAME).exe
|
||||
@rmdir /S /Q "$(OBJS_DIR)"
|
||||
|
||||
re:
|
||||
@$(MAKE) fclean
|
||||
@$(MAKE) all
|
||||
|
||||
# **************************************************************************** #
|
||||
|
||||
.PHONY: all clean fclean dclean re bonus
|
18
includes/RT.h
Normal file
18
includes/RT.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* RT.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: TheRed <TheRed@students.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/27 14:52:10 by TheRed #+# #+# */
|
||||
/* Updated: 2024/09/27 14:52:10 by TheRed ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef RT_H
|
||||
# define RT_H
|
||||
|
||||
# include <iostream>
|
||||
|
||||
#endif
|
BIN
lib/libcglm.a
Normal file
BIN
lib/libcglm.a
Normal file
Binary file not shown.
BIN
lib/libglfw3.a
Normal file
BIN
lib/libglfw3.a
Normal file
Binary file not shown.
19
srcs/RT.cpp
Normal file
19
srcs/RT.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* RT.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: TheRed <TheRed@students.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/27 14:51:49 by TheRed #+# #+# */
|
||||
/* Updated: 2024/09/27 14:51:49 by TheRed ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "RT.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
return (0);
|
||||
}
|
Reference in New Issue
Block a user