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