add: makefile

This commit is contained in:
Camille Chauvet 2023-06-22 13:20:47 +02:00
parent 03fe0a8720
commit bfda0a7548
4 changed files with 24 additions and 0 deletions

24
ex00/Makefile Normal file
View File

@ -0,0 +1,24 @@
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

0
ex00/obj/.gitkepp Normal file
View File

0
ex01/obj/.gitkepp Normal file
View File