aboutsummaryrefslogtreecommitdiff
path: root/philo_three/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'philo_three/Makefile')
-rw-r--r--philo_three/Makefile21
1 files changed, 14 insertions, 7 deletions
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 <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# 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