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