mise a la norme et renommer fonctions

This commit is contained in:
Hugo LAMY
2022-01-26 15:33:29 +01:00
parent ab0c4efa35
commit b192efa4a9
13 changed files with 213 additions and 77 deletions

View File

@@ -7,7 +7,7 @@ CFLAGS = -Wall -Wextra -Werror $(INCLUDES) -g3 # del g3
VPATH = $(DIR_SRCS)
DIR_SRCS = srcs
INCLUDES = -I$(HEADERS_D) -I$(LIBFT_D)
INCLUDES = -I$(HEADERS_D)
HEADERS_D = ./headers
HEADERS = philo.h \
@@ -15,16 +15,13 @@ HEADERS = philo.h \
philo_proto.h \
philo_macro.h
LIBS = -L $(LIBFT_D) -lft \
-lpthread
LIBFT_D = ./libft
LIBFT = $(LIBFT_D)/libft.a
LIBS = -lpthread
SRCS = main.c \
init.c \
main_thread.c \
pere_fouettard.c \
exec.c \
utils.c \
generic.c
DIR_OBJS = builds
@@ -34,13 +31,7 @@ OBJS = $(SRCS:%.c=$(DIR_OBJS)/%.o)
# ------ RULES -------
# --------------------
all: subsystem $(NAME)
subsystem:
@cd $(LIBFT_D) && $(MAKE)
$(LIBFT): # dispensable. utile seulement pour un appel direct à $(NAME), si $(LIBFT) n'existe pas
cd $(LIBFT_D) && $(MAKE)
all: $(NAME)
$(DIR_OBJS)/%.o: %.c | $(DIR_OBJS)
$(CC) $(CFLAGS) -c $< -o $@
@@ -50,7 +41,7 @@ $(DIR_OBJS):
$(OBJS): $(HEADERS:%=$(HEADERS_D)/%)
$(NAME): $(OBJS) $(LIBFT)
$(NAME): $(OBJS)
$(CC) $(OBJS) -o $(NAME) $(LIBS)
clean: