Browse Source

[enh] Makefile: Move flags in a variable. Add diff rule. Norm: grep only errors.

Moul 4 years ago
parent
commit
12fb6ef1f6
1 changed files with 10 additions and 4 deletions
  1. 10 4
      Makefile

+ 10 - 4
Makefile

@@ -6,7 +6,7 @@
 #    By: mazimi <mazimi@student.42.fr>              +#+  +:+       +#+         #
 #                                                 +#+#+#+#+#+   +#+            #
 #    Created: 2014/11/05 11:09:24 by mazimi            #+#    #+#              #
-#    Updated: 2016/02/12 18:00:50 by mazimi           ###   ########.fr        #
+#    Updated: 2016/02/19 15:44:59 by mazimi           ###   ########.fr        #
 #                                                                              #
 # **************************************************************************** #
 
@@ -93,11 +93,13 @@ SRC = $(addprefix src/, $(SRC_NAME))
 
 OBJ = $(addprefix obj/, $(OBJ_NAME))
 
+FLAG = -Wall -Werror -Wextra
+
 all: $(NAME)
 
 $(NAME):
 #	mkdir $(OBJ_PATH) 2> /dev/null || true
-	@gcc -Wall -Werror -Wextra -c $(SRC)
+	@gcc $(FLAG) -c $(SRC)
 	@ar rc $(NAME) $(OBJ_NAME)
 #	@rm -f $(OBJ)
 	@echo "Libft: make: library created."
@@ -118,6 +120,10 @@ fclean: clean
 re: fclean all
 
 norm:
-	@norminette $(SRC) libft.h
+	@norminette $(SRC) libft.h | grep -B 1 "Error"
+
+diff:
+	@clear
+	@git diff
 
-.PHONY: all, clean, fclean, re, norm
+.PHONY: all, clean, fclean, re, norm, diff