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