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
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
13 ## Process this file with automake to produce Makefile.in (which will be changed by the ./configure)
15 AUTOMAKE_OPTIONS = 1.11 dist-zip dist-bzip2
21 ACLOCAL_AMFLAGS = -I m4/
23 changelogs = CHANGES CHANGES_5.1.X CHANGES_5.2.X CHANGES_5.3.X CHANGES_5.4.X
25 bin_PROGRAMS = scilab-bin scilab-cli-bin
27 bin_SCRIPTS = bin/scilab bin/scilab-adv-cli bin/scilab-cli
30 bin_SCRIPTS += bin/checkmacosx.applescript
34 scilab_cli_bin_LDFLAGS =
37 scilab_bin_LDFLAGS += -framework Cocoa
40 scilab_bin_CFLAGS = -I$(top_srcdir)/modules/io/includes
41 # --no-undefined --relax
43 # Localization dep already exists because of the `exportLocaleToSystem' symbol
44 # (causing issues on some platform)
45 COMMON_LIBS = $(top_builddir)/modules/core/libscicore.la \
46 $(top_builddir)/modules/completion/libscicompletion.la \
47 $(top_builddir)/modules/localization/libscilocalization.la \
48 $(top_builddir)/modules/io/libsciio.la \
51 SCILAB_LIB=$(top_builddir)/modules/libscilab.la
52 SCILAB_CLI_LIB=$(top_builddir)/modules/libscilab-cli.la
55 scilab_bin_SOURCES = $(top_srcdir)/modules/console/src/c/others/mainscic.c
57 scilab_bin_LDADD = $(COMMON_LIBS) $(SCILAB_LIB)
59 # Match scilab -nwni (ie command line without graphics)
60 scilab_cli_bin_SOURCES = $(top_srcdir)/modules/console/src/c/others/mainscic.c
62 scilab_cli_bin_CFLAGS = -DWITHOUT_GUI -I$(top_srcdir)/modules/io/includes
63 scilab_cli_bin_LDADD = $(COMMON_LIBS) $(SCILAB_CLI_LIB)
67 # Don't do it for scilab_cli_bin. We want to be able to call it without
69 scilab_bin_LDADD += $(JAVA_JNI_LIBS)
73 # The binary itself needs this dep
74 scilab_bin_LDADD += $(BLAS_LIBS)
78 scilab_static_bin_LDFLAGS = -static -static-libgcc --start-group
79 scilab_static_bin_CFLAGS = -Wl,--start-group `$(CXX) -print-file-name=libstdc++.a`
82 bin_PROGRAMS += scilab-static-bin
83 scilab_static_bin_LDADD = $(top_builddir)/modules/libscilab.la
85 scilab_static_bin_SOURCES = $(scilab_bin_SOURCES)
92 # The user wants to compile the localization files
93 if GENERATE_LOCALIZATION_FILES
94 TARGETS_ALL+=localization
98 TARGETS_ALL+=check-java
101 all-local: $(TARGETS_ALL)
103 rootdir=$(pkgdatadir)/etc/
104 root_DATA = $(top_srcdir)/etc/scilab.start \
105 $(top_srcdir)/etc/scilab.quit \
106 $(top_srcdir)/etc/toolboxes.xml \
107 $(top_builddir)/etc/jvm_options.xml \
108 $(top_builddir)/etc/modules.xml \
109 $(top_builddir)/etc/classpath.xml \
110 $(top_builddir)/etc/logging.properties \
111 $(top_builddir)/etc/librarypath.xml
113 infofilesdir=$(pkgdatadir)/
114 infofiles_DATA = $(top_srcdir)/CHANGES_2.X \
115 $(top_srcdir)/CHANGES_3.X \
116 $(top_srcdir)/CHANGES_4.X \
117 $(top_srcdir)/CHANGES_5.0.X \
118 $(top_srcdir)/CHANGES_5.1.X \
119 $(top_srcdir)/CHANGES_5.2.X \
120 $(top_srcdir)/CHANGES_5.3.X \
121 $(top_srcdir)/CHANGES_5.4.X \
122 $(top_srcdir)/ACKNOWLEDGEMENTS \
123 $(top_srcdir)/COPYING \
124 $(top_srcdir)/COPYING-BSD \
125 $(top_srcdir)/COPYING-FR \
126 $(top_srcdir)/README_Unix \
127 $(top_srcdir)/RELEASE_NOTES_5.0.X \
128 $(top_srcdir)/RELEASE_NOTES_5.1.X \
129 $(top_srcdir)/RELEASE_NOTES_5.2.X \
130 $(top_srcdir)/RELEASE_NOTES_5.3.X \
131 $(top_srcdir)/Readme_Visual.txt \
132 $(top_srcdir)/README_Windows.txt \
133 $(top_builddir)/Version.incl
135 iconsdir=$(pkgdatadir)/desktop/
136 icons_DATA = $(top_srcdir)/desktop/scilab.png \
137 $(top_srcdir)/desktop/puffin_128.png \
138 $(top_srcdir)/desktop/puffin_256.png \
139 $(top_srcdir)/desktop/puffin_32.png \
140 $(top_srcdir)/desktop/puffin_48.png \
141 $(top_srcdir)/desktop/puffin.png \
142 $(top_srcdir)/desktop/puffin.icns \
143 $(top_srcdir)/desktop/scilab.xml \
144 $(top_srcdir)/desktop/scilab.icns
146 valgrinddir=$(pkgdatadir)/tools/profiling
147 valgrind_DATA = $(top_srcdir)/tools/profiling/valgrind.supp
150 # Note that here, it is datadir and NOT pkgdatadir
151 desktopdir = $(datadir)/applications
152 desktop_DATA = $(top_srcdir)/desktop/scilab-adv-cli.desktop \
153 $(top_srcdir)/desktop/scilab-cli.desktop \
154 $(top_srcdir)/desktop/scilab.desktop
156 macros:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
157 -@( cd $(top_builddir) ; \
158 echo "$(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
159 $(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
162 # Build the public Javadoc (javasci v2 and Java/Scilab types)
163 # This is not done in the module itself because its needs also the "types"
166 $(JAVADOC) -noindex -nohelp -nonavbar -notree \
167 -d $(top_builddir)/modules/javasci/javadoc \
168 -sourcepath $(top_srcdir)/modules/javasci/src/java:$(top_srcdir)/modules/types/src/java \
169 org.scilab.modules.javasci org.scilab.modules.types
171 doc: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
173 @if test -x $(top_builddir)/scilab-bin; then \
175 for l in $(ALL_LINGUAS_DOC); do \
176 echo "-- Building documentation ($$l) --"; \
177 COMMAND="try xmltojar([],[],'$$l');catch exit(-1);end;exit(0);"; \
178 echo "LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"$$COMMAND\"";\
179 LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -l $$l -nouserstartup -e "$$COMMAND" || exit 1;\
182 echo "Cannot find Scilab-adv-cli binary"; \
185 @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
188 doc-web:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
190 @if test -x $(top_builddir)/scilab-bin; then \
192 for l in $(ALL_LINGUAS_DOC); do \
193 echo "-- Building documentation ($$l) --"; \
194 COMMAND="try xmltoweb([],[],'$$l');catch exit(-1);end;exit(0);";\
195 echo "LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"$$COMMAND\"";\
196 LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -l $$l -nouserstartup -e "$$COMMAND" || exit 1;\
197 JAVADOC_TARGET=$(top_builddir)/modules/helptools/web/$$l/javasci; \
198 if test ! -d $$JAVADOC_TARGET; then \
199 mkdir $$JAVADOC_TARGET; \
200 ln -s ../../../../javasci/javadoc/ $$JAVADOC_TARGET/; \
204 echo "Cannot find Scilab-adv-cli binary"; \
207 @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
210 check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
211 @if test -x $(top_builddir)/scilab-cli-bin; then \
212 for l in $(ALL_LINGUAS_DOC); do \
213 echo "-- Checking documentation ($$l) --"; \
214 COMMAND="try check_help();catch exit(-1);end;exit(0);";\
215 echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -e \"$$COMMAND\"";\
216 $(top_builddir)/bin/scilab-cli -nb -l $$l -e "$$COMMAND" || exit 1;\
219 echo "Cannot find Scilab binary"; \
222 check-recursive: check-local
224 @if test -x $(top_builddir)/scilab-bin; then \
225 COMMAND="try test_run();catch exit(-1);end;exit(0)";\
227 $(top_builddir)/bin/scilab-adv-cli -nb -e "$$COMMAND"; \
229 echo "Cannot find Scilab binary"; \
234 @if test ! -d $(top_builddir)/coverage/; then \
235 mkdir $(top_builddir)/coverage/; \
237 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; \
238 $(LCOV) --directory $(top_builddir) --capture --ignore-errors source --output-file $(top_builddir)/coverage/scilab-code-coverage.info; \
239 $(GENHTML) -o $(top_builddir)/coverage/results/ --show-details --highlight --legend $(top_builddir)/coverage/scilab-code-coverage.info; \
240 echo "To open the result: firefox $(top_builddir)/coverage/results/index.html"; \
241 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
242 #--frames is disable because of : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607206
244 @echo "Cannot start the code coverage. Add --enable-code-coverage to the ./configure and 'make clean all'."
247 distclean-recursive: distclean-generated clean-recursive
249 clean-recursive: clean-help clean-localization clean-macros clean-generated
252 # Find is necessary because of subdirs...
253 -@echo "-- Cleaning macros (*.bin) --"; \
254 find $(top_builddir) -name "*.bin" | xargs --no-run-if-empty rm 2> /dev/null; \
255 echo "-- Cleaning names files (names) --"; \
256 find $(top_builddir)/modules/*/macros -name "names" | xargs --no-run-if-empty rm 2> /dev/null; \
257 echo "-- Cleaning lib files (lib) --"; \
258 find $(top_builddir)/modules/*/macros -name "lib" | xargs --no-run-if-empty rm 2> /dev/null
260 # To ensure previous compatibility
261 clean-doc: clean-help
264 -@if test -x $(top_builddir)/scilab-cli-bin; then \
265 COMMAND="try clean_help();catch exit(-1);end;exit(0)"; \
266 for l in $(ALL_LINGUAS_DOC); do \
267 echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -e '$$COMMAND'"; \
268 $(top_builddir)/bin/scilab-cli -nb -l $$l -e "$$COMMAND" || exit 1; \
271 echo "Cannot find Scilab binary"; \
273 echo "rmdir $(top_builddir)/modules/helptools/javaHelp/"; \
274 rm -rf $(top_builddir)/modules/helptools/javaHelp/; \
275 echo "rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help"; \
276 rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help; \
277 echo "rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml"; \
278 rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml; \
279 echo "rm -f $(top_builddir)/modules/scicos/jar/"; \
280 rm -rf $(top_builddir)/modules/scicos/jar/; \
281 echo "rm -rf $(top_builddir)/modules/javasci/javadoc"; \
282 rm -rf $(top_builddir)/modules/javasci/javadoc;
285 @if test -x $(top_builddir)/scilab-cli-bin; then \
286 $(top_builddir)/bin/scilab-cli -nb -l fr -e 'try test_clean();catch exit(-1);end;exit(0);' || exit 1; \
288 echo "Cannot find Scilab binary"; \
292 rm -rf $(top_srcdir)/locale/
295 rm -rf $(top_builddir)/modules/scicos_blocks/build/ 2> /dev/null
298 rm -f $(top_builddir)/modules/core/includes/stack.h 2> /dev/null
302 # Used for mac os x because it needs to remove the charset=UTF-8 because it is breaking the accents.
306 # For each module, build and call Java unitary tests
307 # If fails, stops the call
309 @echo "-- Launch all TestNG (Java) unitary tests"; \
310 MASK="$(top_srcdir)/modules/*/tests/java/"; \
311 MODULES=`ls -d $$MASK`; \
312 for M in $$MODULES; do \
313 BASE=`echo $$M|sed -e "s|tests/java/$$||g"`; \
314 $(ANT) -buildfile $$BASE/build.xml test || exit $$?; \
317 # The user wants to compile the localization files
318 # Please note that ALL_LINGUAS is defined in configure.ac
319 if GENERATE_LOCALIZATION_FILES
321 @echo "-- Build localization (.mo from .po) --"; \
322 MASK="modules/*/locales/"; \
324 MSGFMT_OPTS="$MSGFMT_OPTS --check"; \
326 rm modules/*/locales/*~ 2> /dev/null; \
327 for LOCALE in $(ALL_LINGUAS); do \
328 echo " -- Building for $$LOCALE --"; \
329 FILES=`ls $$MASK/$$LOCALE$$EXTENSION`; \
330 PATHTO=$(top_builddir)/locale/$$LOCALE/$$LC/; \
331 if test ! -d $$PATHTO; then \
332 echo " Creating $$PATHTO"; \
335 POFILE=$$PATHTO/$(LANG_DOMAIN).po; \
336 $(MSGCAT) --use-first -o $$POFILE $$FILES; \
337 if test "$(MACOSX)" = "1"; then sed -i -e '/charset=UTF-8/d' $$POFILE; fi; \
338 $(MSGFMT) $(MSGFMT_OPTS) --statistics -o $$PATHTO/$(LANG_DOMAIN).mo $$POFILE; \
343 @for LOCALE in $(ALL_LINGUAS_DOC); do \
344 PATHTO=$(top_builddir)/locale-status/$$LOCALE/; \
345 if test ! -d $$PATHTO; then \
346 echo " Creating $$PATHTO"; \
349 echo "Building status for $$LOCALE"; \
350 echo "SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html"; \
351 SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html; \
356 # Misc variable for the documentation installation
358 # How help files look like.
359 DOCMASK=scilab_*_help.jar
361 # Path to builded files
362 PATHTOHELPFILES = modules/helptools/jar/
364 # Path javasci to builded files
365 PATHTOJAVASCIDOC = modules/javasci/javadoc/
366 JAVASCI_DIRS = . resources \
367 org/scilab/modules/javasci/ \
368 org/scilab/modules/types/
370 if GENERATE_LOCALIZATION_FILES
372 @$(mkinstalldirs) $(DESTDIR)$(localedir); \
373 echo $(mkinstalldirs) $(DESTDIR)$(localedir); \
374 for lang in $(ALL_LINGUAS); do \
375 LANG_PATH_DIST=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/; \
376 echo $(mkinstalldirs) $$LANG_PATH_DIST; \
377 $(mkinstalldirs) $$LANG_PATH_DIST; \
378 echo $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
379 $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
383 ################ INSTALL DOCUMENTATION #################
384 # Starting from Scilab 5, documentation file are provided by Docbook
385 # In the Scilab application we are generating a JavaHelp file.
387 @$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
388 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
389 if ls -lLd $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK) >/dev/null 2>&1; then \
390 for file in $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK); do \
391 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES)" ; \
392 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES) ; \
395 ## Install Javasci documentation (javadoc)
396 ## See target javadoc in this file to see how it is build
397 @if test -d $(PATHTOJAVASCIDOC); then \
398 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
399 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
400 for dir in $(JAVASCI_DIRS) ; do \
401 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
402 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
403 for file in $(top_builddir)/$(PATHTOJAVASCIDOC)/$(dir)/*; do \
404 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir" ; \
405 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir ; \
411 # Pkgconfig directory
412 pkgconfigdir = $(libdir)/pkgconfig
414 # Files to install in Pkgconfig directory
415 pkgconfig_DATA = scilab.pc
417 .PHONY: macros localization doc
419 .NOTPARALLEL: macros doc
421 include $(top_srcdir)/Makefile.call_scilab.am