test of localization
[scilab.git] / scilab / Makefile.am
1 ##########
2 ### Sylvestre Ledru <sylvestre.ledru@inria.fr>
3 ### INRIA - Scilab 2006
4 ##########
5
6 ## Process this file with automake to produce Makefile.in (which will be changed by the ./configure)
7
8 AUTOMAKE_OPTIONS = 1.9 dist-zip dist-bzip2
9
10 SUBDIRS= libs \
11         modules
12
13 ACLOCAL_AMFLAGS = -I m4/
14
15 changelogs = CHANGES
16
17 bin_PROGRAMS            = scilab-bin
18
19 bin_SCRIPTS                     = bin/scilab
20
21 scilab_bin_SOURCES              = $(top_srcdir)/modules/core/src/c/main_linux.c
22
23 if GUI
24 scilab_bin_LDADD = $(top_builddir)/modules/libscilab.la 
25 #       $(X_EXTRA_LIBS) -lXt -lX11 -lSM -lGLU
26 else
27 scilab_bin_LDADD = $(top_builddir)/modules/libscilab.la \
28         $(X_EXTRA_LIBS)
29 endif
30
31 LANG_DOMAIN=scilab
32
33 TARGETS_ALL=macros 
34
35 #  The user wants to compile the localization files
36 if GENERATE_LOCALIZATION_FILES
37 TARGETS_ALL+=localization
38 endif
39
40 all-local: $(TARGETS_ALL)
41
42 rootdir=$(pkgdatadir)/etc/
43 root_DATA = $(top_srcdir)/etc/scilab.start \
44 $(top_srcdir)/etc/scilab.quit \
45 $(top_srcdir)/etc/modules.xml \
46 $(top_srcdir)/etc/classpath.xml \
47 $(top_srcdir)/etc/librarypath.xml \
48 $(top_srcdir)/etc/toolboxes.xml
49
50
51 macros:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab
52         -@( cd $(top_builddir) ; \
53         echo "$(top_builddir)/bin/scilab -ns -nwni -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
54         $(top_builddir)/bin/scilab -ns -nwni -f modules/functions/scripts/buildmacros/buildmacros.sce)
55
56 doc:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab
57         -@( cd $(top_builddir) ; \
58         $(top_builddir)/bin/scilab -nb -l en -nouserstartup -nwni -e "xmltohtml();exit;")
59
60         -@( cd $(top_builddir) ; \
61         $(top_builddir)/bin/scilab -nb -l fr -nouserstartup -nwni -e "xmltohtml();exit;")
62
63
64 check-help:$(top_builddir)/scilab-bin $(top_builddir)/bin/scilab
65         $(top_builddir)/bin/scilab -nwni -nb -l fr -e 'check_help();exit;'
66         $(top_builddir)/bin/scilab -nwni -nb -l en -e 'check_help();exit;'
67
68 check-recursive: check-local
69 check-local:
70         @if test -x $(top_builddir)/scilab-bin; then \
71                 COMMAND="test_run();quit";\
72                 export LANG=C;\
73                 $(top_builddir)/bin/scilab -nw -nb -e "$$COMMAND"; \
74         else \
75                 echo "Cannot find Scilab binary"; \
76         fi
77
78 distclean-recursive: clean-help clean-localization
79
80 clean-recursive: clean-help clean-localization
81
82 clean-help:
83         @if test -x $(top_builddir)/scilab-bin; then \
84                 $(top_builddir)/bin/scilab -nwni -nb -l fr -e 'clean_help();exit;'; \
85                 $(top_builddir)/bin/scilab -nwni -nb -l en -e 'clean_help();exit;'; \
86         else \
87                 echo "Cannot find Scilab binary"; \
88         fi
89
90 clean-localization:
91         rm -rf $(top_srcdir)/locale/
92
93
94 #  The user wants to compile the localization files
95 if GENERATE_LOCALIZATION_FILES
96 localization:
97         @echo "-- Build localization (.mo from .po) --"; \
98         MASK="modules/*/locales/"; \
99         LC=LC_MESSAGES; \
100         FILENAME="*.po*"; \
101         rm modules/*/locales/*/*~ 2> /dev/null; \
102         for LOCALE in $(ALL_LINGUAS); do \
103                 echo "Building for $$LOCALE :"; \
104                 FILES=`ls $$MASK/$$LOCALE/$$FILENAME`; \
105                 PATHTO=$(top_srcdir)/locale/$$LOCALE/$$LC/; \
106                 if test ! -d $$PATHTO; then \
107                         echo "Creating $$PATHTO"; \
108                         mkdir -p $$PATHTO; \
109                 fi; \
110                 POFILE=$$PATHTO/$(LANG_DOMAIN).po; \
111                 $(MSGCAT) -o $$POFILE $$FILES; \
112                 $(MSGFMT) $(MSGFMT_OPTS) --statistics -o $$PATHTO/$(LANG_DOMAIN).mo $$POFILE; \
113         done
114 endif
115
116 install-data-local:
117         @$(mkinstalldirs) $(DESTDIR)$(localedir); \
118         echo $(mkinstalldirs) $(DESTDIR)$(localedir); \
119         for lang in $(ALL_LINGUAS); do \
120                 LANG_PATH_DIST=$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/; \
121                 echo $(mkinstalldirs) $$LANG_PATH_DIST; \
122                 $(mkinstalldirs) $$LANG_PATH_DIST; \
123                 echo $(INSTALL_DATA) locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
124                 $(INSTALL_DATA) locale/$$lang/LC_MESSAGES/$(LANG_DOMAIN).mo $$LANG_PATH_DIST/; \
125         done
126
127 # Pkgconfig directory
128 pkgconfigdir = $(libdir)/pkgconfig
129
130 # Files to install in Pkgconfig directory
131 pkgconfig_DATA = scilab.pc
132
133