be09efaf7a20cd4860b993e28a745719109a61bd
[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     $(EIGEN_CPPFLAGS) \
84     $(AM_CPPFLAGS)
85
86 # --no-undefined --relax
87
88 # Localization dep already exists because of the `exportLocaleToSystem' symbol
89 # (causing issues on some platform)
90 COMMON_LIBS = $(LTLIBINTL)
91
92 scilab_bin_SOURCES = modules/startup/src/cpp/scilab.cpp
93
94 # the scilab-bin object file itself uses symbols from at least libscilab-cli.la,
95 # libsciconsole-minimal.la and libscijvm-disable.la, so we have to link with these
96 # libraries explicitly unless we link with -Wl,--copy-dt-needed-entries
97 scilab_bin_LDADD        = \
98                         $(top_builddir)/modules/libscilab.la \
99                         $(top_builddir)/modules/libscilab-cli.la \
100                         $(OPENMPI_LIBS) $(XML_LIBS) \
101                         $(COMMON_LIBS) $(FLIBS)
102
103 if NEED_JAVA
104 scilab_bin_LDADD += \
105                         $(top_builddir)/modules/console/libsciconsole.la \
106                         $(top_builddir)/modules/jvm/libscijvm.la \
107                         $(top_builddir)/modules/commons/libscicommons.la
108 else
109 scilab_bin_LDADD += \
110                         $(top_builddir)/modules/console/libsciconsole-minimal.la \
111                         $(top_builddir)/modules/jvm/libscijvm-disable.la
112 endif
113
114 # BLAS_LIBS & LAPACK_LIBS are explicitly linked at the end. Unlike Scilab 5 in which the binary
115 # is in C, Scilab 6 main is in C++. For some reasons (ie, I don't know why), libtool places blas and
116 # lapack at the beginning of the order of the link. This caused some issues with the overload of the
117 # xerbla function
118 scilab_bin_LDADD += $(top_builddir)/modules/libscilab.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
119
120 # Match scilab -nwni (ie command line without graphics)
121
122 scilab_cli_bin_SOURCES  = modules/startup/src/cpp/scilab.cpp
123
124 scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
125
126 # See the comment about scilab_bin_LDADD (relative to BLAS_LIBS & LAPACK_LIBS)
127 scilab_cli_bin_LDADD    = $(COMMON_LIBS) $(top_builddir)/modules/libscilab-cli.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
128
129 if MPI
130 CXX = $(OPENMPI_CXX)
131 scilab_bin_SOURCES += modules/startup/src/c/initMPI.c
132 scilab_bin_CPPFLAGS += $(OPENMPI_CXXFLAGS)
133 scilab_cli_bin_SOURCES += modules/startup/src/c/initMPI.c
134 scilab_cli_bin_CPPFLAGS += $(OPENMPI_CXXFLAGS)
135 endif
136
137
138 if NEED_JAVA
139 # Don't do it for scilab_cli_bin. We want to be able to call it without
140 # the java libs
141         scilab_bin_LDADD += $(JAVA_JNI_LIBS)
142 endif
143
144 if IS_SOLARIS
145 # The binary itself needs this dep
146         scilab_bin_LDADD += $(BLAS_LIBS)
147 endif
148
149 LANG_DOMAIN=scilab
150
151 TARGETS_ALL=macros
152
153 #  The user wants to compile the localization files
154 if GENERATE_LOCALIZATION_FILES
155 TARGETS_ALL+=localization
156 endif
157
158 if COMPILATION_TESTS
159 TARGETS_ALL+=check-java
160 endif
161
162 # check is performed with scilab, so use the serial-tests on purpose
163 TESTS_ENVIRONMENT = LANG=C $(top_builddir)/bin/scilab-cli -nb -noatomsautoload -f
164 TESTS = $(top_builddir)/modules/development_tools/tests/unit_tests/test_run_level_1.tst
165
166 all-local: $(TARGETS_ALL)
167
168 rootdir=$(pkgdatadir)/etc/
169 root_DATA = $(top_srcdir)/etc/scilab.start \
170 $(top_srcdir)/etc/scilab.quit \
171 $(top_srcdir)/etc/toolboxes.xml \
172 $(top_builddir)/etc/jvm_options.xml \
173 $(top_builddir)/etc/modules.xml \
174 $(top_builddir)/etc/classpath.xml \
175 $(top_builddir)/etc/logging.properties \
176 $(top_builddir)/etc/librarypath.xml
177
178 infofilesdir=$(pkgdatadir)/
179 infofiles_DATA = $(top_srcdir)/CHANGES_2.X \
180 $(top_srcdir)/CHANGES_3.X \
181 $(top_srcdir)/CHANGES_4.X \
182 $(top_srcdir)/CHANGES_5.0.X \
183 $(top_srcdir)/CHANGES_5.1.X \
184 $(top_srcdir)/CHANGES_5.2.X \
185 $(top_srcdir)/CHANGES_5.3.X \
186 $(top_srcdir)/CHANGES_5.4.X \
187 $(top_srcdir)/CHANGES_5.5.X \
188 $(top_srcdir)/CHANGES_6.0.X \
189 $(top_srcdir)/ACKNOWLEDGEMENTS \
190 $(top_srcdir)/COPYING \
191 $(top_srcdir)/COPYING-BSD \
192 $(top_srcdir)/COPYING-FR \
193 $(top_srcdir)/README_Unix \
194 $(top_srcdir)/RELEASE_NOTES_5.0.X \
195 $(top_srcdir)/RELEASE_NOTES_5.1.X \
196 $(top_srcdir)/RELEASE_NOTES_5.2.X \
197 $(top_srcdir)/RELEASE_NOTES_5.3.X \
198 $(top_srcdir)/Readme_Visual.txt \
199 $(top_srcdir)/README_Windows.txt \
200 $(top_builddir)/license.txt \
201 $(top_builddir)/Version.incl
202
203 valgrinddir=$(pkgdatadir)/tools/profiling
204 valgrind_DATA = $(top_srcdir)/tools/profiling/valgrind.supp
205
206 macros: $(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli check-jvm-dep check-libstdcpp-dep
207         -@( cd $(top_builddir) ; \
208         echo "$(top_builddir)/bin/scilab-cli -ns -noatomsautoload -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
209         $(top_builddir)/bin/scilab-cli -ns -noatomsautoload -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
210
211
212 check-jvm-dep:
213 # Check that scilab-cli does not have a dependency on libjvm
214 if !IS_MACOSX
215         @ldd .libs/scilab-cli-bin|grep libjvm > /dev/null; \
216         if test $$? == 0; then \
217                 echo "Found dependency from scilab-cli-bin to libjvm found"; exit 2;\
218         fi
219 endif
220
221
222 check-libstdcpp-dep:
223 if USE_STATIC_SYSTEM_LIB
224 # Check that scilab-cli does not have a dependency on libstdc++ (should be static)
225         @ldd .libs/scilab-bin .libs/scilab-cli-bin modules/.libs/libscilab*0 |grep libstdc++ > /dev/null; \
226         if test $$? == 0; then \
227                 echo "Found dependency from scilab-cli-bin to libstdc++ found"; exit 2;\
228         fi
229 else
230         echo "libstdc++ presence test skipped"
231 endif
232
233 # Build the public Javadoc (javasci v2 and Java/Scilab types)
234 # This is not done in the module itself because its needs also the "types"
235 # module
236 javadoc:
237         $(JAVADOC) -noindex -nohelp -nonavbar -notree \
238         -d $(top_builddir)/modules/javasci/javadoc \
239         -sourcepath $(top_srcdir)/modules/javasci/src/java:$(top_srcdir)/modules/types/src/java::$(top_srcdir)/modules/localization/src/java \
240         org.scilab.modules.javasci org.scilab.modules.types
241
242 javadoc-all:
243         MASK="$(top_srcdir)/modules/*/src/java/"; \
244         MODULES=`ls -d $$MASK`; \
245         for M in $$MODULES; do \
246                 LISTMODULES="$$M:$$LISTMODULES"; \
247                 MODULE=$$(echo $$M|cut -d/ -f3); \
248                 LISTPKG="$$LISTPKG org.scilab.modules.$$MODULE"; \
249         done; \
250         $(JAVADOC) \
251         -d $(top_builddir)/javadocall \
252         -sourcepath $$LISTMODULES \
253         $$LISTPKG
254
255 doc-fr_FR:
256         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=fr_FR
257
258 doc-en_US:
259         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=en_US
260
261 doc-pt_BR:
262         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=pt_BR
263
264 doc-ru_RU:
265         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=ru_RU
266
267 doc-ja_JP:
268         @$(MAKE) $(AM_MAKEFLAGS) doc ALL_LINGUAS_DOC=ja_JP
269
270 # Regenerate all images
271 doc-images:
272         rm -rf $(top_srcdir)/modules/helptools/images/
273         mkdir $(top_srcdir)/modules/helptools/images/
274         $(MAKE) doc
275
276 doc: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
277 if BUILD_HELP
278         @if test -x $(top_builddir)/scilab-bin; then \
279                 cd $(top_builddir);\
280                 for l in $(ALL_LINGUAS_DOC); do \
281                         echo "-- Building documentation ($$l) --"; \
282                         COMMAND="try xmltojar([],[],'$$l');catch disp(lasterror()); exit(-1);end;exit(0);"; \
283                         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\"";\
284                         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;\
285                 done; \
286         else \
287                 echo "Cannot find Scilab-adv-cli binary"; \
288         fi
289 else
290         @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
291 endif
292
293 doc-web: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
294 if BUILD_HELP
295         @if test -x $(top_builddir)/scilab-bin; then \
296                 cd $(top_builddir);\
297                 for l in $(ALL_LINGUAS_DOC); do \
298                         echo "-- Building documentation ($$l) --"; \
299                         COMMAND="try xmltoweb([],[],'$$l');catch exit(-1);end;exit(0);";\
300                         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\"";\
301                         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;\
302                         JAVADOC_TARGET=$(top_builddir)/modules/helptools/web/$$l/javasci; \
303                         if test ! -d $$JAVADOC_TARGET; then \
304                                 mkdir $$JAVADOC_TARGET; \
305                                 ln -s ../../../../javasci/javadoc/ $$JAVADOC_TARGET/; \
306                         fi; \
307                 done; \
308         else \
309                 echo "Cannot find Scilab-adv-cli binary"; \
310         fi
311 else
312         @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
313 endif
314
315 doxygen: modules/development_tools/etc/doxyfile
316 if DOXYGEN
317         mkdir $(top_builddir)/reports/
318         $(DOXYGEN_BIN) modules/development_tools/etc/doxyfile
319 endif
320
321 check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
322         @if test -x $(top_builddir)/scilab-cli-bin; then \
323                 for l in $(ALL_LINGUAS_DOC); do \
324                         echo "-- Checking documentation ($$l) --"; \
325                         COMMAND="try check_help();catch exit(-1);end;exit(0);";\
326                         echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -e \"$$COMMAND\"";\
327                         $(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -e "$$COMMAND" || exit 1;\
328                 done; \
329         else \
330                 echo "Cannot find Scilab binary"; \
331         fi
332
333 code-coverage:
334 if CODE_COVERAGE
335         @if test ! -d $(top_builddir)/coverage/; then \
336                 mkdir $(top_builddir)/coverage/; \
337         fi; \
338         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; \
339         $(LCOV) --directory $(top_builddir) --capture --ignore-errors source --output-file $(top_builddir)/coverage/scilab-code-coverage.info; \
340         if test ! -f ~/.lcovrc; then echo -e "genhtml_hi_limit = 85\ngenhtml_med_limit = 70" > ~/.lcovrc; fi; \
341         $(GENHTML) -o $(top_builddir)/coverage/results/ --show-details --highlight --legend $(top_builddir)/coverage/scilab-code-coverage.info; \
342         rm -f $(top_builddir)/coverage/lcovrc; \
343         echo "To open the result: firefox  $(top_builddir)/coverage/results/index.html"; \
344         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
345 #--frames is disable because of : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607206
346 else
347         @echo "Cannot start the code coverage. Add --enable-code-coverage to the ./configure and 'make clean all'."
348 endif
349
350 distclean-recursive: distclean-generated clean-recursive
351
352 clean-recursive: clean-help clean-localization clean-macros clean-generated
353
354 clean-macros:
355 # Find is necessary because of subdirs...
356         -@echo "-- Cleaning macros (*.bin) --"; \
357         find $(top_builddir) -name "*.bin" | xargs --no-run-if-empty rm 2> /dev/null; \
358         echo "-- Cleaning names files (names) --"; \
359         find $(top_builddir)/modules/*/macros -name "names" | 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 -e '$$COMMAND'"; \
371                         $(top_builddir)/bin/scilab-cli -nb -l $$l -noatomsautoload -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                 $(top_builddir)/bin/scilab-cli -nb -noatomsautoload -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 if GENERATE_LOCALIZATION_FILES
506 install-data-local:
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
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 # Also install scirenderer.jar
547         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)
548         $(INSTALL_DATA) $(top_builddir)/$(PATHTOSCIRENDERER)/$(SCIRENDERERJAR) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)/
549 endif
550
551 # Pkgconfig directory
552 pkgconfigdir = $(libdir)/pkgconfig
553
554 # Files to install in Pkgconfig directory
555 pkgconfig_DATA = scilab.pc
556
557 .PHONY: macros localization doc
558
559 .NOTPARALLEL: macros doc
560
561 include $(top_srcdir)/Makefile.call_scilab.am