Makefile: Modify default CFLAGS

This removes the "-g -O0" default (to leave them up to the user
CFLAGS), and adds a switch to ignore "unused result" warnings.
The latter is relevant when trying to compile nand-part.c with
optimizations enabled.

Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
This commit is contained in:
Bernhard Nortmann 2016-11-10 10:50:20 +01:00
parent 3dab68f94c
commit bf735b2c47
2 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ language: c
# treat all warnings as errors, fake cross-toolchain (build everything on host)
env:
- CFLAGS=-Werror CROSS_COMPILE=""
- CFLAGS="-g -O2 -Werror" CROSS_COMPILE=""
os:
- linux

View File

@ -17,7 +17,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
CC ?= gcc
DEFAULT_CFLAGS := -g -O0 -Wall -Wextra -std=c99
DEFAULT_CFLAGS := -std=c99
DEFAULT_CFLAGS += -Wall -Wextra -Wno-unused-result
DEFAULT_CFLAGS += -D_POSIX_C_SOURCE=200112L
# Define _BSD_SOURCE, necessary to expose all endian conversions properly.