42_CPP01/ex03/Makefile

26 lines
404 B
Makefile
Raw Normal View History

2023-05-24 10:41:02 -04:00
CXX = c++
2023-07-17 15:35:02 -04:00
CPPFLAGS = -std=c++98 -Wall -Wextra -Werror -g
2023-05-24 10:41:02 -04:00
SRCDIR = src
OBJDIR = obj
2023-07-17 15:35:02 -04:00
NAME = ex03
2023-05-24 10:41:02 -04:00
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
2023-07-17 15:35:02 -04:00
all: $(NAME)
2023-05-24 10:41:02 -04:00
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
2023-07-17 15:35:02 -04:00
mkdir -p obj
$(CXX) $(CPPFLAGS) -c $< -o $@
2023-05-24 10:41:02 -04:00
2023-07-17 15:35:02 -04:00
$(NAME): $(OBJS)
$(CXX) $(CPPFLAGS) $^ -o $@
2023-05-24 10:41:02 -04:00
clean:
rm -rf $(OBJDIR)/*.o
fclean: clean
2023-07-17 15:35:02 -04:00
rm -fr $(NAME)
2023-05-24 10:41:02 -04:00
re: fclean all