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.xpm \
137 $(top_srcdir)/desktop/puffin_128.xpm \
138 $(top_srcdir)/desktop/puffin_256.xpm \
139 $(top_srcdir)/desktop/puffin_32.xpm \
140 $(top_srcdir)/desktop/puffin_48.xpm \
141 $(top_srcdir)/desktop/puffin.png \
142 $(top_srcdir)/desktop/puffin.icns \
143 $(top_srcdir)/desktop/scilab.icns
145 valgrinddir=$(pkgdatadir)/tools/profiling
146 valgrind_DATA = $(top_srcdir)/tools/profiling/valgrind.supp
149 # Note that here, it is datadir and NOT pkgdatadir
150 desktopdir = $(datadir)/applications
151 desktop_DATA = $(top_srcdir)/desktop/scilab-adv-cli.desktop \
152 $(top_srcdir)/desktop/scilab-cli.desktop \
153 $(top_srcdir)/desktop/scilab.desktop
155 macros:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
156 -@( cd $(top_builddir) ; \
157 echo "$(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
158 $(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
161 # Build the public Javadoc (javasci v2 and Java/Scilab types)
162 # This is not done in the module itself because its needs also the "types"
165 $(JAVADOC) -noindex -nohelp -nonavbar -notree \
166 -d $(top_builddir)/modules/javasci/javadoc \
167 -sourcepath $(top_srcdir)/modules/javasci/src/java:$(top_srcdir)/modules/types/src/java \
168 org.scilab.modules.javasci org.scilab.modules.types
170 doc: javadoc $(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
172 @if test -x $(top_builddir)/scilab-bin; then \
174 for l in $(ALL_LINGUAS_DOC); do \
175 echo "-- Building documentation ($$l) --"; \
176 COMMAND="try xmltojar([],[],'$$l');catch exit(-1);end;exit(0);"; \
177 echo "LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"$$COMMAND\"";\
178 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;\
181 echo "Cannot find Scilab-adv-cli binary"; \
184 @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
187 doc-web:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
189 @if test -x $(top_builddir)/scilab-bin; then \
191 for l in $(ALL_LINGUAS_DOC); do \
192 echo "-- Building documentation ($$l) --"; \
193 COMMAND="try xmltoweb([],[],'$$l');catch exit(-1);end;exit(0);";\
194 echo "LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"$$COMMAND\"";\
195 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;\
196 JAVADOC_TARGET=$(top_builddir)/modules/helptools/web/$$l/javasci; \
197 if test ! -d $$JAVADOC_TARGET; then \
198 mkdir $$JAVADOC_TARGET; \
199 ln -s ../../../../javasci/javadoc/ $$JAVADOC_TARGET/; \
203 echo "Cannot find Scilab-adv-cli binary"; \
206 @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
209 check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
210 @if test -x $(top_builddir)/scilab-cli-bin; then \
211 for l in $(ALL_LINGUAS_DOC); do \
212 echo "-- Checking documentation ($$l) --"; \
213 COMMAND="try check_help();catch exit(-1);end;exit(0);";\
214 echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -e \"$$COMMAND\"";\
215 $(top_builddir)/bin/scilab-cli -nb -l $$l -e "$$COMMAND" || exit 1;\
218 echo "Cannot find Scilab binary"; \
221 check-recursive: check-local
223 @if test -x $(top_builddir)/scilab-bin; then \
224 COMMAND="try test_run();catch exit(-1);end;exit(0)";\
226 $(top_builddir)/bin/scilab-adv-cli -nb -e "$$COMMAND"; \
228 echo "Cannot find Scilab binary"; \
233 @if test ! -d $(top_builddir)/coverage/; then \
234 mkdir $(top_builddir)/coverage/; \
236 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; \
237 $(LCOV) --directory $(top_builddir) --capture --ignore-errors source --output-file $(top_builddir)/coverage/scilab-code-coverage.info; \
238 $(GENHTML) -o $(top_builddir)/coverage/results/ --show-details --highlight --legend $(top_builddir)/coverage/scilab-code-coverage.info; \
239 echo "To open the result: firefox $(top_builddir)/coverage/results/index.html"; \
240 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
241 #--frames is disable because of : http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=607206
243 @echo "Cannot start the code coverage. Add --enable-code-coverage to the ./configure and 'make clean all'."
246 distclean-recursive: distclean-generated clean-recursive
248 clean-recursive: clean-help clean-localization clean-macros clean-generated
251 # Find is necessary because of subdirs...
252 -@echo "-- Cleaning macros (*.bin) --"; \
253 find $(top_builddir) -name "*.bin" | xargs --no-run-if-empty rm 2> /dev/null; \
254 echo "-- Cleaning names files (names) --"; \
255 find $(top_builddir)/modules/*/macros -name "names" | xargs --no-run-if-empty rm 2> /dev/null; \
256 echo "-- Cleaning lib files (lib) --"; \
257 find $(top_builddir)/modules/*/macros -name "lib" | xargs --no-run-if-empty rm 2> /dev/null
259 # To ensure previous compatibility
260 clean-doc: clean-help
263 -@if test -x $(top_builddir)/scilab-cli-bin; then \
264 COMMAND="try clean_help();catch exit(-1);end;exit(0)"; \
265 for l in $(ALL_LINGUAS_DOC); do \
266 echo "$(top_builddir)/bin/scilab-cli -nb -l $$l -e '$$COMMAND'"; \
267 $(top_builddir)/bin/scilab-cli -nb -l $$l -e "$$COMMAND" || exit 1; \
270 echo "Cannot find Scilab binary"; \
272 echo "rmdir $(top_builddir)/modules/helptools/javaHelp/"; \
273 rm -rf $(top_builddir)/modules/helptools/javaHelp/; \
274 echo "rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help"; \
275 rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help; \
276 echo "rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml"; \
277 rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml; \
278 echo "rm -f $(top_builddir)/modules/scicos/jar/"; \
279 rm -rf $(top_builddir)/modules/scicos/jar/; \
280 echo "rm -rf $(top_builddir)/modules/javasci/javadoc"; \
281 rm -rf $(top_builddir)/modules/javasci/javadoc;
284 @if test -x $(top_builddir)/scilab-cli-bin; then \
285 $(top_builddir)/bin/scilab-cli -nb -l fr -e 'try test_clean();catch exit(-1);end;exit(0);' || exit 1; \
287 echo "Cannot find Scilab binary"; \
291 rm -rf $(top_srcdir)/locale/
294 rm -rf $(top_builddir)/modules/scicos_blocks/build/ 2> /dev/null
297 rm -f $(top_builddir)/modules/core/includes/stack.h 2> /dev/null
301 # Used for mac os x because it needs to remove the charset=UTF-8 because it is breaking the accents.
305 # For each module, build and call Java unitary tests
306 # If fails, stops the call
308 @echo "-- Launch all TestNG (Java) unitary tests"; \
309 MASK="$(top_srcdir)/modules/*/tests/java/"; \
310 MODULES=`ls -d $$MASK`; \
311 for M in $$MODULES; do \
312 BASE=`echo $$M|sed -e "s|tests/java/$$||g"`; \
313 $(ANT) -buildfile $$BASE/build.xml test || exit $$?; \
316 # The user wants to compile the localization files
317 # Please note that ALL_LINGUAS is defined in configure.ac
318 if GENERATE_LOCALIZATION_FILES
320 @echo "-- Build localization (.mo from .po) --"; \
321 MASK="modules/*/locales/"; \
323 MSGFMT_OPTS="$MSGFMT_OPTS --check"; \
325 rm modules/*/locales/*~ 2> /dev/null; \
326 for LOCALE in $(ALL_LINGUAS); do \
327 echo " -- Building for $$LOCALE --"; \
328 FILES=`ls $$MASK/$$LOCALE$$EXTENSION`; \
329 PATHTO=$(top_builddir)/locale/$$LOCALE/$$LC/; \
330 if test ! -d $$PATHTO; then \
331 echo " Creating $$PATHTO"; \
334 POFILE=$$PATHTO/$(LANG_DOMAIN).po; \
335 $(MSGCAT) --use-first -o $$POFILE $$FILES; \
336 if test "$(MACOSX)" = "1"; then sed -i -e '/charset=UTF-8/d' $$POFILE; fi; \
337 $(MSGFMT) $(MSGFMT_OPTS) --statistics -o $$PATHTO/$(LANG_DOMAIN).mo $$POFILE; \
342 @for LOCALE in $(ALL_LINGUAS_DOC); do \
343 PATHTO=$(top_builddir)/locale-status/$$LOCALE/; \
344 if test ! -d $$PATHTO; then \
345 echo " Creating $$PATHTO"; \
348 echo "Building status for $$LOCALE"; \
349 echo "SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html"; \
350 SCI=$(top_srcdir) php tools/localization/revcheck.php $$LOCALE > $$PATHTO/index.html; \
355 # Misc variable for the documentation installation
357 # How help files look like.
358 DOCMASK=scilab_*_help.jar
360 # Path to builded files
361 PATHTOHELPFILES = modules/helptools/jar/
363 # Path javasci to builded files
364 PATHTOJAVASCIDOC = modules/javasci/javadoc/
365 JAVASCI_DIRS = . resources \
366 org/scilab/modules/javasci/ \
367 org/scilab/modules/types/
369 if GENERATE_LOCALIZATION_FILES
371 @$(mkinstalldirs) $(DESTDIR)$(localedir); \
372 echo $(mkinstalldirs) $(DESTDIR)$(localedir); \
373 for lang in $(ALL_LINGUAS); do \
374 LANG_PATH_DIST=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/; \
375 echo $(mkinstalldirs) $$LANG_PATH_DIST; \
376 $(mkinstalldirs) $$LANG_PATH_DIST; \
377 echo $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
378 $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
382 ################ INSTALL DOCUMENTATION #################
383 # Starting from Scilab 5, documentation file are provided by Docbook
384 # In the Scilab application we are generating a JavaHelp file.
386 @$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
387 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
388 if ls -lLd $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK) >/dev/null 2>&1; then \
389 for file in $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK); do \
390 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES)" ; \
391 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES) ; \
394 ## Install Javasci documentation (javadoc)
395 ## See target javadoc in this file to see how it is build
396 @if test -d $(PATHTOJAVASCIDOC); then \
397 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
398 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC); \
399 for dir in $(JAVASCI_DIRS) ; do \
400 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
401 echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir; \
402 for file in $(top_builddir)/$(PATHTOJAVASCIDOC)/$(dir)/*; do \
403 echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir" ; \
404 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOJAVASCIDOC)/$$dir ; \
410 # Pkgconfig directory
411 pkgconfigdir = $(libdir)/pkgconfig
413 # Files to install in Pkgconfig directory
414 pkgconfig_DATA = scilab.pc
416 .PHONY: macros localization doc
418 .NOTPARALLEL: macros doc
420 include $(top_srcdir)/Makefile.call_scilab.am