From 2c5abe421b7a1b92081e38f6b1f04d407fcba834 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 15 Feb 2020 01:47:26 +0100 Subject: philo_one small refactoring, philo_three draft --- philo_three/Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'philo_three/Makefile') diff --git a/philo_three/Makefile b/philo_three/Makefile index 8fe7c4d..431bf62 100644 --- a/philo_three/Makefile +++ b/philo_three/Makefile @@ -6,33 +6,40 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/24 05:50:15 by cacharle #+# #+# # -# Updated: 2019/11/24 07:07:21 by cacharle ### ########.fr # +# Updated: 2020/02/15 00:46:58 by cacharle ### ########.fr # # # # **************************************************************************** # RM = rm -f +COMMON_DIR = ../common + CC = gcc -CCFLAGS = -Wall -Wextra #-Werror -LDFLAGS = -lpthread +CCFLAGS = -I$(COMMON_DIR) -Wall -Wextra #-Werror +LDFLAGS = -lpthread -L$(COMMON_DIR) -lphilocommon NAME = philo_three SRC = main.c OBJ = $(SRC:.c=.o) - all: $(NAME) -$(NAME): $(OBJ) +$(NAME): common_all $(OBJ) $(CC) $(LDFLAGS) -o $@ $(OBJ) %.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $^ + $(CC) $(CCFLAGS) -c -o $@ $< -clean: +clean: common_fclean $(RM) $(OBJ) fclean: clean $(RM) $(NAME) re: fclean all + +common_all: + make -C $(COMMON_DIR) all + +common_fclean: + make -C $(COMMON_DIR) fclean -- cgit