42_CPP09/ex02/Makefile
2023-12-13 00:35:42 +01:00

27 lines
439 B
Makefile

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