From 608ae732eccfe50f2727823f9aebe1f32681edfb Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 30 Sep 2020 08:46:00 +0200 Subject: Refactoring philo_two to work with new common lib (not working) --- philo_two/Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'philo_two/Makefile') diff --git a/philo_two/Makefile b/philo_two/Makefile index b1cd2ed..4561afc 100644 --- a/philo_two/Makefile +++ b/philo_two/Makefile @@ -6,17 +6,18 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/24 05:50:15 by cacharle #+# #+# # -# Updated: 2020/09/29 15:21:43 by cacharle ### ########.fr # +# Updated: 2020/09/30 08:23:03 by cacharle ### ########.fr # # # # **************************************************************************** # RM = rm -f +MAKE = make --no-print-directory -# COMMON_DIR = ../common +COMMONDIR = ../common CC = gcc -CCFLAGS = -Wall -Wextra #-I$(COMMON_DIR) -Werror -LDFLAGS = -lpthread #-L$(COMMON_DIR) -lphilocommon +CCFLAGS = -Wall -Wextra -I$(COMMONDIR) #-Werror +LDFLAGS = -lpthread -L$(COMMONDIR) -lphilocommon NAME = philo_two @@ -26,7 +27,7 @@ OBJDIR = obj SRC = $(shell find $(SRCDIR) -type f -name '*.c') OBJ = $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o) -all: prebuild $(NAME) +all: prebuild common_all $(NAME) prebuild: @mkdir -p $(OBJDIR) @@ -37,7 +38,7 @@ $(NAME): $(OBJ) $(OBJDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CCFLAGS) -c -o $@ $< -clean: +clean: common_clean $(RM) $(OBJ) fclean: clean @@ -45,8 +46,10 @@ fclean: clean re: fclean all -# common_all: -# make -C $(COMMON_DIR) all -# -# common_fclean: -# make -C $(COMMON_DIR) fclean +common_all: + $(MAKE) -C $(COMMONDIR) all + +common_clean: + $(MAKE) -C $(COMMONDIR) clean + +.PHONY: all prebuild clean fclean re common_all common_clean -- cgit