59 lines
1.8 KiB
Makefile
59 lines
1.8 KiB
Makefile
# **************************************************************************** #
|
|
# #
|
|
# ::: :::::::: #
|
|
# Makefile :+: :+: :+: #
|
|
# +:+ +:+ +:+ #
|
|
# By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ #
|
|
# +#+#+#+#+#+ +#+ #
|
|
# Created: 2024/01/22 07:21:18 by mmoussou #+# #+# #
|
|
# Updated: 2025/08/02 13:42:27 by mmoussou ### ########.fr #
|
|
# #
|
|
# **************************************************************************** #
|
|
|
|
SHELL = bash
|
|
|
|
RED = \033[0;31m
|
|
GREEN = \033[0;32m
|
|
YELLOW = \033[1;33m
|
|
PURPLE = \e[0;35m
|
|
NC = \033[0m
|
|
DELETE = \x1B[2K
|
|
|
|
CC = c++
|
|
|
|
FLAGS = -std=c++98 -Wall -Werror -Wextra
|
|
|
|
INCLUDES = ./
|
|
|
|
NAME = $(shell basename $(PWD))
|
|
|
|
SRCS = main.cpp Bureaucrat.cpp AForm.cpp ShrubberyCreationForm.cpp RobotomyRequestForm.cpp PresidentialPardonForm.cpp Intern.cpp
|
|
|
|
OBJSDIR = obj/
|
|
OBJS = $(addprefix $(OBJSDIR), $(SRCS:.cpp=.o))
|
|
|
|
all: $(NAME)
|
|
|
|
$(NAME): $(OBJS)
|
|
@$(CC) $(FLAGS) -I$(INCLUDES) $(OBJS) -o $(NAME)
|
|
@printf "$(NC)$(YELLOW)「✨」 feat($(NAME)): program compiled\n$(NC)"
|
|
|
|
$(OBJSDIR)%.o: %.cpp
|
|
@mkdir -p $(@D)
|
|
@$(CC) $(FLAGS) -I$(INCLUDES) -c $< -o $@
|
|
@printf "$(NC)$(GREEN)「🔨」 build($<): object compiled\n$(NC)"
|
|
|
|
clean:
|
|
@rm -f $(OBJS)
|
|
@printf "$(NC)$(RED)「🗑️」 clean($(OBJS)): object deleted\n$(NC)"
|
|
|
|
fclean: clean
|
|
@rm -f $(NAME)
|
|
@rm -Rf $(OBJSDIR)
|
|
@printf "$(NC)$(RED)「🗑️」 fclean($(NAME)): program deleted\n$(NC)"
|
|
|
|
re: fclean
|
|
@$(MAKE) -s all
|
|
|
|
.PHONY: clean fclean all re
|