This commit is contained in:
lfirmin 2025-11-08 21:43:04 +01:00
commit add0be53de
4 changed files with 62 additions and 0 deletions

0
ex00/Bureaucrat.cpp Normal file
View File

26
ex00/Bureaucrat.hpp Normal file
View File

@ -0,0 +1,26 @@
#ifndef BUREAUCRAT_HPP
#define BUREAUCRAT_HPP
#include <exception>
#include <iostream>
#include <string>
class Bureaucrat
{
private:
const std::string _name;
int _grade;
public:
Bureaucrat();
Bureaucrat(const std::string _name, int _grade);
Bureaucrat(const Bureaucrat &copy);
~Bureaucrat();
Bureaucrat &operator=(const Bureaucrat &other);
std::string get_name() const;
int get_grade() const;
};
#endif

0
ex00/Main.cpp Normal file
View File

36
ex00/Makefile Normal file
View File

@ -0,0 +1,36 @@
CXX = c++
CXXFLAGS = -Wall -Wextra -Werror -std=c++98
OBJDIR = obj
SOURCES = Main.cpp Bureaucrat.cpp
OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.cpp=.o))
NAME = Bureaucrat
all: $(NAME)
$(OBJDIR):
@echo "📁 Creating obj directory..."
@mkdir -p $(OBJDIR)
$(OBJDIR)/%.o: %.cpp | $(OBJDIR)
@echo "🧠 Compiling $< ..."
@$(CXX) $(CXXFLAGS) -c $< -o $@
@echo "$@ ready!"
$(NAME): $(OBJECTS)
@echo "🔗 Linking $(NAME) ..."
@$(CXX) $(CXXFLAGS) $(OBJECTS) -o $(NAME)
@echo "🎉 $(NAME) is ready!"
clean:
@echo "🧹 Cleaning object files..."
@rm -rf $(OBJDIR)
@echo "✨ Objects cleaned!"
fclean: clean
@echo "🗑️ Removing $(NAME)..."
@rm -f $(NAME)
@echo "💀 Full clean complete!"
re: fclean all
.PHONY: all clean fclean re