Added mimetype icons
[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
122
123 MIMETYPE_ICONS = \
124 src/ui/gui/icons/mimetypes/32x32/application-x-spss-por.png \
125 src/ui/gui/icons/mimetypes/32x32/application-x-spss-sav.png \
126 src/ui/gui/icons/mimetypes/32x32/application-x-spss-sps.png \
127 src/ui/gui/icons/mimetypes/22x22/application-x-spss-por.png \
128 src/ui/gui/icons/mimetypes/22x22/application-x-spss-sav.png \
129 src/ui/gui/icons/mimetypes/22x22/application-x-spss-sps.png \
130 src/ui/gui/icons/mimetypes/24x24/application-x-spss-por.png \
131 src/ui/gui/icons/mimetypes/24x24/application-x-spss-sav.png \
132 src/ui/gui/icons/mimetypes/24x24/application-x-spss-sps.png \
133 src/ui/gui/icons/mimetypes/256x256/application-x-spss-por.png \
134 src/ui/gui/icons/mimetypes/256x256/application-x-spss-sav.png \
135 src/ui/gui/icons/mimetypes/256x256/application-x-spss-sps.png \
136 src/ui/gui/icons/mimetypes/16x16/application-x-spss-por.png \
137 src/ui/gui/icons/mimetypes/16x16/application-x-spss-sav.png \
138 src/ui/gui/icons/mimetypes/16x16/application-x-spss-sps.png \
139 src/ui/gui/icons/mimetypes/48x48/application-x-spss-por.png \
140 src/ui/gui/icons/mimetypes/48x48/application-x-spss-sav.png \
141 src/ui/gui/icons/mimetypes/48x48/application-x-spss-sps.png \
142
143
144 ICONS=$(MIMETYPE_ICONS)
145
146
147 all: prep_ph  icons
148         $(MAKE) -f Smake Makefile.in configure
149
150 icons: $(ICONS)
151
152 src/ui/gui/icons/manifest:
153         $(RM) $@
154         printf '# This is a generated file. Do not edit.\n' >> $@
155         printf 'icons =' >> $@
156         for i in  $(ICONS); do \
157           printf ' \\\n\t '$$i >> $@; \
158         done
159         echo >> $@
160         echo >> $@
161         printf 'icon_srcs = ' >> $@
162         for i in  $(ICONS); do \
163           printf ' \\\n\t '$$i | sed -e 's/\.png$$/.svg/' -e 's%/icons/%/artwork/%' >> $@ ; \
164         done
165         echo ' ' >> $@
166         echo >> $@
167
168 .PHONY: prep_ph
169 prep_ph: 
170         test -e ChangeLog || touch ChangeLog
171         test -d m4 || mkdir m4
172         touch m4/Makefile.am
173         $(GNULIB_TOOL) --add-import --no-changelog --m4-base=gl/m4 \
174                 --source-base=gl --lib=libgl --tests-base=tests \
175                 --doc-base=gl/doc --aux-dir=build-aux  \
176                 --libtool $(GNULIB_MODULES)
177         if (glibtoolize --version) >/dev/null 2>&1; then        \
178                 LIBTOOLIZE=glibtoolize;                         \
179         elif (libtoolize --version) >/dev/null 2>&1; then       \
180                 LIBTOOLIZE=libtoolize;                          \
181         else                                                    \
182                 echo >&2 "libtoolize not found";                \
183                 exit 1;                                         \
184         fi;                                                     \
185         $$LIBTOOLIZE --force --automake
186
187 aclocal.m4:
188         aclocal -I m4 -I gl/m4
189
190 configure: configure.ac aclocal.m4
191         autoconf
192
193 config.h.in: configure.ac
194         autoheader
195
196 Makefile.in: Makefile.am config.h.in aclocal.m4 src/ui/gui/icons/manifest
197         automake --add-missing --copy --no-force --include-deps
198
199
200 gettextize:
201         test -d m4 || mkdir m4
202         touch m4/Makefile.am
203         gettextize --force --no-changelog
204
205 check: all
206         rm -rf _check
207         mkdir _check
208         cd _check && ../configure $(CONFIGUREFLAGS)
209         cd _check && make distcheck
210         rm -rf _check
211
212 _build: all
213         test -d _build || mkdir _build
214         cd _build && ../configure $(CONFIGUREFLAGS)
215
216 _debug: all
217         test -d _debug || mkdir _debug
218         cd _debug && ../configure $(CONFIGUREFLAGS) --enable-debug
219
220
221
222 PO_FILES = po/ChangeLog \
223 po/Rules-quot po/boldquot.sed           \
224 po/cat-id-tbl.c po/en@boldquot.header po/en@quot.header                 \
225 po/insert-header.sin po/quot.sed po/remove-potcdate.sin po/stamp-po     \
226 po/Makevars.template po/pspp.pot
227
228 clean:
229         rm -f config.sub config.guess config.rpath
230         rm -fr autom4te.cache
231         rm -f aclocal.m4
232         rm -f missing mkinstalldirs
233         rm -f install-sh
234         rm -f configure Makefile 
235         rm -f depcomp
236         rm -rf intl gl
237         rm -f m4/*.m4
238         rm -f $(PO_FILES) po/*.gmo 
239         rm -f mdate-sh texinfo.tex
240         rm -f doc/stamp-vti
241         rm -f config.h.in~
242         rm -f config.h.in
243         find . -name Makefile.in -exec rm -f {} \; 
244         rm -f compile
245         rm -f ltmain.sh
246         rm -f reloc-ldflags install-reloc
247
248 .PHONY: all gettextize clean
249
250 src/ui/gui/icons/%.png: src/ui/gui/artwork/%.svg src/ui/gui/icons/COPYING_CCBYSA3
251         mkdir -p $(dir $@)
252         gimp -i -b '(let* ((image  (car  (gimp-file-load 1  "$<"  "$<"))))  (gimp-image-attach-parasite image (list "gimp-comment" 0 "$(shell cat $(lastword $^))" ))  (gimp-file-save 1 image (car  (gimp-image-get-active-drawable image)) "$@" "$@")) (gimp-quit 1)'
253