42_CPP03/ex00/Makefile

27 lines
435 B
Makefile
Raw Normal View History

2023-08-29 09:47:04 -04:00
CXX := c++
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -g
SRCDIR := src
OBJDIR := obj
NAME := ex00
2023-08-07 15:04:12 -04:00
2023-08-29 09:47:04 -04:00
SRCS := $(wildcard $(SRCDIR)/*.cpp)
OBJS := $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
2023-08-07 15:04:12 -04:00
all: $(NAME)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
mkdir -p obj
2023-08-29 09:47:04 -04:00
$(CXX) $(CXXFLAGS) -c $< -o $@
2023-08-07 15:04:12 -04:00
$(NAME): $(OBJS)
2023-08-29 09:47:04 -04:00
$(CXX) $(CXXFLAGS) $^ -o $@
2023-08-07 15:04:12 -04:00
clean:
2023-08-29 09:47:04 -04:00
rm -rf $(OBJDIR)
2023-08-07 15:04:12 -04:00
fclean: clean
rm -fr $(NAME)
2023-08-29 09:47:04 -04:00
re: fclean
@make --no-print-directory all