Transpose dialog: convert from old style to PsppireDialogAction
[pspp] / Smake
1 # -*- makefile -*-
2
3 # Adjust these to reflect where you've installed gnulib.
4 GNULIB = ../gnulib
5 GNULIB_TOOL = $(GNULIB)/gnulib-tool
6
7 GNULIB_MODULES = \
8         assert \
9         byteswap \
10         c-snprintf \
11         c-strcase \
12         c-strcasestr \
13         c-ctype \
14         c-strtod \
15         c-xvasprintf \
16         clean-temp \
17         close \
18         configmake \
19         count-one-bits \
20         crc \
21         crypto/md4 \
22         crypto/md5 \
23         dirname \
24         dtoastr \
25         environ \
26         fatal-signal \
27         fcntl \
28         fpieee \
29         fprintf-posix \
30         full-read \
31         full-write \
32         fseeko \
33         ftello \
34         fwriteerror \
35         getline \
36         gettext \
37         gettimeofday \
38         getopt-gnu \
39         gitlog-to-changelog \
40         include_next \
41         isfinite \
42         isinf \
43         isnan \
44         intprops \
45         inttostr \
46         localcharset \
47         mbchar \
48         mbiter \
49         memcasecmp \
50         memchr \
51         memchr2 \
52         mempcpy \
53         memrchr \
54         minmax \
55         mkdtemp \
56         mkstemp \
57         pipe2 \
58         printf-posix \
59         printf-safe \
60         progname \
61         rawmemchr \
62         read-file \
63         regex \
64         relocatable-prog \
65         rename \
66         round \
67         select \
68         snprintf \
69         snprintf-posix \
70         sprintf-posix \
71         stdarg \
72         stdbool \
73         stdint \
74         strcasestr \
75         stpcpy \
76         strerror \
77         strftime \
78         strtod \
79         strtok_r \
80         sys_stat \
81         tempname \
82         trunc \
83         unicase/u8-casecmp \
84         unicase/u8-casefold \
85         unicase/u8-tolower \
86         unicase/u8-toupper \
87         unictype/ctype-print \
88         unictype/category-of \
89         unigbrk/uc-is-grapheme-break \
90         unilbrk/u8-possible-linebreaks \
91         uninorm/nfkd \
92         unistd \
93         unistr/u8-check \
94         unistr/u8-cpy \
95         unistr/u8-mblen \
96         unistr/u8-mbtouc \
97         unistr/u8-mbtoucr \
98         unistr/u8-strlen \
99         unistr/u8-strmbtouc \
100         unistr/u8-strncat \
101         unistr/u8-uctomb \
102         uniwidth/u8-strwidth \
103         unitypes \
104         unlocked-io \
105         vasprintf-posix \
106         version-etc \
107         version-etc-fsf \
108         vfprintf-posix \
109         vprintf-posix \
110         vsnprintf \
111         vsnprintf-posix \
112         vsprintf-posix \
113         xalloc \
114         xalloc-die \
115         xmalloca \
116         xmemdup0 \
117         xsize \
118         xstrndup \
119         xvasprintf
120
121 APP_ICONS = \
122 src/ui/gui/icons/apps/32x32/pspp.png \
123 src/ui/gui/icons/apps/22x22/pspp.png \
124 src/ui/gui/icons/apps/24x24/pspp.png \
125 src/ui/gui/icons/apps/256x256/pspp.png \
126 src/ui/gui/icons/apps/16x16/pspp.png \
127 src/ui/gui/icons/apps/48x48/pspp.png \
128 src/ui/gui/icons/apps/scalable/pspp.png
129
130 CATEGORY_ICONS = \
131 src/ui/gui/icons/categories/16x16/align-left.png \
132 src/ui/gui/icons/categories/16x16/align-center.png \
133 src/ui/gui/icons/categories/16x16/align-right.png \
134 src/ui/gui/icons/categories/16x16/measure-scale.png \
135 src/ui/gui/icons/categories/16x16/measure-ordinal.png \
136 src/ui/gui/icons/categories/16x16/measure-nominal.png \
137 src/ui/gui/icons/categories/16x16/measure-date-scale.png \
138 src/ui/gui/icons/categories/16x16/measure-date-nominal.png \
139 src/ui/gui/icons/categories/16x16/measure-date-ordinal.png \
140 src/ui/gui/icons/categories/16x16/measure-time-scale.png \
141 src/ui/gui/icons/categories/16x16/measure-time-nominal.png \
142 src/ui/gui/icons/categories/16x16/measure-time-ordinal.png \
143 src/ui/gui/icons/categories/16x16/measure-string-nominal.png \
144 src/ui/gui/icons/categories/16x16/measure-string-ordinal.png \
145 src/ui/gui/icons/categories/16x16/measure-currency-scale.png \
146 src/ui/gui/icons/categories/16x16/measure-currency-nominal.png \
147 src/ui/gui/icons/categories/16x16/measure-currency-ordinal.png \
148 src/ui/gui/icons/categories/16x16/role-input.png \
149 src/ui/gui/icons/categories/16x16/role-target.png \
150 src/ui/gui/icons/categories/16x16/role-both.png \
151 src/ui/gui/icons/categories/16x16/role-none.png \
152 src/ui/gui/icons/categories/16x16/role-partition.png \
153 src/ui/gui/icons/categories/16x16/role-split.png
154
155 MIMETYPE_ICONS = \
156 src/ui/gui/icons/mimetypes/32x32/application-x-spss-por.png \
157 src/ui/gui/icons/mimetypes/32x32/application-x-spss-sav.png \
158 src/ui/gui/icons/mimetypes/32x32/application-x-spss-sps.png \
159 src/ui/gui/icons/mimetypes/22x22/application-x-spss-por.png \
160 src/ui/gui/icons/mimetypes/22x22/application-x-spss-sav.png \
161 src/ui/gui/icons/mimetypes/22x22/application-x-spss-sps.png \
162 src/ui/gui/icons/mimetypes/24x24/application-x-spss-por.png \
163 src/ui/gui/icons/mimetypes/24x24/application-x-spss-sav.png \
164 src/ui/gui/icons/mimetypes/24x24/application-x-spss-sps.png \
165 src/ui/gui/icons/mimetypes/256x256/application-x-spss-por.png \
166 src/ui/gui/icons/mimetypes/256x256/application-x-spss-sav.png \
167 src/ui/gui/icons/mimetypes/256x256/application-x-spss-sps.png \
168 src/ui/gui/icons/mimetypes/16x16/application-x-spss-por.png \
169 src/ui/gui/icons/mimetypes/16x16/application-x-spss-sav.png \
170 src/ui/gui/icons/mimetypes/16x16/application-x-spss-sps.png \
171 src/ui/gui/icons/mimetypes/48x48/application-x-spss-por.png \
172 src/ui/gui/icons/mimetypes/48x48/application-x-spss-sav.png \
173 src/ui/gui/icons/mimetypes/48x48/application-x-spss-sps.png \
174
175 MISC_ICONS = src/ui/gui/icons/splash.png \
176 src/ui/gui/icons/about-logo.png
177
178
179
180 ACTION_ICONS = \
181 src/ui/gui/icons/actions/32x32/data-split-file.png \
182 src/ui/gui/icons/actions/32x32/data-weight-cases.png \
183 src/ui/gui/icons/actions/32x32/edit-find.png \
184 src/ui/gui/icons/actions/32x32/edit-go-to-case.png \
185 src/ui/gui/icons/actions/32x32/edit-go-to-variable.png \
186 src/ui/gui/icons/actions/32x32/edit-insert-case.png \
187 src/ui/gui/icons/actions/32x32/edit-insert-variable.png \
188 src/ui/gui/icons/actions/32x32/file-open-data.png \
189 src/ui/gui/icons/actions/32x32/file-save-data.png \
190 src/ui/gui/icons/actions/32x32/view-value-labels.png \
191 src/ui/gui/icons/actions/24x24/data-split-file.png \
192 src/ui/gui/icons/actions/24x24/data-weight-cases.png \
193 src/ui/gui/icons/actions/24x24/edit-find.png \
194 src/ui/gui/icons/actions/24x24/edit-go-to-case.png \
195 src/ui/gui/icons/actions/24x24/edit-go-to-variable.png \
196 src/ui/gui/icons/actions/24x24/edit-insert-case.png \
197 src/ui/gui/icons/actions/24x24/edit-insert-variable.png \
198 src/ui/gui/icons/actions/24x24/file-open-data.png \
199 src/ui/gui/icons/actions/24x24/file-save-data.png \
200 src/ui/gui/icons/actions/24x24/view-value-labels.png \
201 src/ui/gui/icons/actions/16x16/file-new-data.png \
202 src/ui/gui/icons/actions/16x16/file-syntax-data.png \
203 src/ui/gui/icons/actions/16x16/file-system-data.png \
204 src/ui/gui/icons/actions/16x16/file-open-data.png \
205 src/ui/gui/icons/actions/16x16/file-import-data.png \
206 src/ui/gui/icons/actions/16x16/file-export-data.png \
207 src/ui/gui/icons/actions/16x16/file-save-data.png \
208 src/ui/gui/icons/actions/16x16/file-save-as.png \
209 src/ui/gui/icons/actions/16x16/file-print.png \
210 src/ui/gui/icons/actions/16x16/file-rename-data-set.png \
211 src/ui/gui/icons/actions/16x16/file-display-information.png \
212 src/ui/gui/icons/actions/16x16/display-information-working-file.png \
213 src/ui/gui/icons/actions/16x16/display-information-external-file.png \
214 src/ui/gui/icons/actions/16x16/file-recently-used.png \
215 src/ui/gui/icons/actions/16x16/file-quit.png \
216 src/ui/gui/icons/actions/16x16/file-display-information.png \
217 src/ui/gui/icons/actions/16x16/edit-insert-variable.png \
218 src/ui/gui/icons/actions/16x16/edit-insert-case.png \
219 src/ui/gui/icons/actions/16x16/edit-go-to-variable.png \
220 src/ui/gui/icons/actions/16x16/edit-go-to-case.png \
221 src/ui/gui/icons/actions/16x16/edit-cut.png \
222 src/ui/gui/icons/actions/16x16/edit-copy.png \
223 src/ui/gui/icons/actions/16x16/edit-paste.png \
224 src/ui/gui/icons/actions/16x16/edit-delete.png \
225 src/ui/gui/icons/actions/16x16/edit-undo.png \
226 src/ui/gui/icons/actions/16x16/edit-redo.png \
227 src/ui/gui/icons/actions/16x16/edit-select-all.png \
228 src/ui/gui/icons/actions/16x16/edit-clear.png \
229 src/ui/gui/icons/actions/16x16/edit-find.png \
230 src/ui/gui/icons/actions/16x16/view-font.png \
231 src/ui/gui/icons/actions/16x16/view-value-labels.png \
232 src/ui/gui/icons/actions/16x16/data-sort-cases.png \
233 src/ui/gui/icons/actions/16x16/data-transpose.png \
234 src/ui/gui/icons/actions/16x16/data-aggregate.png \
235 src/ui/gui/icons/actions/16x16/data-split-file.png \
236 src/ui/gui/icons/actions/16x16/data-select-cases.png \
237 src/ui/gui/icons/actions/16x16/data-weight-cases.png \
238 src/ui/gui/icons/actions/16x16/run-all.png \
239 src/ui/gui/icons/actions/16x16/run-selection.png \
240 src/ui/gui/icons/actions/16x16/run-current-line.png \
241 src/ui/gui/icons/actions/16x16/run-to-end.png \
242 src/ui/gui/icons/actions/16x16/transform-compute.png \
243 src/ui/gui/icons/actions/16x16/transform-count.png \
244 src/ui/gui/icons/actions/16x16/transform-rank-cases.png \
245 src/ui/gui/icons/actions/16x16/transform-automatic-recode.png \
246 src/ui/gui/icons/actions/16x16/transform-in-to-same-variables.png \
247 src/ui/gui/icons/actions/16x16/transform-in-to-different-variables.png \
248 src/ui/gui/icons/actions/16x16/transform-run-pending.png \
249 src/ui/gui/icons/actions/16x16/analyze-descriptive-statistics.png \
250 src/ui/gui/icons/actions/16x16/analyze-compare-means.png \
251 src/ui/gui/icons/actions/16x16/analyze-bivariate-correlation.png \
252 src/ui/gui/icons/actions/16x16/analyze-kmeans-cluster.png \
253 src/ui/gui/icons/actions/16x16/analyze-factor-analysis.png \
254 src/ui/gui/icons/actions/16x16/analyze-realiability.png \
255 src/ui/gui/icons/actions/16x16/analyze-regression.png \
256 src/ui/gui/icons/actions/16x16/analyze-non-parametric-statistics.png \
257 src/ui/gui/icons/actions/16x16/analyze-roc-curve.png \
258 src/ui/gui/icons/actions/16x16/utilities-variables.png \
259 src/ui/gui/icons/actions/16x16/utilities-data-file-comments.png \
260 src/ui/gui/icons/actions/16x16/windows-minimize-all.png \
261 src/ui/gui/icons/actions/16x16/windows-split.png \
262 src/ui/gui/icons/actions/16x16/help-reference-manual.png \
263 src/ui/gui/icons/actions/16x16/help-about.png
264
265
266 ICONS=$(CATEGORY_ICONS) $(ACTION_ICONS) $(MIMETYPE_ICONS) $(APP_ICONS) $(MISC_ICONS)
267
268 all: prep_ph  icons
269         $(MAKE) -f Smake Makefile.in configure
270
271 icons: $(ICONS) src/ui/gui/icons/icon-names.c
272
273 src/ui/gui/icons/icon-names.c: $(MAKEFILE_LIST)
274         $(RM) $@
275         printf '/* This is a generated file. Do not edit. */\n' >> $@
276         printf '#include "icon-names.h"\n' >> $@
277         echo >> $@
278         printf 'static const char *action_icon_name[] =' >> $@
279         printf '\n{\n' >> $@
280         for i in $(ACTION_ICONS) ; do \
281          echo $$i; \
282         done | sed -e 's%[a-zA-Z/]*/[1-9]*x[1-9]*/\([^ ]*\)\.png%\1%g' | sort -u | while read f ; do \
283          printf '  "%s", \n' $$f >> $@ ; \
284         done ; \
285         printf '};\n\n' >> $@ ; \
286         printf 'const struct icon_context action_icon_context = {\n' >> $@
287         printf '  action_icon_name,\n' >> $@
288         printf "  sizeof (action_icon_name) / sizeof (action_icon_name[0]),\n" >> $@ 
289         printf "  \"actions\"\n" >> $@
290         printf '};\n' >> $@ ; \
291         echo >> $@
292         printf 'static const char *category_icon_name[] =' >> $@
293         printf '\n{\n' >> $@
294         for i in $(CATEGORY_ICONS) ; do \
295          echo $$i; \
296         done | sed -e 's%[a-zA-Z/]*/[1-9]*x[1-9]*/\([^ ]*\)\.png%\1%g' | sort -u | while read f ; do \
297          printf '  "%s", \n' $$f >> $@ ; \
298         done ; \
299         printf '};\n\n' >> $@ ; \
300         printf 'const struct icon_context category_icon_context = {\n' >> $@
301         printf '  category_icon_name,\n' >> $@
302         printf "  sizeof (category_icon_name) / sizeof (category_icon_name[0]),\n" >> $@ 
303         printf "  \"categories\"\n" >> $@
304         printf '};\n' >> $@ ; \
305         echo >> $@
306
307
308 src/ui/gui/icons/manifest: $(MAKEFILE_LIST)
309         $(RM) $@
310         printf '# This is a generated file. Do not edit.\n' >> $@
311         printf 'icons =' >> $@
312         for i in  $(ICONS); do \
313           printf ' \\\n\t '$$i >> $@; \
314         done
315         echo >> $@
316         echo >> $@
317         printf 'icon_srcs = ' >> $@
318         for i in  $(ICONS); do \
319           printf ' \\\n\t '$$i | sed -e 's/\.png$$/.svg/' -e 's%/icons/%/artwork/%' >> $@ ; \
320         done
321         echo ' ' >> $@
322         echo >> $@
323
324 .PHONY: prep_ph
325 prep_ph: 
326         test -e ChangeLog || touch ChangeLog
327         test -d m4 || mkdir m4
328         touch m4/Makefile.am
329         $(GNULIB_TOOL) --add-import --no-changelog --m4-base=gl/m4 \
330                 --source-base=gl --lib=libgl --tests-base=tests \
331                 --doc-base=gl/doc --aux-dir=build-aux  \
332                 --libtool $(GNULIB_MODULES)
333         if (glibtoolize --version) >/dev/null 2>&1; then        \
334                 LIBTOOLIZE=glibtoolize;                         \
335         elif (libtoolize --version) >/dev/null 2>&1; then       \
336                 LIBTOOLIZE=libtoolize;                          \
337         else                                                    \
338                 echo >&2 "libtoolize not found";                \
339                 exit 1;                                         \
340         fi;                                                     \
341         $$LIBTOOLIZE --force --automake
342
343 aclocal.m4:
344         aclocal -I m4 -I gl/m4
345
346 configure: configure.ac aclocal.m4
347         autoconf
348
349 config.h.in: configure.ac
350         autoheader
351
352 Makefile.in: Makefile.am config.h.in aclocal.m4 src/ui/gui/icons/manifest
353         automake --add-missing --copy --no-force --include-deps
354
355
356 gettextize:
357         test -d m4 || mkdir m4
358         touch m4/Makefile.am
359         gettextize --force --no-changelog
360
361 check: all
362         rm -rf _check
363         mkdir _check
364         cd _check && ../configure $(CONFIGUREFLAGS)
365         cd _check && make distcheck
366         rm -rf _check
367
368 _build: all
369         test -d _build || mkdir _build
370         cd _build && ../configure $(CONFIGUREFLAGS)
371
372 _debug: all
373         test -d _debug || mkdir _debug
374         cd _debug && ../configure $(CONFIGUREFLAGS) --enable-debug
375
376
377
378 PO_FILES = po/ChangeLog \
379 po/Rules-quot po/boldquot.sed           \
380 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
381 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
382 po/Makevars.template po/pspp.pot
383
384 clean:
385         rm -f config.sub config.guess config.rpath
386         rm -fr autom4te.cache
387         rm -f aclocal.m4
388         rm -f missing mkinstalldirs
389         rm -f install-sh
390         rm -f configure Makefile 
391         rm -f depcomp
392         rm -rf intl gl
393         rm -f m4/*.m4
394         rm -f $(PO_FILES) po/*.gmo 
395         rm -f mdate-sh texinfo.tex
396         rm -f doc/stamp-vti
397         rm -f config.h.in~
398         rm -f config.h.in
399         find . -name Makefile.in -exec rm -f {} \; 
400         rm -f compile
401         rm -f ltmain.sh
402         rm -f reloc-ldflags install-reloc
403
404 .PHONY: all gettextize clean
405
406
407 # The "convert" program from imagemagick can be used to create png from svg but doesn't properly deal
408 # with the alpha channels.  Therefore, it is not recommended for production pspp builds, but might
409 # be useful to get something working on a platform which doesn't have a working gimp.
410
411 #svg2png=convert $1 $3
412
413 svg2png=gimp -i -b '(let* ((image  (car  (gimp-file-load 1  "$1"  "$1"))))  (gimp-image-attach-parasite image (list "gimp-comment" 0 "$(shell cat $2)"))  (gimp-file-save 1 image (car  (gimp-image-get-active-drawable image)) "$3" "$3")) (gimp-quit 1)'
414
415
416 src/ui/gui/icons/%.png: src/ui/gui/artwork/%.svg src/ui/gui/icons/COPYING_CCBYSA3
417         mkdir -p $(dir $@)
418         $(call svg2png,$<,$(lastword $^),$@)
419