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