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