mise a la norme et renommer fonctions
This commit is contained in:
21
Makefile
21
Makefile
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user