42_CPP02/ex02/Makefile

26 lines
420 B
Makefile
Raw Normal View History

2023-08-03 08:01:36 -04:00
CXX = c++
2023-08-03 08:25:38 -04:00
CXXFLAGS = -std=c++98 -Wall -Wextra -Werror -g -O0
2023-08-03 08:01:36 -04:00
SRCDIR = src
OBJDIR = obj
2023-08-03 08:25:38 -04:00
EXECUTABLE = fixed
2023-08-03 08:01:36 -04:00
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
2023-08-03 08:25:38 -04:00
all: $(EXECUTABLE)
2023-08-03 08:01:36 -04:00
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
2023-08-03 08:25:38 -04:00
$(CXX) $(CXXFLAGS) -c $< -o $@
2023-08-03 08:01:36 -04:00
2023-08-03 08:25:38 -04:00
$(EXECUTABLE): $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@
2023-08-03 08:01:36 -04:00
clean:
rm -rf $(OBJDIR)/*.o
fclean: clean
2023-08-03 08:25:38 -04:00
rm -fr $(EXECUTABLE)
2023-08-03 08:01:36 -04:00
re: fclean all
2023-08-03 08:25:38 -04:00