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