summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-05-29 20:12:10 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-05-29 20:12:10 +0200
commit4e407258b1080947556add7b2ece21422ceafbed (patch)
tree98c969c0cd8f701e6bcd0aa0999266ca710239b3
parentf9d5a908d3e80f8007c4fd64060a78abd4264aeb (diff)
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 <dborkman@redhat.com>
-rw-r--r--Makefile15
1 files changed, 9 insertions, 6 deletions
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="<flags>"
-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"