From 4e407258b1080947556add7b2ece21422ceafbed Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Wed, 29 May 2013 20:12:10 +0200 Subject: make: add DISTRO=1 for compilation on distributions For packaging, we cannot use -O3, -march etc, so have an option that allows for distribution build and does less tuning. Signed-off-by: Daniel Borkmann --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9f85ef7..8a8b76b 100644 --- a/Makefile +++ b/Makefile @@ -38,19 +38,21 @@ endif # For packaging purposes, you might want to call your own: # make CFLAGS="" -CFLAGS_DEF = -std=gnu99 +CFLAGS_DEF = -std=gnu99 +CFLAGS_DEF += -pipe ifeq ($(DEBUG), 1) - CFLAGS_DEF += -g CFLAGS_DEF += -O2 + CFLAGS_DEF += -g else + ifeq ($(DISTRO), 1) + CFLAGS_DEF += -O2 + else CFLAGS_DEF += -march=native CFLAGS_DEF += -mtune=native CFLAGS_DEF += -O3 - CFLAGS_DEF += -pipe - CFLAGS_DEF += -fomit-frame-pointer + endif endif - ifeq ($(HARDENING), 1) CFLAGS_DEF += -fPIE -pie CFLAGS_DEF += -Wl,-z,relro,-z,now @@ -62,6 +64,7 @@ ifeq ($(HARDENING), 1) CFLAGS_DEF += -fexceptions endif +CFLAGS_DEF += -fomit-frame-pointer CFLAGS_DEF += -fno-strict-aliasing CFLAGS_DEF += -fasynchronous-unwind-tables CFLAGS_DEF += -fno-delete-null-pointer-checks @@ -340,7 +343,7 @@ help: $(Q)echo " nacl - Execute the build_nacl script" $(Q)echo " help - Show this help" $(Q)echo "$(bold)Available parameters:$(normal)" - $(Q)echo " DEBUG=1 - Enable debugging" + $(Q)echo " DEBUG=1 / DISTRO=1 - Enable debugging / Build for distros" $(Q)echo " HARDENING=1 - Enable GCC hardening of executables" $(Q)echo " PREFIX=/path - Install path prefix" $(Q)echo " CROSS_COMPILE=/path-prefix - Kernel-like cross-compiling prefix" -- cgit v1.2.3-54-g00ecf