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