@@ DEV @@ : Try to use Java MVC for graphics component.
[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-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.9 dist-zip dist-bzip2
16
17 SUBDIRS= libs \
18         modules \
19         contrib
20
21 ACLOCAL_AMFLAGS = -I m4/
22
23 changelogs = CHANGES CHANGES_5.1.X
24
25 bin_PROGRAMS            = scilab-bin scilab-cli-bin
26
27 bin_SCRIPTS                     = bin/scilab bin/scilab-adv-cli bin/scilab-cli
28
29 scilab_bin_LDFLAGS              = 
30 scilab_cli_bin_LDFLAGS          =
31
32 if IS_MACOSX
33 scilab_bin_LDFLAGS              += -framework Cocoa
34 endif
35
36 scilab_bin_CFLAGS               = -I$(top_srcdir)/modules/io/includes   
37 # --no-undefined --relax
38
39 # libshell is mandatory here since main_linux.c depends on it.
40 # Localization dep already exists because of the `exportLocaleToSystem' symbol
41 # (causing issues on some platform)
42 COMMON_LIBS = $(top_builddir)/modules/shell/libscishell.la \
43 $(top_builddir)/modules/core/libscicore.la \
44 $(top_builddir)/modules/completion/libscicompletion.la \
45 $(top_builddir)/modules/localization/libscilocalization.la \
46 $(top_builddir)/modules/io/libsciio.la \
47 $(LTLIBINTL)
48
49 SCILAB_LIB=$(top_builddir)/modules/libscilab.la
50 SCILAB_CLI_LIB=$(top_builddir)/modules/libscilab-cli.la
51
52
53 scilab_bin_SOURCES              = $(top_srcdir)/modules/shell/src/c/others/mainscic.c
54
55 scilab_bin_LDADD                = $(COMMON_LIBS) $(SCILAB_LIB)
56
57 # Match scilab -nwni (ie command line without graphics)
58 scilab_cli_bin_SOURCES  = $(top_srcdir)/modules/shell/src/c/others/mainscic.c
59
60 scilab_cli_bin_CFLAGS           = -DWITHOUT_GUI -I$(top_srcdir)/modules/io/includes     
61 scilab_cli_bin_LDADD            = $(COMMON_LIBS) $(SCILAB_CLI_LIB)
62
63
64 if NEED_JAVA
65 # Don't do it for scilab_cli_bin. We want to be able to call it without 
66 # the java libs
67         scilab_bin_LDADD += $(JAVA_JNI_LIBS)
68 endif
69
70 if IS_SOLARIS
71 # The binary itself needs this dep
72         scilab_bin_LDADD += $(BLAS_LIBS)
73 endif
74
75 if ENABLE_STATIC
76 scilab_static_bin_LDFLAGS               = -static -static-libgcc --start-group
77 scilab_static_bin_CFLAGS =  -Wl,--start-group `$(CXX) -print-file-name=libstdc++.a`
78
79 #-static
80 bin_PROGRAMS                    += scilab-static-bin
81 scilab_static_bin_LDADD = $(top_builddir)/modules/libscilab.la
82
83 scilab_static_bin_SOURCES = $(scilab_bin_SOURCES)
84 endif
85
86 LANG_DOMAIN=scilab
87
88 TARGETS_ALL=macros
89
90 #  The user wants to compile the localization files
91 if GENERATE_LOCALIZATION_FILES
92 TARGETS_ALL+=localization
93 endif
94
95 all-local: $(TARGETS_ALL)
96
97 rootdir=$(pkgdatadir)/etc/
98 root_DATA = $(top_srcdir)/etc/scilab.start \
99 $(top_srcdir)/etc/scilab.quit \
100 $(top_srcdir)/etc/toolboxes.xml \
101 $(top_builddir)/etc/jvm_options.xml \
102 $(top_builddir)/etc/modules.xml \
103 $(top_builddir)/etc/classpath.xml \
104 $(top_builddir)/etc/librarypath.xml
105
106
107 infofilesdir=$(pkgdatadir)/
108 infofiles_DATA = $(top_srcdir)/CHANGES \
109 $(top_srcdir)/CHANGES_2.X \
110 $(top_srcdir)/CHANGES_3.X \
111 $(top_srcdir)/CHANGES_4.X \
112 $(top_srcdir)/CHANGES_5.0.X \
113 $(top_srcdir)/CHANGES_5.1.X \
114 $(top_srcdir)/CHANGES_5.2.X \
115 $(top_srcdir)/ACKNOWLEDGEMENTS \
116 $(top_srcdir)/COPYING \
117 $(top_srcdir)/COPYING-FR \
118 $(top_srcdir)/README_Unix \
119 $(top_srcdir)/RELEASE_NOTES \
120 $(top_srcdir)/RELEASE_NOTES_5.0.X \
121 $(top_srcdir)/RELEASE_NOTES_5.1.X \
122 $(top_srcdir)/RELEASE_NOTES_5.2.X \
123 $(top_srcdir)/Readme_Visual.txt \
124 $(top_srcdir)/README_Windows.txt
125
126 iconsdir=$(pkgdatadir)/icons/
127 icons_DATA = $(top_srcdir)/icons/scilab.xpm \
128 icons/puffin_128.xpm \
129 icons/puffin_256.xpm \
130 icons/puffin_32.xpm \
131 icons/puffin_48.xpm \
132 icons/puffin.png \
133 icons/puffin.icns \
134 icons/scilab.icns
135
136 valgrinddir=$(pkgdatadir)/tools/profiling
137 valgrind_DATA = $(top_srcdir)/tools/profiling/valgrind.supp
138
139 macros:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
140         -@( cd $(top_builddir) ; \
141         echo "$(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
142         $(top_builddir)/bin/scilab-cli -ns -f modules/functions/scripts/buildmacros/buildmacros.sce)
143
144 doc:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab-adv-cli
145 if BUILD_HELP
146         -@if test -x $(top_builddir)/scilab-bin; then \
147                 cd $(top_builddir);\
148                 echo "-- Building documentation (English) --"; \
149                 echo "LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 DOCBOOK_ROOT=$(DOCBOOK_ROOT) $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"xmltojar([],[],'en_US');exit;\"";\
150                 LANG=C SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 DOCBOOK_ROOT=$(DOCBOOK_ROOT) $(top_builddir)/bin/scilab-adv-cli -nb -l en_US -nouserstartup -e "xmltojar([],[],'en_US');exit;";\
151                 echo "-- Building documentation (French) --"; \
152                 echo "SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 DOCBOOK_ROOT=$(DOCBOOK_ROOT) $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e \"xmltojar([],[],'fr_FR');exit;\""; \
153                 SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 DOCBOOK_ROOT=$(DOCBOOK_ROOT) $(top_builddir)/bin/scilab-adv-cli -nb -nouserstartup -e "xmltojar([],[],'fr_FR');exit;"; \
154         else \
155                 echo "Cannot find Scilab-adv-cli binary"; \
156         fi
157 else
158         @echo "Cannot buid help. Add --enable-build-help to the ./configure if you want to build it."
159 endif
160
161 check-help:$(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli
162         @if test -x $(top_builddir)/scilab-cli-bin; then \
163                 echo "-- Checking documentation (English) --"; \
164                 $(top_builddir)/bin/scilab-cli -nb -l en -e 'check_help();exit;';\
165                 echo "-- Checking documentation (French) --"; \
166                 $(top_builddir)/bin/scilab-cli  -nb -l fr -e 'check_help();exit;';\
167         else \
168                 echo "Cannot find Scilab binary"; \
169         fi
170
171 check-recursive: check-local
172 check-local:
173         @if test -x $(top_builddir)/scilab-bin; then \
174                 COMMAND="test_run();quit";\
175                 export LANG=C;\
176                 $(top_builddir)/bin/scilab-adv-cli -nb -e "$$COMMAND"; \
177         else \
178                 echo "Cannot find Scilab binary"; \
179         fi
180
181 distclean-recursive: distclean-generated clean-recursive
182
183 clean-recursive: clean-doc clean-localization clean-macros clean-generated
184
185 clean-macros:
186 # Find is necessary because of subdirs...
187         -@echo "-- Cleaning macros (*.bin) --"; \
188         find $(top_builddir) -name "*.bin" | xargs --no-run-if-empty rm 2> /dev/null; \
189         echo "-- Cleaning names files (names) --"; \
190         find $(top_builddir)/modules/*/macros -name "names" | xargs --no-run-if-empty rm 2> /dev/null; \
191         echo "-- Cleaning lib files (lib) --"; \
192         find $(top_builddir)/modules/*/macros -name "lib" | xargs --no-run-if-empty rm 2> /dev/null
193
194
195 clean-doc:
196         -@if test -x $(top_builddir)/scilab-cli-bin; then \
197                 echo "$(top_builddir)/bin/scilab-cli -nb -l fr -e 'clean_help();exit;'"; \
198                 $(top_builddir)/bin/scilab-cli -nb -l fr -e 'clean_help();exit;'; \
199                 echo "$(top_builddir)/bin/scilab-cli  -nb -l en -e 'clean_help();exit;'"; \
200                 $(top_builddir)/bin/scilab-cli -nb -l en -e 'clean_help();exit;'; \
201         else \
202                 echo "Cannot find Scilab binary"; \
203         fi; \
204         echo "rmdir $(top_builddir)/modules/helptools/javaHelp/"; \
205         rm -rf $(top_builddir)/modules/helptools/javaHelp/; \
206         echo "rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help"; \
207         rm -rf $(top_builddir)/modules/scicos/help/*/scilab_*_help; \
208         echo "rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml"; \
209         rm -f $(top_builddir)/modules/scicos/help/en_US/master_help.xml; \
210         echo "rm -f $(top_builddir)/modules/scicos/jar/"; \
211         rm -rf $(top_builddir)/modules/scicos/jar/
212
213 clean-tests:
214         @if test -x $(top_builddir)/scilab-cli-bin; then \
215                 $(top_builddir)/bin/scilab-cli -nb -l fr -e 'test_clean();exit;'; \
216         else \
217                 echo "Cannot find Scilab binary"; \
218         fi
219
220 clean-localization:
221         rm -rf $(top_srcdir)/locale/
222
223 clean-generated:
224         rm -rf $(top_builddir)/modules/scicos_blocks/build/ 2> /dev/null
225
226 distclean-generated: 
227         rm -f $(top_builddir)/modules/core/includes/stack.h 2> /dev/null
228
229
230 if IS_MACOSX
231 # Used for mac os x because it needs to remove the charset=UTF-8 because it is breaking the accents.
232 MACOSX=1
233 endif
234
235 # The user wants to compile the localization files
236 # Please note that ALL_LINGUAS is defined in configure.ac
237 if GENERATE_LOCALIZATION_FILES
238 localization:
239         @echo "-- Build localization (.mo from .po) --"; \
240         MASK="modules/*/locales/"; \
241         LC="LC_MESSAGES"; \
242         MSGFMT_OPTS="$MSGFMT_OPTS --check"; \
243         FILENAME="*.po*"; \
244         rm modules/*/locales/*/*~ 2> /dev/null; \
245         for LOCALE in $(ALL_LINGUAS); do \
246                 echo "        -- Building for $$LOCALE --"; \
247                 FILES=`ls $$MASK/$$LOCALE/$$FILENAME`; \
248                 PATHTO=$(top_builddir)/locale/$$LOCALE/$$LC/; \
249                 if test ! -d $$PATHTO; then \
250                         echo "        Creating $$PATHTO"; \
251                         mkdir -p $$PATHTO; \
252                 fi; \
253                 POFILE=$$PATHTO/$(LANG_DOMAIN).po; \
254                 $(MSGCAT) --use-first -o $$POFILE $$FILES; \
255                 if test "$(MACOSX)" = "1"; then sed -i -e '/charset=UTF-8/d' $$POFILE; fi; \
256                 $(MSGFMT) $(MSGFMT_OPTS) --statistics -o $$PATHTO/$(LANG_DOMAIN).mo $$POFILE; \
257         done;
258 endif
259
260 # Misc variable for the documentation installation
261
262 # How help files look like.
263 DOCMASK=scilab_*_help.jar
264
265 # Path to builded files
266 PATHTOHELPFILES = modules/helptools/jar/
267
268 if GENERATE_LOCALIZATION_FILES
269 install-data-local:
270         @$(mkinstalldirs) $(DESTDIR)$(localedir); \
271         echo $(mkinstalldirs) $(DESTDIR)$(localedir); \
272         for lang in $(ALL_LINGUAS); do \
273                 LANG_PATH_DIST=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/; \
274                 echo $(mkinstalldirs) $$LANG_PATH_DIST; \
275                 $(mkinstalldirs) $$LANG_PATH_DIST; \
276                 echo $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
277                 $(INSTALL_DATA) $(top_builddir)/locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
278         done
279 endif
280
281 ################ INSTALL DOCUMENTATION #################
282 # Starting from Scilab 5, documentation file are provided by Docbook
283 # In the Scilab application we are generating a JavaHelp file.
284 if BUILD_HELP
285         @$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
286         echo $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES); \
287         if ls -lLd $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK) >/dev/null 2>&1; then \
288                 for file in $(top_builddir)/$(PATHTOHELPFILES)/$(DOCMASK); do \
289                     echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES)" ; \
290                 $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdatadir)/$(PATHTOHELPFILES) ; \
291                 done; \
292         fi
293 endif
294
295 # Pkgconfig directory
296 pkgconfigdir = $(libdir)/pkgconfig
297
298 # Files to install in Pkgconfig directory
299 pkgconfig_DATA = scilab.pc
300
301 .PHONY: macros localization doc
302
303 .NOTPARALLEL: macros doc
304
305 include $(top_srcdir)/Makefile.call_scilab.am