summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-11-29 14:24:54 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-11-29 17:25:14 +0100
commit6a6152a9a3d76f8ce26e4a9b5bd6479f31009ee7 (patch)
tree24bf75391e4e217813e51b922799c1c870963d31 /solenv
parent912ad68d34488f81753ab50ef7a892a3b20161b1 (diff)
moved findunusedcode to gbuild
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/extensions/post_BuildplTargets.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/solenv/gbuild/extensions/post_BuildplTargets.mk b/solenv/gbuild/extensions/post_BuildplTargets.mk
index 592f590a25bd..306d0ad91c0d 100644
--- a/solenv/gbuild/extensions/post_BuildplTargets.mk
+++ b/solenv/gbuild/extensions/post_BuildplTargets.mk
@@ -58,7 +58,7 @@ cd $(SRCDIR)/$(1) && unset MAKEFLAGS && $(SOLARENV)/bin/build.pl -P$(BUILD_NCPUS
$(eval gb_BuildplTarget_COMPLETEDTARGETS+=$(1))
endef
-.PHONY: smoketestoo_native instsetoo_native cross-build-toolset dev-install all build
+.PHONY: smoketestoo_native instsetoo_native cross-build-toolset dev-install all build findunusedcode
smoketestoo_native: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded $(if $(filter $(INPATH),$(INPATH_FOR_BUILD)),,cross_toolset) | instsetoo_native
$(call gb_BuildplTarget_command,$@,$(if $(filter instsetoo_native,$(gb_BuildplTarget_COMPLETEDTARGETS)),--from instsetoo_native,--all))
@@ -70,6 +70,27 @@ instsetoo_native: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded $(if $(filter $(
cross_toolset: $(WORKDIR)/bootstrap $(SRCDIR)/src.downloaded
source $(SRCDIR)/Env.Build.sh && $(call gb_BuildplTarget_command,$@,--all)
+# experimental callcatcher target
+# http://www.skynet.ie/~caolan/Packages/callcatcher.html
+findunusedcode:
+ @which callcatcher > /dev/null 2>&1 || \
+ (echo "callcatcher not installed" && false)
+ @mkdir -p $(SRCDIR)/solenv/callcatcher/bin && \
+ ln -sf $(SRCDIR)/solenv/$(INPATH)/bin/dmake \
+ $(SRCDIR)/solenv/callcatcher/bin/dmake && \
+ source <(sed -e s,$(INPATH),callcatcher,g $(SRCDIR)/Env.Host.sh) && \
+ source $(SRCDIR)/solenv/bin/callcatchEnv.Set.sh && \
+ $(call gb_BuildplTarget_command,instsetoo_native,--all)
+ @source <(sed -e s,$(INPATH),callcatcher,g $(SRCDIR)/Env.Host.sh) && \
+ callanalyse \
+ $(WORKDIR)/LinkTarget/*/* \
+ */$(OUTPATH)/bin/* \
+ */$(OUTPATH)/lib/* > unusedcode.all
+#because non-c++ symbols could be dlsymed lets make a list of class level
+#unused methods which don't require much effort to determine if they need
+#to be just removed, or put behind appropiate platform or debug level ifdefs
+ @grep ::.*\( unusedcode.all | grep -v ^cppu:: > unusedcode.easy
+
dev-install: smoketestoo_native
all: instsetoo_native