Added Makefile to Ex. 05.
authorLukas Jiriste <ljiriste@student.42prague.com>
Wed, 28 Jun 2023 08:14:37 +0000 (10:14 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Wed, 28 Jun 2023 08:14:37 +0000 (10:14 +0200)
ex05/Makefile [new file with mode: 0644]

diff --git a/ex05/Makefile b/ex05/Makefile
new file mode 100644 (file)
index 0000000..8d3288b
--- /dev/null
@@ -0,0 +1,28 @@
+CC = cc
+CFLAGS = -Wall -Wextra -Werror
+
+RM = rm -f
+
+INCDIR = ./headers
+SRCDIR = ./sources
+SOURCES = $(shell find $(SRCDIR) -name "*.c")
+OBJECTS = $(SOURCES:.c=.o)
+
+NAME = do-op
+
+all : $(NAME)
+
+$(NAME) : $(OBJECTS)
+       $(CC) $(CFLAGS) -o $(NAME) $(OBJECTS)
+
+%.o : %.c
+       $(CC) $(CFLAGS) -c -o $@ $< -I $(INCDIR)
+
+clean :
+       $(RM) $(OBJECTS)
+
+fclean : clean 
+       $(RM) $(NAME)
+
+re : fclean
+       $(MAKE) all