Scicos: fix some memleaks on simulation run
[scilab.git] / scilab / Makefile.am
1 #
2 # Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 # Copyright (C) INRIA - 2006-2008 - Sylvestre Ledru
4 # Copyright (C) DIGITEO - 2009 - Sylvestre Ledru
5 #
6 # Copyright (C) 2012 - 2016 - Scilab Enterprises
7 #
8 # This file is hereby licensed under the terms of the GNU GPL v2.0,
9 # pursuant to article 5.3.4 of the CeCILL v.2.1.
10 # This file was originally licensed under the terms of the CeCILL v2.1,
11 # and continues to be available under such terms.
12 # For more information, see the COPYING file which you should have received
13 # along with this program.
14 #
15
16 ## Process this file with automake to produce Makefile.in (which will be changed by the ./configure)
17
18 AUTOMAKE_OPTIONS = 1.11 dist-zip dist-bzip2
19
20 SUBDIRS= modules \
21         contrib \
22         desktop
23
24 ACLOCAL_AMFLAGS = -I m4
25
26 # Set AM_* SCI detected settings
27 AM_CPPFLAGS = $(SCI_CPPFLAGS)
28 AM_CFLAGS   = $(SCI_CFLAGS)
29 AM_CXXFLAGS = $(SCI_CXXFLAGS)
30 AM_FFLAGS   = $(SCI_FFLAGS)
31 AM_LDFLAGS  = $(SCI_LDFLAGS)
32
33 bin_PROGRAMS            = scilab-bin scilab-cli-bin
34
35 bin_SCRIPTS                     = bin/scilab bin/scilab-adv-cli bin/scilab-cli \
36 bin/scinotes bin/xcos
37
38 if IS_MACOSX
39 bin_SCRIPTS             += bin/checkmacosx.applescript
40 endif
41
42 scilab_bin_LDFLAGS      = $(AM_LDFLAGS) $(OPENMPI_LIBS)
43 scilab_cli_bin_LDFLAGS  = $(AM_LDFLAGS) $(OPENMPI_LIBS)
44
45 #
46 # using the static system libs might produce linkage issue (eg.
47 # std::nothrow for instance) but it seems to be the only acceptable
48 # solution for now.
49 #
50 if USE_STATIC_SYSTEM_LIB
51 scilab_bin_LDFLAGS += -static-libstdc++ -static-libgcc -static-libgfortran
52 scilab_cli_bin_LDFLAGS += -static-libstdc++ -static-libgcc -static-libgfortran
53 else
54 # Clang (for example) needs an explicit reference to the lib
55 scilab_bin_LDFLAGS += -lstdc++ -lgfortran
56 scilab_cli_bin_LDFLAGS += -lstdc++ -lgfortran
57 endif
58
59
60 if IS_MACOSX
61 scilab_bin_LDFLAGS              += -framework Cocoa
62 endif
63
64 scilab_bin_CPPFLAGS = \
65     -I$(top_srcdir)/modules/ast/includes/ast/ \
66     -I$(top_srcdir)/modules/ast/includes/exps/ \
67     -I$(top_srcdir)/modules/ast/includes/operations/ \
68     -I$(top_srcdir)/modules/ast/includes/parse/ \
69     -I$(top_srcdir)/modules/ast/includes/symbol/ \
70     -I$(top_srcdir)/modules/ast/includes/system_env/ \
71     -I$(top_srcdir)/modules/ast/includes/types/ \
72     -I$(top_srcdir)/modules/ast/includes/analysis/ \
73     -I$(top_srcdir)/modules/console/includes/ \
74     -I$(top_srcdir)/modules/output_stream/includes/ \
75     -I$(top_srcdir)/modules/functions_manager/includes/ \
76     -I$(top_srcdir)/modules/elementary_functions/includes/ \
77     -I$(top_srcdir)/modules/fileio/includes/ \
78     -I$(top_srcdir)/modules/string/includes/ \
79     -I$(top_srcdir)/modules/history_manager/includes/ \
80     -I$(top_srcdir)/modules/threads/includes/ \
81     -I$(top_srcdir)/modules/api_scilab/includes/ \
82     -I$(top_srcdir)/modules/localization/includes/ \
83     -I$(top_srcdir)/modules/core/src/c/ \
84     -I$(top_srcdir)/modules/dynamic_link/includes/ \
85     -I$(top_srcdir)/modules/startup/src/c/ \
86     $(AM_CPPFLAGS)
87
88 # --no-undefined --relax
89
90 # Localization dep already exists because of the `exportLocaleToSystem' symbol
91 # (causing issues on some platform)
92 COMMON_LIBS = $(LTLIBINTL)
93
94 # Link against valgrind library as on some systems (eg. Fedora) it should be
95 # link on the final binary
96 COMMON_LIBS += $(VALGRIND_LIBS)
97
98 scilab_bin_SOURCES = modules/startup/src/cpp/scilab.cpp
99
100 # the scilab-bin object file itself uses symbols from at least libscilab-cli.la,
101 # libsciconsole-minimal.la and libscijvm-disable.la, so we have to link with these
102 # libraries explicitly unless we link with -Wl,--copy-dt-needed-entries
103 scilab_bin_LDADD        = \
104                         $(top_builddir)/modules/libscilab.la \
105                         $(top_builddir)/modules/libscilab-cli.la \
106                         $(OPENMPI_LIBS) $(XML_LIBS) \
107                         $(COMMON_LIBS) $(FLIBS)
108
109 if NEED_JAVA
110 scilab_bin_LDADD += \
111                         $(top_builddir)/modules/console/libsciconsole.la \
112                         $(top_builddir)/modules/jvm/libscijvm.la \
113                         $(top_builddir)/modules/commons/libscicommons.la
114 else
115 scilab_bin_LDADD += \
116                         $(top_builddir)/modules/console/libsciconsole-minimal.la \
117                         $(top_builddir)/modules/jvm/libscijvm-disable.la
118 endif
119
120 # BLAS_LIBS & LAPACK_LIBS are explicitly linked at the end. Unlike Scilab 5 in which the binary
121 # is in C, Scilab 6 main is in C++. For some reasons (ie, I don't know why), libtool places blas and
122 # lapack at the beginning of the order of the link. This caused some issues with the overload of the
123 # xerbla function
124 scilab_bin_LDADD += $(top_builddir)/modules/libscilab.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
125
126 # Match scilab -nwni (ie command line without graphics)
127
128 scilab_cli_bin_SOURCES  = modules/startup/src/cpp/scilab.cpp
129
130 scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
131
132 # See the comment about scilab_bin_LDADD (relative to BLAS_LIBS & LAPACK_LIBS)
133 scilab_cli_bin_LDADD    = $(COMMON_LIBS) $(top_builddir)/modules/libscilab-cli.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
134
135 if MPI
136 CXX = $(OPENMPI_CXX)
137 scilab_bin_SOURCES += modules/startup/src/c/initMPI.c
138 scilab_bin_CPPFLAGS += $(OPENMPI_CXXFLAGS)
139 scilab_cli_bin_SOURCES += modules/startup/src/c/initMPI.c
140 scilab_cli_bin_CPPFLAGS += $(OPENMPI_CXXFLAGS)
141 endif
142
143
144 if NEED_JAVA
145 # Don't do it for scilab_cli_bin. We want to be able to call it without
146 # the java libs
147         scilab_bin_LDADD += $(JAVA_JNI_LIBS)
148 endif
149
150 if IS_SOLARIS
151 # The binary itself needs this dep
152         scilab_bin_LDADD += $(BLAS_LIBS)
153 endif
154
155 LANG_DOMAIN=scilab
156
157 TARGETS_ALL=macros
158
159 #  The user wants to compile the localization files
160 if GENERATE_LOCALIZATION_FILES
161 TARGETS_ALL+=localization
162 endif
163
164 if COMPILATION_TESTS
165 TARGETS_ALL+=check-java
166 endif
167
168 # check is performed with scilab, so use the serial-tests on purpose
169 TESTS_ENVIRONMENT = LANG=C HOME=/tmp $(top_builddir)/bin/scilab-cli -nb -noatomsautoload -nouserstartup -f
170 TESTS = $(top_builddir)/modules/development_tools/tests/unit_tests/test_run_level_1.tst
171
172 all-local: $(TARGETS_ALL)
173
174 rootdir=$(pkgdatadir)/etc/
175 root_DATA = $(top_srcdir)/etc/scilab.start \
176 $(top_srcdir)/etc/scilab.quit \
177 $(top_srcdir)/etc/toolboxes.xml \
178 $(top_builddir)/etc/jvm_options.xml \
179 $(top_builddir)/etc/modules.xml \
180 $(top_builddir)/etc/classpath.xml \
181 $(top_builddir)/etc/logging.properties \
182 $(top_builddir)/etc/librarypath.xml
183
184 infofilesdir=$(pkgdatadir)/
185 infofiles_DATA = $(top_srcdir)/CHANGES.md \
186 $(top_srcdir)/ACKNOWLEDGEMENTS \
187 $(top_srcdir)/COPYING \
188 $(top_srcdir)/COPYING-BSD \
189 $(top_srcdir)/README.md \
190 $(top_builddir)/Version.incl
191
192 valgrinddir=$(pkgdatadir)/tools/profiling
193 valgrind_DATA = $(top_srcdir)/tools/profiling/valgrind.supp
194
195 macros: $(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli check-jvm-dep check-libstdcpp-dep
196         -@( cd $(top_builddir) ; \
197         echo "$(top_builddir)/bin/scilab-cli -ns -noatomsautoload -nouserstartup -quit -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
198         HOME=/tmp $(top_builddir)/bin/scilab-cli -ns -noatomsautoload -nouserstartup -quit -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
199
200 strip-debug:
201         find $(top_builddir) -name '*.so.?.?.?' | while read file ; \
202         do \
203             if [ ! -f $$file.debug ]; then \
204                 objcopy --only-keep-debug $$file $$file.debug; \
205                 objcopy --strip-debug $$file; \
206                 objcopy --add-gnu-debuglink=$$file.debug $$file; \
207             fi \
208         done;
209
210 check-jvm-dep:
211 # Check that scilab-cli does not have a dependency on libjvm
212 if !IS_MACOSX
213         @ldd .libs/scilab-cli-bin|grep libjvm > /dev/null; \
214         if test $$? == 0; then \
215                 echo "Found dependency from scilab-cli-bin to libjvm found"; exit 2;\
216         fi
217 endif
218
219
220 check-libstdcpp-dep:
221 if USE_STATIC_SYSTEM_LIB
222 # Check that scilab-cli does not have a dependency on libstdc++ (should be static)
223         @ldd .libs/scilab-bin .libs/scilab-cli-bin modules/.libs/libscilab*0 |grep libstdc++ > /dev/null; \
224         if test $$? == 0; then \
225                 echo "Found dependency from scilab-cli-bin to libstdc++ found"; exit 2;\
226         fi
227 else
228         echo "libstdc++ presence test skipped"
229 endif
230
231 # Build the public Javadoc (javasci v2 and Java/Scilab types)
232 # This is not done in the module itself because its needs also the "types"
233 # module
234 javadoc:
235         $(JAVADOC) -noindex -nohelp -nonavbar -notree \
236         -d $(top_builddir)/modules/javasci/javadoc \
237         -sourcepath $(top_srcdir)/modules/javasci/src/java:$(top_srcdir)/modules/types/src/java::$(top_srcdir)/modules/localization/src/java \
238         org.scilab.modules.javasci org.scilab.modules.types
239
240 javadoc-all:
241         MASK="$(top_srcdir)/modules/*/src/java/"; \
242         MODULES=`ls -d $$MASK`; \
243         for M in $$MODULES; do \
244                 LISTMODULES="$$M:$$LISTMODULES"; \
245                 MODULE=$$(echo $$M|cut -d/ -f3); \
246                 LISTPKG="$$LISTPKG org.scilab.modules.$$MODULE"; \
247         done; \
248         $(JAVADOC) \
249         -d $(top_builddir)/javadocall \
250         -sourcepath $$LISTMODULES \
251         $$LISTPKG
252
253 doc-fr_FR:
254         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=fr_FR
255
256 doc-en_US:
257         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=en_US
258
259 doc-pt_BR:
260         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=pt_BR
261
262 doc-ru_RU:
263         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=ru_RU
264
265 doc-ja_JP:
266         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=ja_JP
267
268 # Regenerate all images
269 doc-images:
270         rm -rf $(top_srcdir)/modules/helptools/images/
271         mkdir $(top_srcdir)/modules/helptools/images/
272         $(MAKE) doc
273
274 doc: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
275 if BUILD_HELP
276         @if test -x $(top_builddir)/scilab-bin; then \
277                 cd $(top_builddir);\
278                 for l in $(ALL_LINGUAS_DOC); do \
279                         echo "-- Building documentation ($$l) --"; \
280                         COMMAND="try xmltojar([],[],'$$l');catch disp(lasterror()); exit(-1);end;exit(0);"; \
281                         echo "LANG=$$l.UTF-8 LC_ALL=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 _JAVA_OPTIONS='-Djava.awt.headless=true' HOME=/tmp $(top_builddir)/bin/scilab-adv-cli -noatomsautoload -nb -l $$l -nouserstartup -e \"$$COMMAND\"";\
282                         LANG=$$l.UTF-8 LC_ALL=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 _JAVA_OPTIONS='-Djava.awt.headless=true' HOME=/tmp $(top_builddir)/bin/scilab-adv-cli -noatomsautoload -nb -l $$l -nouserstartup -e "$$COMMAND" || exit 1;\
283                 done; \
284         else \
285                 echo "Cannot find Scilab-adv-cli binary"; \
286         fi
287 else
288         @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
289 endif
290
291 doc-web: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
292 if BUILD_HELP
293         @if test -x $(top_builddir)/scilab-bin; then \
294                 cd $(top_builddir);\
295                 for l in $(ALL_LINGUAS_DOC); do \
296                         echo "-- Building documentation ($$l) --"; \
297                         COMMAND="try xmltoweb([],[],'$$l');catch exit(-1);end;exit(0);";\
298                         echo "LANG=$$l.UTF-8 SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 HOME=/tmp $(top_builddir)/bin/scilab-adv-cli -nb -l $$l -noatomsautoload -nouserstartup -e \"$$COMMAND\"";\
299                         LANG=$$l.UTF-8 SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 HOME=/tmp $(top_builddir)/bin/scilab-adv-cli -nb -l $$l -noatomsautoload -nouserstartup -e "$$COMMAND" || exit 1;\
300                         JAVADOC_TARGET=$(top_builddir)/modules/helptools/web/$$l/javasci; \
301                         if test ! -d $$JAVADOC_TARGET; then \
302                                 mkdir $$JAVADOC_TARGET; \
303                                 ln -s ../../../../javasci/javadoc/ $$JAVADOC_TARGET/; \
304                         fi; \
305                 done; \
306         else \
307                 echo "Cannot find Scilab-adv-cli binary"; \
308         fi
309 else
310         @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
311 endif
312
313 $(top_builddir)/modules/helptools/data/pages/CHANGES.html: $(top_builddir)/CHANGES.md
314         sed -n '1,/html rendered CHANGES.md/{p;}' $@ >$@~
315         cmark $< >>$@~
316         sed -n '/End of the html rendered CHANGES.md/,$${p;}' $@ >>$@~
317         mv $@~ $@
318
319 doxygen: modules/development_tools/etc/doxyfile
320 if DOXYGEN
321         mkdir $(top_builddir)/reports/
322         $(DOXYGEN_BIN) modules/development_tools/etc/doxyfile
323 endif
324
325 check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
326         @if test -x $(top_builddir)/scilab-cli-bin; then \
327                 for l in $(ALL_LINGUAS_DOC); do \
328                         echo "-- Checking documentation ($$l) --"; \
329                         COMMAND="try check_help();catch exit(-1);end;exit(0);";\
330                         echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -nouserstartup -e \"$$COMMAND\"";\
331                         HOME=/tmp $(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -nouserstartup -e "$$COMMAND" || exit 1;\
332                 done; \
333         else \
334                 echo "Cannot find Scilab binary"; \
335         fi
336
337 code-coverage:
338 if CODE_COVERAGE
339         @if test ! -d $(top_builddir)/coverage/; then \
340                 mkdir $(top_builddir)/coverage/; \
341         fi; \
342         $(LCOV) --directory $(top_builddir) --capture --ignore-errors source --output-file $(top_builddir)/coverage/scilab-code-coverage.info; \
343         if test ! -f ~/.lcovrc; then echo -e "genhtml_hi_limit = 85\ngenhtml_med_limit = 70" > ~/.lcovrc; fi; \
344         $(GENHTML) -o $(top_builddir)/coverage/results/ --show-details --highlight --legend $(top_builddir)/coverage/scilab-code-coverage.info; \
345         rm -f $(top_builddir)/coverage/lcovrc; \
346         echo "To open the result: firefox  $(top_builddir)/coverage/results/index.html";
347 #--frames is disable because of : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607206
348 else
349         @echo "Cannot start the code coverage. Add --enable-code-coverage to the ./configure and 'make clean all'."
350 endif
351
352 distclean-recursive: distclean-generated clean-recursive
353
354 clean-recursive: clean-help clean-localization clean-macros clean-generated
355
356 clean-macros:
357 # Find is necessary because of subdirs...
358         -@echo "-- Cleaning macros (*.bin) --"; \
359         find $(top_builddir) -name "*.bin" | xargs --no-run-if-empty rm 2> /dev/null; \
360         echo "-- Cleaning lib files (lib) --"; \
361         find $(top_builddir)/modules/*/macros -name "lib" | xargs --no-run-if-empty rm 2> /dev/null
362
363 # To ensure previous compatibility
364 clean-doc: clean-help
365
366 clean-help:
367         -@if test -x $(top_builddir)/scilab-cli-bin; then \
368                 COMMAND="try clean_help();catch exit(-1);end;exit(0)"; \
369                 for l in $(ALL_LINGUAS_DOC); do \
370                         echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -nouserstartup -e '$$COMMAND'"; \
371                         HOME=/tmp $(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -nouserstartup -e "$$COMMAND" || exit 1; \
372                 done; \
373         else \
374                 echo "Cannot find Scilab binary"; \
375         fi; \
376         echo "rmdir $(top_builddir)/modules/helptools/javaHelp/"; \
377         rm -rf $(top_builddir)/modules/helptools/javaHelp/; \
378         echo "rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help"; \
379         rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help; \
380         echo "rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml"; \
381         rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml; \
382         echo "rm -f $(top_builddir)/modules/scicos/jar/"; \
383         rm -rf $(top_builddir)/modules/scicos/jar/; \
384         echo "rm -rf $(top_builddir)/modules/javasci/javadoc"; \
385         rm -rf $(top_builddir)/modules/javasci/javadoc; \
386         echo "rm -rf $(top_builddir)/html"; \
387         rm -rf $(top_builddir)/html;
388
389 clean-tests:
390         @if test -x $(top_builddir)/scilab-cli-bin; then \
391                 HOME=/tmp $(top_builddir)/bin/scilab-cli -nb -noatomsautoload -nouserstartup -l fr -e 'try test_clean();catch exit(-1);end;exit(0);' || exit 1; \
392         else \
393                 echo "Cannot find Scilab binary"; \
394         fi
395
396 clean-localization:
397         rm -rf $(top_srcdir)/locale/*
398
399 clean-generated:
400 # Deleted junit + code coverage
401         rm -rf $(top_builddir)/reports/
402         rm -rf $(top_builddir)/modules/scicos_blocks/build/ 2> /dev/null
403
404 distclean-generated:
405         rm -f $(top_builddir)/modules/core/includes/stack.h 2> /dev/null
406
407
408 if IS_MACOSX
409 # Used for mac os x because it needs to remove the charset=UTF-8 because it is breaking the accents.
410 MACOSX=1
411 endif
412
413 clean-reports:
414         rm -f reports/xml/TEST-org.scilab.*.xml
415
416 # For each module, build and call Java unitary tests
417 # If fails, stops the call
418 check-java: clean-reports
419         @echo "-- Launch all Junit (Java) unitary tests"; \
420         MASK="$(top_srcdir)/modules/*/tests/java/"; \
421         MODULES=`ls -d $$MASK`; \
422         for M in $$MODULES; do \
423                 BASE=`echo $$M|sed -e "s|tests/java/$$||g"`; \
424                 $(ANT) -buildfile $$BASE/build.xml test || exit $$?; \
425         done
426         rm -f reports/xml/TEST-org.scilab.*.xml
427
428 codecoverage-java: clean-reports
429         @echo "Check if --enable-debug-java has been set"; \
430         grep "build.debug=on" $(top_srcdir)/scilab.properties > /dev/null || exit 10; \
431         echo "-- Launch all Junit (Java) unitary tests + code coverage"; \
432         MASK="$(top_srcdir)/modules/*/tests/java/"; \
433         MODULES=`ls -d $$MASK`; \
434         for M in $$MODULES; do \
435                 BASE=`echo $$M|sed -e "s|tests/java/$$||g"`; \
436                 $(ANT) -buildfile $$BASE/build.xml codecoverage || exit $$?; \
437         done
438         rm -f reports/xml/TEST-org.scilab.*.xml
439
440 # The user wants to compile the localization files
441 # Please note that ALL_LINGUAS is defined in configure.ac
442 if GENERATE_LOCALIZATION_FILES
443 localization:
444         @echo "-- Build localization (.mo from .po) --"; \
445         MASK="modules/*/locales/"; \
446         LC="LC_MESSAGES"; \
447         MSGFMT_OPTS="$MSGFMT_OPTS --check"; \
448         EXTENSION="*.po"; \
449         rm modules/*/locales/*~ 2> /dev/null; \
450         for LOCALE in $(ALL_LINGUAS); do \
451                 echo "        -- Building for $$LOCALE --"; \
452                 if test "$$LOCALE" == "en_US"; then \
453                         LOCFILE=$$MASK/*.pot; \
454                 else \
455                         LOCFILE=$$MASK/$$LOCALE$$EXTENSION; \
456                 fi; \
457                 FILES=`ls $$LOCFILE`; \
458                 PATHTO=$(top_builddir)/locale/$$LOCALE/$$LC/; \
459                 if test ! -d $$PATHTO; then \
460                         echo "        Creating $$PATHTO"; \
461                         mkdir -p $$PATHTO; \
462                 fi; \
463                 POFILE=$$PATHTO/$(LANG_DOMAIN).po; \
464                 $(MSGCAT) --use-first -o $$POFILE $$FILES || exit 2; \
465                 if test "$(MACOSX)" = "1"; then sed -i -e '/charset=UTF-8/d' $$POFILE; fi; \
466                 $(MSGFMT) $(MSGFMT_OPTS) --statistics -o $$PATHTO/$(LANG_DOMAIN).mo $$POFILE || exit 2; \
467         done;
468
469
470 localization-status:
471         @for LOCALE in $(ALL_LINGUAS_DOC); do \
472                 if test "$$LOCALE" != "en_US"; then \
473                         PATHTO=$(top_builddir)/locale-status/$$LOCALE/; \
474                         if test ! -d $$PATHTO; then \
475                                 echo "        Creating $$PATHTO"; \
476                                 mkdir -p $$PATHTO; \
477                         fi; \
478                         echo "Building status for $$LOCALE"; \
479                         echo "SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html"; \
480                         SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html; \
481                 fi; \
482         done;
483
484 endif
485
486 # Misc variable for the documentation installation
487
488 # How help files look like.
489 DOCMASK=scilab_*_help.jar
490 DOCIMAGES=scilab_images.jar
491
492 # Path to built files
493 PATHTOHELPFILES = modules/helptools/jar/
494
495 # Path to scirenderer jar
496 PATHTOSCIRENDERER = modules/scirenderer/jar/
497 SCIRENDERERJAR = scirenderer.jar
498
499 # Path javasci to built files
500 PATHTOJAVASCIDOC = modules/javasci/javadoc/
501 JAVASCI_DIRS = . resources \
502         org/scilab/modules/javasci/ \
503         org/scilab/modules/types/
504
505 install-data-local:
506 if GENERATE_LOCALIZATION_FILES
507         @$(mkinstalldirs) $(DESTDIR)$(localedir); \
508         echo $(mkinstalldirs) $(DESTDIR)$(localedir); \
509         for lang in $(ALL_LINGUAS); do \
510                 LANG_PATH_DIST=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/; \
511                 echo $(mkinstalldirs) $$LANG_PATH_DIST; \
512                 $(mkinstalldirs) $$LANG_PATH_DIST; \
513                 echo $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
514                 $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
515         done
516 endif
517 ################ INSTALL DOCUMENTATION #################
518 # Starting from Scilab 5, documentation file are provided by Docbook
519 # In the Scilab application we are generating a JavaHelp file.
520 if BUILD_HELP
521         @$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
522         echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
523         if ls -lLd $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK) >/dev/null 2>&1; then \
524                 for file in $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK) $(top_builddir)/$(PATHTOHELPFILES)/$(DOCIMAGES); do \
525                     echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES)" ; \
526                 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES) ; \
527                 done; \
528         fi
529 ## Install Javasci documentation (javadoc)
530 ## See target javadoc in this file to see how it is build
531         @if test -d $(PATHTOJAVASCIDOC); then \
532         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
533         echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
534         for dir in $(JAVASCI_DIRS) ; do \
535                 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
536                 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
537                         for file in $(top_builddir)/$(PATHTOJAVASCIDOC)/$(dir)/*; do \
538                             echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir" ; \
539                                 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir ; \
540                         done; \
541         done; \
542         fi
543 endif
544 if !EXTERNAL_SCIRENDERER
545 if GUI
546 # Also install scirenderer.jar
547         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)
548         $(INSTALL_DATA) $(top_builddir)/$(PATHTOSCIRENDERER)/$(SCIRENDERERJAR) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)/
549 endif
550 endif
551
552 # Pkgconfig directory
553 pkgconfigdir = $(libdir)/pkgconfig
554
555 # Files to install in Pkgconfig directory
556 pkgconfig_DATA = scilab.pc
557
558 .PHONY: macros localization doc strip-debug
559
560 .NOTPARALLEL: macros doc
561
562 include $(top_srcdir)/Makefile.call_scilab.am