42_CPP07/ex02/Makefile

27 lines
441 B
Makefile
Raw Permalink Normal View History

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