title: How to know if a library exists or is up to date with makefile
body: <p>Here is my Makefile:</p>
  
  <pre><code>NAME = fillit
  
  FLAGS = -Wall -Wextra -Werror
  
  LIB_NAME = libft.a
  
  LIB_DIR = ../libft/
  
  LIB_PATH = $(LIB_DIR)$(LIB_NAME)
  
  OBJ_DIR_NAME = objects
  
  OBJ_DIR = $(OBJ_DIR_NAME)/
  
  HEADER_DIR = ../libft
  
  SRC = main.c
  
  OBJ = $(SRC:.c=.o)
  
  all :
      mkdir -p $(OBJ_DIR_NAME)
      $(MAKE) $(NAME)
  
  $(NAME) : $(OBJ) $(LIB_PATH) 
      gcc -o $(NAME) $(addprefix $(OBJ_DIR), $(OBJ)) -L$(LIB_DIR) -lft 
  
  $(LIB_PATH) : $(LIB_PATH) 
      $(MAKE) -C $(LIB_DIR) --no-print-directory
  
  %.o : %.c 
      gcc $(FLAGS) -I$(HEADER_DIR) -c $&lt;
      mv $@ $(OBJ_DIR)
  
  clean : 
      rm -f $(addprefix $(OBJ_DIR), $(OBJ))
      rm -rvf $(OBJ_DIR_NAME)
  
  fclean : clean
      rm -f $(NAME)
      rm -f $(addprefix $(LIB_DIR), $(LIB_NAME))
  
  re: fclean
      make
  </code></pre>
  
  <p>When i write <code>$(LIB_PATH) : $(LIB_PATH)</code> i'm expecting that my Makefile check if my lib is updated or exist and if that's not the case compile it (like objects and sources) but when i do make it only argue about circular rules and compile anyway my library.</p>
  
  <p>Then, what should i write for when i do make, it enter in the <code>$(LIB_PATH):</code> only when my library hasn't been compiled yet?</p>