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