Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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: 2016/10/08 11:28:26 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_search_pos_char.c \
  31. ft_strrchr.c \
  32. ft_strstr.c \
  33. ft_strnstr.c \
  34. ft_strcmp.c \
  35. ft_strncmp.c \
  36. ft_atoi.c \
  37. ft_isalpha.c \
  38. ft_isdigit.c \
  39. ft_isalnum.c \
  40. ft_isascii.c \
  41. ft_isprint.c \
  42. ft_isvisible.c \
  43. ft_toupper.c \
  44. ft_tolower.c \
  45. ft_memalloc.c \
  46. ft_memdel.c \
  47. ft_strnew.c \
  48. ft_strdel.c \
  49. ft_assign_free_str.c \
  50. ft_strclr.c \
  51. ft_striter.c \
  52. ft_striteri.c \
  53. ft_strmap.c \
  54. ft_strmapi.c \
  55. ft_strequ.c \
  56. ft_strnequ.c \
  57. ft_strsub.c \
  58. ft_strjoin.c \
  59. ft_strjoinf.c \
  60. ft_strsplit.c \
  61. ft_tabsize.c \
  62. ft_tabdel.c \
  63. ft_itoa.c \
  64. ft_strtrim.c \
  65. ft_putchar.c \
  66. ft_putstr.c \
  67. ft_putendl.c \
  68. ft_puttab.c \
  69. ft_puttabint.c \
  70. ft_putnbr.c \
  71. ft_putnbrn.c \
  72. ft_putchar_fd.c \
  73. ft_putstr_fd.c \
  74. ft_putendl_fd.c \
  75. ft_putnbr_fd.c \
  76. ft_printf.c \
  77. ft_dprintf.c \
  78. ft_lstnew.c \
  79. ft_lstdelone.c \
  80. ft_lstdel.c \
  81. ft_lstadd.c \
  82. ft_lstiter.c \
  83. ft_lstmap.c \
  84. sort_int_tab.c \
  85. get_next_line.c \
  86. count_char_str.c
  87. SRC_PATH = src
  88. OBJ_PATH = obj
  89. OBJ_NAME = $(SRC_NAME:.c=.o)
  90. SRC = $(addprefix $(SRC_PATH)/, $(SRC_NAME))
  91. OBJ = $(addprefix $(SRC_PATH)/, $(OBJ_NAME))
  92. FLAG = -g -Wall -Werror -Wextra
  93. all: $(NAME)
  94. $(NAME): $(OBJ)
  95. @ar rc $(NAME) $(OBJ)
  96. @echo "Libft: make: library created."
  97. $(OBJ_PATH)%.o: $(SRC_PATH)%.c
  98. # @mkdir -p $(OBJ_PATH)
  99. @gcc $(FLAG) -c $< -o $@
  100. clean:
  101. @rm -f $(OBJ)
  102. # @rmdir $(OBJ_PATH) 2> /dev/null || true
  103. # @rm -rf $(OBJ_PATH)
  104. @echo "Libft: clean: objects cleaned."
  105. fclean: clean
  106. @rm -f $(NAME)
  107. @echo "Libft: fclean: library deleted."
  108. re: fclean all
  109. norm:
  110. @norminette $(SRC) libft.h | grep -B 1 "Error"
  111. git:
  112. @clear
  113. @git status
  114. @git diff
  115. .PHONY: all, clean, fclean, re, norm, git