From 679a327ac5051e633cdd347a222b0325be631603 Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Sat, 8 Sep 2018 03:47:04 +0200 Subject: [PATCH] Makefile: Do not force optimizations by default Make life easier for package maintainers by not forcing architecture or compiler optimizations by default. E.g., Gentoo QA refuses to accept both "-march=native" and "-O3". These are usually provided by the package tooling. Instead, we provide easily accessible templates in "makeflags". Signed-off-by: Kai Krakow --- makeflags | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/makeflags b/makeflags index de4a66f..c9ed421 100644 --- a/makeflags +++ b/makeflags @@ -1,4 +1,11 @@ -CCFLAGS = -Wall -Wextra -Werror -O3 -march=native -I../include -ggdb -D_FILE_OFFSET_BITS=64 +# Default: +CCFLAGS = -Wall -Wextra -Werror -I../include -fpic -D_FILE_OFFSET_BITS=64 + +# Optimized: +# CCFLAGS = -Wall -Wextra -Werror -O3 -march=native -I../include -fpic -D_FILE_OFFSET_BITS=64 + +# Debug: # CCFLAGS = -Wall -Wextra -Werror -O0 -I../include -ggdb -fpic -D_FILE_OFFSET_BITS=64 -CFLAGS = $(CCFLAGS) -std=c99 -CXXFLAGS = $(CCFLAGS) -std=c++11 -Wold-style-cast + +CFLAGS += $(CCFLAGS) -std=c99 +CXXFLAGS += $(CCFLAGS) -std=c++11 -Wold-style-cast