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