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