Add Makefile (doesn't compile yet)
authorLukas Jiriste <ljiriste@student.42prague.com>
Tue, 26 Mar 2024 10:10:42 +0000 (11:10 +0100)
committerLukas Jiriste <ljiriste@student.42prague.com>
Tue, 26 Mar 2024 10:10:42 +0000 (11:10 +0100)
philo/Makefile [new file with mode: 0644]

diff --git a/philo/Makefile b/philo/Makefile
new file mode 100644 (file)
index 0000000..e86af04
--- /dev/null
@@ -0,0 +1,33 @@
+CC := gcc
+
+CFLAGS := -Wall -Wextra -Werror -Wpedantic
+#-std=c99 
+NAME := philo
+
+INCDIR := .
+SRCDIR := .
+SRCS :=        main.c                  \
+
+SRCS := $(addprefix $(SRCDIR)/, $(SRCS))
+OBJS := $(SRCS:%.c=%.o)
+CFLAGS += $(addprefix -I, $(INCDIR))
+
+all : $(NAME)
+
+debug : CFLAGS += -g
+debug : $(NAME)
+
+$(NAME) : $(OBJS)
+       $(CC) $(CFLAGS) $(OBJS) -o $@ 
+
+%.o : %.c
+       $(CC) $(CFLAGS) -c $< -o $@
+
+clean :
+       $(RM) $(OBJS)
+
+fclean :
+       $(RM) $(OBJS) $(NAME)
+
+re : fclean
+       $(MAKE)