42_CPP00/ex01/Makefile
Camille Chauvet 11eb368caf fix
2023-05-22 12:04:39 +00:00

28 lines
525 B
Makefile

CXX = c++
CXXFLAGS = -std=c++98 -Wall -Wextra -Werror -g
SRCDIR = src
INCDIR = include
OBJDIR = obj
BINDIR = bin
EXECUTABLE = contacts
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
INCS = -I$(INCDIR)
all: $(BINDIR)/$(EXECUTABLE)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) $(INCS) -c $< -o $@
$(BINDIR)/$(EXECUTABLE): $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $@
clean:
rm -rf $(OBJDIR)/*.o
fclean: clean
rm -fr $(BINDIR)/$(EXECUTABLE)
re: fclean $(BINDIR)/$(EXECUTABLE)