From 068861a927f204b4cbb9479d9c13697eeb802821 Mon Sep 17 00:00:00 2001 From: Zhang Xianyi Date: Fri, 10 Aug 2012 14:36:26 +0800 Subject: [PATCH] Refs #133. Users can set COMMON_OPT flag to control CFLAGS and FFLAGS. --- Makefile.rule | 15 ++++++--------- Makefile.system | 9 +++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile.rule b/Makefile.rule index 85abf584b0..b73f87d683 100644 --- a/Makefile.rule +++ b/Makefile.rule @@ -108,19 +108,16 @@ VERSION = 0.2.2 # The installation directory. # PREFIX = /opt/OpenBLAS -# Common Optimization Flag; -O2 is enough. -# DEBUG = 1 - -ifeq ($(DEBUG), 1) -COMMON_OPT += -g -# -DDEBUG -else -COMMON_OPT += -O2 -endif +# Common Optimization Flag; +# The default -O2 is enough. +# COMMON_OPT = -O2 # Profiling flags COMMON_PROF = -pg +# Build Debug version +# DEBUG = 1 + # # End of user configuration # diff --git a/Makefile.system b/Makefile.system index 63d3577a7a..b2180f30d6 100644 --- a/Makefile.system +++ b/Makefile.system @@ -687,6 +687,15 @@ AWK = awk REVISION = -r$(VERSION) MAJOR_VERSION = $(word 1,$(subst ., ,$(VERSION))) +ifeq ($(DEBUG), 1) +COMMON_OPT += -g +endif + +ifndef COMMON_OPT +COMMON_OPT = -O2 +endif + + CFLAGS = $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) PFLAGS = $(COMMON_OPT) $(CCOMMON_OPT) -I$(TOPDIR) -DPROFILE $(COMMON_PROF)