From c609003c95aea649a2c39405ec0c54b495836fc9 Mon Sep 17 00:00:00 2001 From: c9s Date: Sat, 21 Nov 2015 10:39:49 +0800 Subject: [PATCH] optimize c flags for development/production mode --- Makefile.am | 8 +++++++- src/Makefile.am | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 59d6e54..b6878a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,8 @@ -SUBDIRS=3rdparty src . tests examples +SUBDIRS=3rdparty src . examples + +if HAVE_CHECK +SUBDIRS += tests +endif lib_LTLIBRARIES = libr3.la libr3_la_SOURCES = @@ -13,6 +17,8 @@ ACLOCAL_AMFLAGS=-I m4 if ENABLE_DEBUG AM_CFLAGS += -ggdb -fprofile-arcs -ftest-coverage +else +AM_CFLAGS += -O2 endif if USE_JEMALLOC diff --git a/src/Makefile.am b/src/Makefile.am index b39a746..31a3aed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) $(JSONC_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/3rdparty -Wall -std=c99 -O2 +AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) $(JSONC_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/3rdparty -Wall -std=c99 AM_LDFLAGS=$(DEPS_LIBS) $(GVC_DEPS_LIBS) $(JSONC_LIBS) MAYBE_COVERAGE=--coverage