From http://www.jwz.org/xscreensaver/xscreensaver-5.37.tar.gz
[xscreensaver] / Makefile.in
1 # Makefile.in --- xscreensaver, Copyright (c) 1999-2014 Jamie Zawinski.
2 # the `../configure' script generates `Makefile' from this file.
3
4 @SET_MAKE@
5 srcdir          = @srcdir@
6 VPATH           = @srcdir@
7
8 SHELL           = /bin/sh
9 SUBDIRS         = utils jwxyz hacks hacks/glx driver po
10 SUBDIRS2        = $(SUBDIRS) OSX android
11 TARFILES        = README README.hacking README.VMS INSTALL \
12                   configure configure.in Makefile.in config.h.in \
13                   config.h-vms install-sh setup.com config.guess aclocal.m4 \
14                   ax_pthread.m4 config.sub makevms.com \
15                   intltool-merge.in intltool-extract.in intltool-update.in \
16                   xscreensaver.spec \
17                   OSX/xscreensaver.xcodeproj/project.pbxproj
18
19 TAR             = tar
20
21 MAKE_SUBDIR  = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
22 MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do (cd $$dir; $(MAKE) $@) || exit 5; done
23
24 default::
25         @+$(MAKE_SUBDIR)
26 all::
27         @+$(MAKE_SUBDIR)
28 install::
29         @+$(MAKE_SUBDIR)
30 install-program::
31         @+$(MAKE_SUBDIR)
32 install-man::
33         @+$(MAKE_SUBDIR)
34 install-strip::
35         @+$(MAKE_SUBDIR)
36 uninstall::
37         @$(MAKE_SUBDIR)
38 uninstall-program::
39         @$(MAKE_SUBDIR)
40 uninstall-man::
41         @$(MAKE_SUBDIR)
42 depend::
43         @$(MAKE_SUBDIR)
44 distdepend::
45         @$(MAKE) update_spec_version
46         @$(MAKE_SUBDIR2)
47         @cd po ; $(MAKE) update-po
48
49 TAGS:: tags
50 tags::
51         @$(MAKE_SUBDIR)
52
53 clean::
54         @$(MAKE_SUBDIR2)
55
56 distclean:: clean
57         -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"* intltool-extract intltool-merge intltool-update
58         @$(MAKE_SUBDIR2)
59
60 dist:: tar
61
62 # This really makes me sick...
63 tar::
64         @                                                                   \
65   sh config.status ;                                                        \
66   rm -f configure ;                                                         \
67   $(MAKE) configure ;                                                       \
68   $(MAKE) version-date distdepend ;                                         \
69   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
70   NAME="xscreensaver-$$VERS" ;                                              \
71   rm -rf $$NAME ; ln -s . $$NAME ;                                          \
72   FILES= ;                                                                  \
73   ADIR=archive/ ;                                                           \
74   for subdir in $(SUBDIRS2) ; do                                            \
75     d=`pwd` ;                                                               \
76     cd $$subdir ;                                                           \
77     FILES="$$FILES `$(MAKE) echo_tarfiles                                   \
78       | grep -v '^.*make\['                                                 \
79       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                            \
80       ` ";                                                                  \
81     cd $$d ; done ;                                                         \
82   echo creating tar file $$ADIR$$NAME.tar.gz... ;                           \
83   export COPYFILE_DISABLE=true ;                                            \
84   GZIP="-9v" $(TAR) -vczf $$ADIR$$NAME.tar.gz                               \
85     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ;     \
86   rm $$NAME
87
88
89 # This also makes me sick...
90 # autoconf generates a configure script that begins with a very hard to read,
91 # nearly impossible to customize --help blurb.  This horrid set of regexps
92 # go through and clean up the help text, by inserting whitespace and ripping
93 # out options we don't use.  Odds are good that this will fail with any version
94 # of autoconf other than the ones I've tried (2.12 and 2.13.)
95 #
96 configure::
97         aclocal
98         autoconf
99         autoheader
100         @TMP=configure.$$$$ ;                                                \
101         echo "munging configure's --help message..." ;                       \
102         ( perl -e '                                                          \
103                 my $$file="";                                                \
104                 while (<>) { $$file .= $$_; }                                \
105                 $$_ = $$file;                                                \
106                                                                              \
107                 s/^(Configuration:)$$/\n$$1\n/m;                             \
108                 s/^(Directory and file names:)$$/\n$$1\n/m;                  \
109                 s/^  --sbindir=.*\n//m;                                      \
110                 s/^  --sysconfdir.*\n//m;                                    \
111                 s/^  --sharedstatedir.*\n.*\n//m;                            \
112                 s/^  --localstatedir.*\n//m;                                 \
113                 s/^  --infodir.*\n//m;                                       \
114                 s/^(Host type:)$$/\n$$1\n/m;                                 \
115                 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
116                 s/--enable and --with options recognized://m;                \
117                 s/\n  --with-x .*?(["\n])/$$1/s;                             \
118                 s/\n(Installation options:\n)/$$1/s;                         \
119                                                                              \
120                 s/^  --oldincludedir=.*$$/ \
121  --x-includes=DIR        X include files are in DIR\n \
122  --x-libraries=DIR       X library files are in DIR/m; \
123                                                                              \
124                 s@mandir=.\$${prefix}/man.@mandir=\\\$${datadir}/man@;       \
125                                                                              \
126                 s@rm -f conftest@rm -rf conftest@g;                          \
127                                                                              \
128                 print;'                                                      \
129         < configure                                                          \
130         > $$TMP &&                                                           \
131         cat $$TMP > configure ) ;                                            \
132         rm -f $$TMP
133
134 bump-version::
135         @                                                                   \
136   SRC=utils/version.h ;                                                     \
137   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ;     \
138   set - $$VERS ;                                                            \
139   MAJOR="$$1"; MINOR="$$2";                                                 \
140   NEW=`echo $$MINOR + 1 | bc` ;                                             \
141   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
142   D=`date '+%d-%b-%Y'`;                                                     \
143   ADIR=archive/ ;                                                           \
144   if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then             \
145    echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
146   fi ;                                                                      \
147   if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                 \
148     echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
149   fi ;                                                                      \
150   /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";      \
151   read line;                                                                \
152   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
153     exit 1 ;                                                                \
154   fi ;                                                                      \
155   TMP=/tmp/bv.$$ ;                                                          \
156   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
157       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
158         $$SRC > $$TMP ;                                                     \
159   /bin/echo -n "New version and date are ";                                 \
160   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
161      $$TMP;                                                                 \
162   cat $$TMP > $$SRC ;                                                       \
163   rm -f $$TMP;                                                              \
164   echo "overwrote $$SRC";                                                   \
165   ls -lFd $$SRC
166
167 bump_version:: bump-version
168 tick-version:: bump-version
169 tick_version:: bump-version
170
171 version-date::
172         @                                                                   \
173   SRC=utils/version.h ;                                                     \
174   D=`date '+%d-%b-%Y'`;                                                     \
175   TMP=/tmp/bv.$$ ;                                                          \
176   sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ;                         \
177   /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ;                    \
178   if cmp -s $$SRC $$TMP ; then                                              \
179     echo "unchanged." ;                                                     \
180   else                                                                      \
181     cat $$TMP > $$SRC ;                                                     \
182     echo "done." ;                                                          \
183   fi ;                                                                      \
184   rm -f $$TMP
185
186
187 update_spec_version::
188         @S=$(srcdir)/xscreensaver.spec ;                                    \
189         U=$(srcdir)/utils/version.h ;                                       \
190         VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ;      \
191         /bin/echo -n "Updating $$S to \"$$VERS\"... " ;                     \
192         T=/tmp/xs.$$$$ ;                                                    \
193         sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/"                 \
194           < $$S > $$T ;                                                     \
195         if cmp -s $$S $$T ; then                                            \
196           echo "unchanged." ;                                               \
197         else                                                                \
198           cat $$T > $$S ;                                                   \
199           echo "done." ;                                                    \
200         fi ;                                                                \
201         rm $$T
202
203 rpm::
204         @                                                                  \
205   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
206   DIR=`pwd`/rpm_build ;                                                    \
207   ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                    \
208   ADIR=archive/ ;                                                          \
209   TGZ=xscreensaver-$$VERS.tar.gz ;                                         \
210   if [ ! -f $${ADIR}$$TGZ ]; then                                          \
211     echo "$${ADIR}$$TGZ does not exist!  Did you forget to \`make tar'?" ; \
212     exit 1 ;                                                               \
213   fi ;                                                                     \
214   rm -rf /var/tmp/xscreensaver-$$VERS-root ;                               \
215   rm -rf $$DIR ;                                                           \
216   mkdir $$DIR ;                                                            \
217   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
218   cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ;                                     \
219   rpmbuild --define "_topdir $$DIR"                                        \
220            --define "USE_GL yes"                                           \
221            -v -ba xscreensaver.spec ;                                      \
222   echo '' ;                                                                \
223   echo 'RPM build complete' ;                                              \
224   echo '' ;                                                                \
225   rm -f $$DIR/$$TGZ ;                                                      \
226   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
227   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
228   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
229   rm -rf $$DIR ;                                                           \
230   echo '' ;                                                                \
231   ls -lFG xscreensaver*-$$VERS-*.rpm
232
233 test-tar::
234         @                                                                   \
235   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
236   D=xscreensaver-$$VERS ;                                                   \
237   ADIR=archive/ ;                                                           \
238   NAME="$${ADIR}$$D.tar.gz" ;                                               \
239   if [ ! -f $$NAME ]; then                                                  \
240     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
241     exit 1 ;                                                                \
242   fi ;                                                                      \
243                                                                             \
244   set -e ;                                                                  \
245   set -x ;                                                                  \
246                                                                             \
247   if [ -d $$D ]; then                                                       \
248    chmod -R u+w $$D ;                                                       \
249   fi ;                                                                      \
250   rm -rf $$D ;                                                              \
251   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
252   cd $$D ;                                                                  \
253   chmod -R a-w . ;                                                          \
254   chmod u+w . ;                                                             \
255   mkdir BIN ;                                                               \
256   mkdir BIN/motif ;                                                         \
257   mkdir BIN/lesstif ;                                                       \
258   chmod a-w . ;                                                             \
259                                                                             \
260   ( cd BIN/motif ;                                                          \
261     CC=cc ;                                                                 \
262     export CC ;                                                             \
263     ../../configure --without-xpm --without-xdbe --without-xshm             \
264                     --with-motif=/usr/local/motif ;                         \
265     echo --------------------------------------------------------------- ;  \
266     gmake all ;                                                             \
267     ( cd driver; gmake tests ) ;                                            \
268     echo --------------------------------------------------------------- ); \
269                                                                             \
270   ( cd BIN/lesstif ;                                                        \
271     CC=cc ;                                                                 \
272     export CC ;                                                             \
273     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
274     echo --------------------------------------------------------------- ;  \
275     ( cd utils; gmake all ) ;                                               \
276     ( cd jwxyz; gmake all ) ;                                               \
277     ( cd driver; gmake all ) ;                                              \
278     echo --------------------------------------------------------------- ); \
279                                                                             \
280   chmod -R u+w .
281
282 dmg::
283         $(MAKE) -C OSX release dmg
284 apk::
285         $(MAKE) -C android apk
286
287 www::
288         @                                                                   \
289   DEST=$$HOME/www/xscreensaver ;                                            \
290   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
291   HEAD="xscreensaver-$$VERS" ;                                              \
292   ADIR=archive/ ;                                                           \
293   BNAME="$$HEAD.tar.gz" ;                                                   \
294   NAME="$$ADIR$$BNAME" ;                                                    \
295   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
296   BNAME2="$$HEAD.dmg" ;                                                     \
297   NAME2="$$ADIR$$BNAME2" ;                                                  \
298   DNAME2="$$DEST/$$HEAD.dmg" ;                                              \
299   BNAME3="$$HEAD.apk" ;                                                     \
300   NAME3="$$ADIR$$BNAME3" ;                                                  \
301   DNAME3="$$DEST/$$HEAD.apk" ;                                              \
302                                                                             \
303   if ! git diff --quiet ; then                                              \
304     echo "uncommitted changes exist!" ;                                     \
305     exit 1 ;                                                                \
306   fi ;                                                                      \
307                                                                             \
308   $(MAKE) -C OSX updates.xml ;                                              \
309                                                                             \
310   if [ ! -f $$NAME ]; then                                                  \
311     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
312     exit 1 ;                                                                \
313   fi ;                                                                      \
314   if [ ! -f $$NAME2 ]; then                                                 \
315     echo "$$NAME2 does not exist!  Did you forget to \`make dmg'?" ;        \
316     exit 1 ;                                                                \
317   fi ;                                                                      \
318   if [ ! -f $$NAME3 ]; then                                                 \
319     echo "$$NAME3 does not exist!  Did you forget to \`make apk'?" ;        \
320     exit 1 ;                                                                \
321   fi ;                                                                      \
322   chmod a-w $$NAME ;                                                        \
323   if [ -f $$DNAME ]; then                                                   \
324     /bin/echo -n "WARNING: $$DNAME already exists!  Overwrite? ";           \
325     read line;                                                              \
326     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
327       exit 1 ;                                                              \
328     fi ;                                                                    \
329   fi ;                                                                      \
330   if [ -f $$DNAME2 ]; then                                                  \
331     /bin/echo -n "WARNING: $$DNAME2 already exists!  Overwrite? ";          \
332     read line;                                                              \
333     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
334       exit 1 ;                                                              \
335     fi ;                                                                    \
336   fi ;                                                                      \
337   if [ -f $$DNAME3 ]; then                                                  \
338     /bin/echo -n "WARNING: $$DNAME3 already exists!  Overwrite? ";          \
339     read line;                                                              \
340     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
341       exit 1 ;                                                              \
342     fi ;                                                                    \
343   fi ;                                                                      \
344                                                                             \
345   git tag -a "v$$VERS" -m "$$VERS" ;                                        \
346   git commit -m "$$VERS" . ;                                                \
347                                                                             \
348   ( cd $$DEST ; git pull ) ;                                                \
349                                                                             \
350   cp -p $$NAME $$DNAME ;                                                    \
351   cp -p $$NAME2 $$DNAME2 ;                                                  \
352   cp -p $$NAME3 $$DNAME3 ;                                                  \
353   chmod u+w $$DNAME $$DNAME2 $$DNAME3 ;                                     \
354   cp -p OSX/updates.xml $$DEST ;                                            \
355   cd $$DEST ;                                                               \
356                                                                             \
357   TMP=/tmp/xd.$$$$ ;                                                        \
358   sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ;    \
359   echo '' ;                                                                 \
360   diff -U0 download.html $$TMP ;                                            \
361   echo '' ;                                                                 \
362                                                                             \
363   for EXT in tar.gz dmg ; do                                                \
364     OLDEST=`ls xscreensaver*.$$EXT |                                        \
365       fgrep -v 5.14 |                                                       \
366       head -n 1` ;                                                          \
367     /bin/echo -n "Delete $$DEST/$$OLDEST? ";                                \
368     read line;                                                              \
369     if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                     \
370       set -x ;                                                              \
371       rm $$OLDEST ;                                                         \
372       git rm $$OLDEST ;                                                     \
373       set +x ;                                                              \
374     fi ;                                                                    \
375   done ;                                                                    \
376   set -x ;                                                                  \
377   cat $$TMP > download.html ;                                               \
378   rm -f $$TMP ;                                                             \
379                                                                             \
380   git add $$BNAME $$BNAME2 $$BNAME3 ;                                       \
381                                                                             \
382   $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
383   git diff changelog.html ;                                                 \
384   set +x ;                                                                  \
385                                                                             \
386   /bin/echo -n "Ok? ";                                                      \
387   read line;                                                                \
388   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
389     exit 1 ;                                                                \
390   fi ;                                                                      \
391                                                                             \
392   git tag -a "v$$VERS" -m "$$VERS" ;                                        \
393   git commit -m "$$VERS" . ;                                                \
394   git push ;                                                                \
395
396
397 count::
398         @ \
399   /bin/echo -n "Current hack count: " ; \
400   ( ( cd hacks;     make -s INSTALL=true install-program install-scripts ) ; \
401     ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \
402     grep true | \
403     grep -v helper | \
404     grep -v ljlatest | \
405     wc -l