2023-08-31 12:03:36 -04:00
|
|
|
CXX := c++
|
|
|
|
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -g
|
|
|
|
SRCDIR := src
|
|
|
|
OBJDIR := obj
|
2023-09-03 07:19:13 -04:00
|
|
|
NAME := ex01
|
2023-08-31 12:03:36 -04:00
|
|
|
|
|
|
|
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
|