42_CPP00/ex00/Makefile

25 lines
395 B
Makefile
Raw Normal View History

2023-06-22 07:20:47 -04:00
CXX = c++
CPPFLAGS = -std=c++98 -Wall -Wextra -Werror -g
SRCDIR = src
OBJDIR = obj
NAME = megaphone
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
all: $(NAME)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CPPFLAGS) -c $< -o $@
$(NAME): $(OBJS)
$(CXX) $(CPPFLAGS) $^ -o $@
clean:
rm -rf $(OBJDIR)/*.o
fclean: clean
rm -fr $(NAME)
re: fclean all