git » nmdb » commit 130ba0a

Improve Makefile for profiling and profile-driven optimization

author Alberto Bertogli
2008-07-26 22:26:02 UTC
committer Alberto Bertogli
2008-07-26 22:26:02 UTC
parent 85fc52bea0d238a404873d6f034958015ab71142

Improve Makefile for profiling and profile-driven optimization

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

nmdb/Makefile +13 -4

diff --git a/nmdb/Makefile b/nmdb/Makefile
index f9d3265..098da97 100644
--- a/nmdb/Makefile
+++ b/nmdb/Makefile
@@ -20,7 +20,11 @@ ALL_CFLAGS += -g
 endif
 
 ifdef PROFILE
-ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
+ALL_CFLAGS += -g -pg -ftest-coverage -fprofile-generate
+endif
+
+ifdef PROFILE_USE
+ALL_CFLAGS += -fprofile-use
 endif
 
 
@@ -102,10 +106,15 @@ install-man:
 
 install: install-bin install-man
 
-clean:
+clean: clean-build clean-prof
+
+clean-build:
 	rm -f $(OBJS) nmdb
-	rm -f *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out
 
-.PHONY: default all clean install-bin install-man install
+clean-prof:
+	rm -f *.bb *.bbg *.da *.gcov *.gcda *.gcno gmon.out
 
+.PHONY: default all \
+	install-bin install-man install \
+	clean-build clean-prof clean