Skip to content

Commit

Permalink
Improve Makefile
Browse files Browse the repository at this point in the history
- 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:

AltraMayor#4
  • Loading branch information
AltraMayor committed Sep 5, 2014
1 parent b4e8e6c commit 71433d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -16,4 +16,4 @@ f3read: utils.o f3read.o
PHONY: clean

clean:
rm -f *.o $(TARGETS)
rm -f *.o *.d $(TARGETS)

0 comments on commit 71433d3

Please sign in to comment.