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
This commit is contained in:
Michel Machado 2014-09-05 07:58:08 -04:00
parent b4e8e6c9da
commit 71433d3b78

View File

@ -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)