init
This commit is contained in:
commit
add0be53de
|
|
@ -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 ©);
|
||||||
|
~Bureaucrat();
|
||||||
|
Bureaucrat &operator=(const Bureaucrat &other);
|
||||||
|
|
||||||
|
std::string get_name() const;
|
||||||
|
int get_grade() const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue