+ | First commit, makefile and basic compilation

This commit is contained in:
TheRedShip
2024-09-27 15:01:48 +02:00
parent b1a5704781
commit 62cddcfb6f
5 changed files with 112 additions and 0 deletions

75
Makefile Normal file
View 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 = 
RED = 
GREEN = 
YELLOW = 
BLUE = 
MAGENTA = 
CYAN = 
WHITE = 
RESET = 
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
View 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

Binary file not shown.

BIN
lib/libglfw3.a Normal file

Binary file not shown.

19
srcs/RT.cpp Normal file
View 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);
}