Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. #******************************************************************************#
  2. # #
  3. # ::: :::::::: #
  4. # Makefile :+: :+: :+: #
  5. # +:+ +:+ +:+ #
  6. # By: bchanot <bchanot@students.42.fr> +#+ +:+ +#+ #
  7. # +#+#+#+#+#+ +#+ #
  8. # Created: 2015/11/27 00:02:23 by bchanot #+# #+# #
  9. #* Updated: 2018/10/12 22:30:35 by bchanot ### ########.fr *#
  10. # #
  11. #******************************************************************************#
  12. CC = gcc -Wall -Wextra -Werror -g
  13. NAME = libft.a
  14. OBJS_DIR = .objects/
  15. SRCS_DIR = srcs/
  16. INC = -I./includes
  17. FILES = ft_atoi \
  18. ft_strrchr \
  19. ft_bzero \
  20. ft_memalloc \
  21. ft_strsplit \
  22. ft_isalnum \
  23. ft_isnum \
  24. ft_memccpy \
  25. ft_strjoin \
  26. ft_strstr \
  27. ft_isalpha \
  28. ft_memchr \
  29. ft_putstr \
  30. ft_strlcat \
  31. ft_strsub \
  32. ft_isascii \
  33. ft_memcmp \
  34. ft_strlen \
  35. ft_strtrim \
  36. ft_isdigit \
  37. ft_memcpy \
  38. ft_strcat \
  39. ft_tolower \
  40. ft_isprint \
  41. ft_memdel \
  42. ft_strchr \
  43. ft_toupper \
  44. ft_strncat \
  45. ft_strcmp \
  46. ft_strncmp \
  47. ft_memset \
  48. ft_strcpy \
  49. ft_strncpy \
  50. ft_putchar \
  51. ft_strnequ \
  52. ft_strdup \
  53. ft_strnew \
  54. ft_putendl \
  55. ft_strequ \
  56. ft_strnstr \
  57. ft_cptchar \
  58. ft_puttab \
  59. ft_exit \
  60. ft_sqrt \
  61. ft_unicode \
  62. ft_strnjoin \
  63. ft_getchar \
  64. ft_charjoin \
  65. ft_isupper \
  66. ft_islower \
  67. ft_memdel2 \
  68. ft_strisdigit \
  69. ft_strcmp_end \
  70. ft_tablen \
  71. ft_swap \
  72. ft_tabnew \
  73. ft_printf \
  74. ft_strcorr \
  75. ft_strichr \
  76. ft_strreplace \
  77. ft_cptcmp \
  78. ft_itoa_base_depth \
  79. ft_itoa_base \
  80. ft_take_last_chain \
  81. ft_nb_word \
  82. ft_tabjoin \
  83. ft_getenv \
  84. ft_tabdup \
  85. ft_cptchar_glued \
  86. ft_puthex \
  87. ft_putascii \
  88. ft_system \
  89. ft_print_memory \
  90. ft_dup_first_word \
  91. ft_strndup \
  92. ft_strmerge \
  93. ft_take_args \
  94. ft_take_opts \
  95. ft_get_file_content \
  96. ft_str_upper \
  97. ft_str_lower \
  98. ft_pow \
  99. ft_nbrlen \
  100. ft_putnbr \
  101. get_next_line
  102. PRINTF = pf_b \
  103. pf_c \
  104. pf_c_up \
  105. pf_d_up \
  106. pf_di \
  107. pf_len \
  108. pf_more_inf \
  109. pf_o \
  110. pf_o_up \
  111. pf_p \
  112. pf_percent \
  113. pf_putnbr \
  114. pf_putnbrlong \
  115. pf_putstr \
  116. pf_s \
  117. pf_s_up \
  118. pf_take_inf \
  119. pf_u \
  120. pf_u_up \
  121. pf_x \
  122. pf_x_up
  123. SRC_PRINTF = $(addprefix ft_printf/, $(PRINTF))
  124. SRC = $(FILES) $(SRC_PRINTF)
  125. OBJS := $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRC)))
  126. RED = \033[1;31m
  127. BLUE = \033[1;34m
  128. CYAN = \033[0;36m
  129. GREEN = \033[1;32m
  130. YELLOW = \033[1;33m
  131. EOC = \033[0m
  132. all: $(NAME)
  133. $(NAME): $(OBJS)
  134. @ar rc $(NAME) $(OBJS)
  135. @ranlib $(NAME)
  136. @echo -e "$(GREEN)Libft crated.$(EOC)"
  137. $(OBJS_DIR)%.o: $(SRCS_DIR)%.c
  138. @mkdir -p $(dir $@)
  139. $(CC) -c $< $(INC) -o $@
  140. clean:
  141. @/bin/rm -rf $(OBJS_DIR)
  142. fclean: clean
  143. @/bin/rm -f $(NAME)
  144. re: fclean all
  145. .PHONY: all clean fclean re