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