From 5d687d7c28619449cbc21b03af2eba9480ff5eb2 Mon Sep 17 00:00:00 2001 From: starnakin Date: Tue, 18 Jul 2023 02:49:57 +0200 Subject: [PATCH] add: ex04 --- ex04/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ex04/Makefile diff --git a/ex04/Makefile b/ex04/Makefile new file mode 100644 index 0000000..0de238a --- /dev/null +++ b/ex04/Makefile @@ -0,0 +1,25 @@ +CXX = c++ +CPPFLAGS = -std=c++98 -Wall -Wextra -Werror -g +SRCDIR = src +OBJDIR = obj +NAME = sed + +SRCS = $(wildcard $(SRCDIR)/*.cpp) +OBJS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS)) + +all: $(NAME) + +$(OBJDIR)/%.o: $(SRCDIR)/%.cpp + mkdir -p obj + $(CXX) $(CPPFLAGS) -c $< -o $@ + +$(NAME): $(OBJS) + $(CXX) $(CPPFLAGS) $^ -o $@ + +clean: + rm -rf $(OBJDIR)/*.o + +fclean: clean + rm -fr $(NAME) + +re: fclean all