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