Compilation: add `make strip-debug`
[scilab.git] / scilab / Makefile.in
index bd86289..fa3fcf5 100644 (file)
@@ -2136,6 +2136,16 @@ macros: $(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli check-jvm-
        echo "$(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
        $(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
 
+strip-debug:
+       find $(top_builddir) -name '*.so.?.?.?' | while read file ; \
+       do \
+           if [ ! -f $$file.debug ]; then \
+               objcopy --only-keep-debug $$file $$file.debug; \
+               objcopy --strip-debug $$file; \
+               objcopy --add-gnu-debuglink=$$file.debug $$file; \
+           fi \
+       done;
+
 check-jvm-dep:
 # Check that scilab-cli does not have a dependency on libjvm
 @IS_MACOSX_FALSE@      @ldd .libs/scilab-cli-bin|grep libjvm > /dev/null; \
@@ -2416,7 +2426,7 @@ install-data-local:
 @EXTERNAL_SCIRENDERER_FALSE@@GUI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)
 @EXTERNAL_SCIRENDERER_FALSE@@GUI_TRUE@ $(INSTALL_DATA) $(top_builddir)/$(PATHTOSCIRENDERER)/$(SCIRENDERERJAR) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)/
 
-.PHONY: macros localization doc
+.PHONY: macros localization doc strip-debug
 
 .NOTPARALLEL: macros doc