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