Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # **************************************************************************** #
  2. # #
  3. # ::: :::::::: #
  4. # Makefile :+: :+: :+: #
  5. # +:+ +:+ +:+ #
  6. # By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ #
  7. # +#+#+#+#+#+ +#+ #
  8. # Created: 2014/11/05 11:09:24 by mazimi #+# #+# #
  9. # Updated: 2015/12/17 17:58:01 by mazimi ### ########.fr #
  10. # #
  11. # **************************************************************************** #
  12. NAME = libft.a
  13. SRC_NAME = ft_memset.c \
  14. ft_bzero.c \
  15. ft_memcpy.c \
  16. ft_memccpy.c \
  17. ft_memmove.c \
  18. ft_memchr.c \
  19. ft_memcmp.c \
  20. ft_strlen.c \
  21. ft_strdup.c \
  22. ft_strndup.c \
  23. ft_strdup_till.c \
  24. ft_strcpy.c \
  25. ft_strncpy.c \
  26. ft_strcat.c \
  27. ft_strncat.c \
  28. ft_strlcat.c \
  29. ft_strchr.c \
  30. ft_strrchr.c \
  31. ft_strstr.c \
  32. ft_strnstr.c \
  33. ft_strcmp.c \
  34. ft_strncmp.c \
  35. ft_atoi.c \
  36. ft_isalpha.c \
  37. ft_isdigit.c \
  38. ft_isalnum.c \
  39. ft_isascii.c \
  40. ft_isprint.c \
  41. ft_toupper.c \
  42. ft_tolower.c \
  43. ft_memalloc.c \
  44. ft_memdel.c \
  45. ft_strnew.c \
  46. ft_strdel.c \
  47. ft_strclr.c \
  48. ft_striter.c \
  49. ft_striteri.c \
  50. ft_strmap.c \
  51. ft_strmapi.c \
  52. ft_strequ.c \
  53. ft_strnequ.c \
  54. ft_strsub.c \
  55. ft_strjoin.c \
  56. ft_strjoinf.c \
  57. ft_strsplit.c \
  58. ft_tabsize.c \
  59. ft_itoa.c \
  60. ft_itoa_base.c \
  61. ft_strtrim.c \
  62. ft_putchar.c \
  63. ft_putstr.c \
  64. ft_putendl.c \
  65. ft_puttab.c \
  66. ft_puttabint.c \
  67. ft_putnbr.c \
  68. ft_putnbrn.c \
  69. ft_putchar_fd.c \
  70. ft_putstr_fd.c \
  71. ft_putendl_fd.c \
  72. ft_putnbr_fd.c \
  73. ft_lstnew.c \
  74. ft_lstdelone.c \
  75. ft_lstdel.c \
  76. ft_lstadd.c \
  77. ft_lstiter.c \
  78. ft_lstmap.c \
  79. sort_int_tab.c \
  80. get_next_line.c
  81. SRC_PATH = src
  82. OBJ_PATH = obj
  83. OBJ_NAME = $(SRC_NAME:.c=.o)
  84. SRC = $(addprefix src/, $(SRC_NAME))
  85. OBJ = $(addprefix obj/, $(OBJ_NAME))
  86. all: $(NAME)
  87. $(NAME):
  88. # mkdir $(OBJ_PATH) 2> /dev/null || true
  89. gcc -Wall -Werror -Wextra -c $(SRC)
  90. @ar rc $(NAME) $(OBJ_NAME)
  91. # @rm -f $(OBJ)
  92. @echo "Libft: make: library created."
  93. #$(OBJ_PATH)%.o: $(SRC_PATH)%.c
  94. # mkdir $(OBJ_PATH) 2> /dev/null || true
  95. # gcc -Wall -Werror -Wextra -c $(SRC) $(OBJ)
  96. clean:
  97. @rm -f $(OBJ_NAME)
  98. # @rmdir $(OBJ_PATH) 2> /dev/null || true
  99. @echo "Lifbt: clean: objects cleaned."
  100. fclean: clean
  101. @rm -f $(NAME)
  102. @echo "Lifbt: fclean: library deleted."
  103. re: fclean all
  104. norm:
  105. @norminette $(SRC) libft.h
  106. .PHONY: all, clean, fclean, re, norm