commit add0be53de127a320b1a0198f7b87c96449999fc Author: lfirmin Date: Sat Nov 8 21:43:04 2025 +0100 init diff --git a/ex00/Bureaucrat.cpp b/ex00/Bureaucrat.cpp new file mode 100644 index 0000000..e69de29 diff --git a/ex00/Bureaucrat.hpp b/ex00/Bureaucrat.hpp new file mode 100644 index 0000000..ef8fb03 --- /dev/null +++ b/ex00/Bureaucrat.hpp @@ -0,0 +1,26 @@ +#ifndef BUREAUCRAT_HPP +#define BUREAUCRAT_HPP + +#include +#include +#include + +class Bureaucrat +{ + private: + const std::string _name; + int _grade; + + public: + Bureaucrat(); + Bureaucrat(const std::string _name, int _grade); + Bureaucrat(const Bureaucrat ©); + ~Bureaucrat(); + Bureaucrat &operator=(const Bureaucrat &other); + + std::string get_name() const; + int get_grade() const; + +}; + +#endif diff --git a/ex00/Main.cpp b/ex00/Main.cpp new file mode 100644 index 0000000..e69de29 diff --git a/ex00/Makefile b/ex00/Makefile new file mode 100644 index 0000000..fbdebbf --- /dev/null +++ b/ex00/Makefile @@ -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