From 6bfcd3c6f921e7717e61167b291bb27bd3f66386 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 29 Sep 2020 14:56:27 +0200 Subject: Fixing taking none existing fork in logs --- philo_one/Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'philo_one/Makefile') diff --git a/philo_one/Makefile b/philo_one/Makefile index de41214..da3f82e 100644 --- a/philo_one/Makefile +++ b/philo_one/Makefile @@ -6,7 +6,7 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/24 05:50:15 by cacharle #+# #+# # -# Updated: 2020/09/28 14:12:28 by cacharle ### ########.fr # +# Updated: 2020/09/29 11:30:07 by cacharle ### ########.fr # # # # **************************************************************************** # @@ -18,17 +18,11 @@ LDFLAGS = -lpthread NAME = philo_one -SRC = main.c \ - philo.c \ - forks.c \ - routine.c \ - io.c \ - args.c \ - helper.c - +SRCDIR = src OBJDIR = obj -OBJ = $(SRC:%.c=$(OBJDIR)/%.o) +SRC = $(shell find $(SRCDIR) -type f -name '*.c') +OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) all: prebuild $(NAME) @@ -38,7 +32,7 @@ prebuild: $(NAME): $(OBJ) $(CC) -o $@ $(OBJ) $(LDFLAGS) -$(OBJDIR)/%.o: %.c +$(OBJDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CCFLAGS) -c -o $@ $< clean: -- cgit