From 71433d3b7852345b52b5eff7c3cb8ea876344872 Mon Sep 17 00:00:00 2001 From: Michel Machado Date: Fri, 5 Sep 2014 07:58:08 -0400 Subject: [PATCH] Improve Makefile - Change compiling flag -Wpedantic to -pedantic. Flag -Wpedantic is not available in older versions of gcc, what makes the life of some users unnecessarily harder. Not to mention that both flags work fine for F3. - Allow make variable CC to be set externally. Some platforms favor other C compilers. For example, FreeBSD defaults to clang. - Allow make variable CFLAGS to be extended externally. This helps packaging. - Target clean to also remove *.d files. The three first improvements were suggested by Thomas Fischer and Uffe Jakobsen. The discussion is available here: https://github.com/AltraMayor/f3/issues/4 --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d11496a..53f939e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CC = gcc -CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -MMD +CC ?= gcc +CFLAGS += -std=c99 -Wall -Wextra -pedantic -MMD TARGETS = f3write f3read @@ -16,4 +16,4 @@ f3read: utils.o f3read.o PHONY: clean clean: - rm -f *.o $(TARGETS) + rm -f *.o *.d $(TARGETS)