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