From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[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         -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"* intltool-extract intltool-merge intltool-update
59         @$(MAKE_SUBDIR2)
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   export COPYFILE_DISABLE=true ;                                            \
85   GZIP="-9v" $(TAR) -vchzf $$ADIR$$NAME.tar.gz                              \
86     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ;     \
87   rm $$NAME
88
89
90 # This also makes me sick...
91 # autoconf generates a configure script that begins with a very hard to read,
92 # nearly impossible to customize --help blurb.  This horrid set of regexps
93 # go through and clean up the help text, by inserting whitespace and ripping
94 # out options we don't use.  Odds are good that this will fail with any version
95 # of autoconf other than the ones I've tried (2.12 and 2.13.)
96 #
97 # NOTE: we now require autoconf 2.63 or earlier, because later versions have
98 # the "Expanded-Before-Required" change and I can't make any sense of it.
99 # If someone wants to send me a patch to make configure.in work with 2.64
100 # or later, feel free.  Personally, I can't be bothered.
101 #
102 configure::
103         autoconf263
104         autoheader263
105         @TMP=configure.$$$$ ;                                                \
106         echo "munging configure's --help message..." ;                       \
107         ( perl -e '                                                          \
108                 my $$file="";                                                \
109                 while (<>) { $$file .= $$_; }                                \
110                 $$_ = $$file;                                                \
111                                                                              \
112                 s/^(Configuration:)$$/\n$$1\n/m;                             \
113                 s/^(Directory and file names:)$$/\n$$1\n/m;                  \
114                 s/^  --sbindir=.*\n//m;                                      \
115                 s/^  --sysconfdir.*\n//m;                                    \
116                 s/^  --sharedstatedir.*\n.*\n//m;                            \
117                 s/^  --localstatedir.*\n//m;                                 \
118                 s/^  --infodir.*\n//m;                                       \
119                 s/^(Host type:)$$/\n$$1\n/m;                                 \
120                 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
121                 s/--enable and --with options recognized://m;                \
122                 s/\n  --with-x .*?(["\n])/$$1/s;                             \
123                 s/\n(Installation options:\n)/$$1/s;                         \
124                                                                              \
125                 s/^  --oldincludedir=.*$$/ \
126  --x-includes=DIR        X include files are in DIR\n \
127  --x-libraries=DIR       X library files are in DIR/m; \
128                                                                              \
129                 s@mandir=.\$${prefix}/man.@mandir=\\\$${datadir}/man@;       \
130                                                                              \
131                 s@rm -f conftest@rm -rf conftest@g;                          \
132                                                                              \
133                 print;'                                                      \
134         < configure                                                          \
135         > $$TMP &&                                                           \
136         cat $$TMP > configure ) ;                                            \
137         rm -f $$TMP
138
139 bump-version::
140         @                                                                   \
141   SRC=utils/version.h ;                                                     \
142   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ;     \
143   set - $$VERS ;                                                            \
144   MAJOR="$$1"; MINOR="$$2";                                                 \
145   NEW=`echo $$MINOR + 1 | bc` ;                                             \
146   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
147   D=`date '+%d-%b-%Y'`;                                                     \
148   ADIR=archive/ ;                                                           \
149   if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then             \
150    echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
151   fi ;                                                                      \
152   if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                 \
153     echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
154   fi ;                                                                      \
155   /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";      \
156   read line;                                                                \
157   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
158     exit 1 ;                                                                \
159   fi ;                                                                      \
160   TMP=/tmp/bv.$$ ;                                                          \
161   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
162       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
163         $$SRC > $$TMP ;                                                     \
164   /bin/echo -n "New version and date are ";                                 \
165   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
166      $$TMP;                                                                 \
167   cat $$TMP > $$SRC ;                                                       \
168   rm -f $$TMP;                                                              \
169   echo "overwrote $$SRC";                                                   \
170   ls -lFd $$SRC
171
172 bump_version:: bump-version
173 tick-version:: bump-version
174 tick_version:: bump-version
175
176 version-date::
177         @                                                                   \
178   SRC=utils/version.h ;                                                     \
179   D=`date '+%d-%b-%Y'`;                                                     \
180   TMP=/tmp/bv.$$ ;                                                          \
181   sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ;                         \
182   /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ;                    \
183   if cmp -s $$SRC $$TMP ; then                                              \
184     echo "unchanged." ;                                                     \
185   else                                                                      \
186     cat $$TMP > $$SRC ;                                                     \
187     echo "done." ;                                                          \
188   fi ;                                                                      \
189   rm -f $$TMP
190
191
192 update_spec_version::
193         @S=$(srcdir)/xscreensaver.spec ;                                    \
194         U=$(srcdir)/utils/version.h ;                                       \
195         VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ;      \
196         /bin/echo -n "Updating $$S to \"$$VERS\"... " ;                     \
197         T=/tmp/xs.$$$$ ;                                                    \
198         sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/"                 \
199           < $$S > $$T ;                                                     \
200         if cmp -s $$S $$T ; then                                            \
201           echo "unchanged." ;                                               \
202         else                                                                \
203           cat $$T > $$S ;                                                   \
204           echo "done." ;                                                    \
205         fi ;                                                                \
206         rm $$T
207
208 rpm::
209         @                                                                  \
210   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
211   DIR=`pwd`/rpm_build ;                                                    \
212   ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                    \
213   ADIR=archive/ ;                                                          \
214   TGZ=xscreensaver-$$VERS.tar.gz ;                                         \
215   if [ ! -f $${ADIR}$$TGZ ]; then                                          \
216     echo "$${ADIR}$$TGZ does not exist!  Did you forget to \`make tar'?" ; \
217     exit 1 ;                                                               \
218   fi ;                                                                     \
219   rm -rf /var/tmp/xscreensaver-$$VERS-root ;                               \
220   rm -rf $$DIR ;                                                           \
221   mkdir $$DIR ;                                                            \
222   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
223   cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ;                                     \
224   rpmbuild --define "_topdir $$DIR"                                        \
225            --define "USE_GL yes"                                           \
226            -v -ba xscreensaver.spec ;                                      \
227   echo '' ;                                                                \
228   echo 'RPM build complete' ;                                              \
229   echo '' ;                                                                \
230   rm -f $$DIR/$$TGZ ;                                                      \
231   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
232   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
233   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
234   rm -rf $$DIR ;                                                           \
235   echo '' ;                                                                \
236   ls -lFG xscreensaver*-$$VERS-*.rpm
237
238 test-tar::
239         @                                                                   \
240   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
241   D=xscreensaver-$$VERS ;                                                   \
242   ADIR=archive/ ;                                                           \
243   NAME="$${ADIR}$$D.tar.gz" ;                                               \
244   if [ ! -f $$NAME ]; then                                                  \
245     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
246     exit 1 ;                                                                \
247   fi ;                                                                      \
248                                                                             \
249   set -e ;                                                                  \
250   set -x ;                                                                  \
251                                                                             \
252   if [ -d $$D ]; then                                                       \
253    chmod -R u+w $$D ;                                                       \
254   fi ;                                                                      \
255   rm -rf $$D ;                                                              \
256   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
257   cd $$D ;                                                                  \
258   chmod -R a-w . ;                                                          \
259   chmod u+w . ;                                                             \
260   mkdir BIN ;                                                               \
261   mkdir BIN/motif ;                                                         \
262   mkdir BIN/lesstif ;                                                       \
263   chmod a-w . ;                                                             \
264                                                                             \
265   ( cd BIN/motif ;                                                          \
266     CC=cc ;                                                                 \
267     export CC ;                                                             \
268     ../../configure --without-xpm --without-xdbe --without-xshm             \
269                     --with-motif=/usr/local/motif ;                         \
270     echo --------------------------------------------------------------- ;  \
271     gmake all ;                                                             \
272     ( cd driver; gmake tests ) ;                                            \
273     echo --------------------------------------------------------------- ); \
274                                                                             \
275   ( cd BIN/lesstif ;                                                        \
276     CC=cc ;                                                                 \
277     export CC ;                                                             \
278     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
279     echo --------------------------------------------------------------- ;  \
280     ( cd utils; gmake all ) ;                                               \
281     ( cd driver; gmake all ) ;                                              \
282     echo --------------------------------------------------------------- ); \
283                                                                             \
284   chmod -R u+w .
285
286 dmg::
287         cd OSX ; $(MAKE) release dmg
288
289 www::
290         @                                                                   \
291   DEST=$$HOME/www/xscreensaver ;                                            \
292   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
293   HEAD="xscreensaver-$$VERS" ;                                              \
294   ADIR=archive/ ;                                                           \
295   BNAME="$$HEAD.tar.gz" ;                                                   \
296   NAME="$$ADIR$$BNAME" ;                                                    \
297   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
298   BNAME2="$$HEAD.dmg" ;                                                     \
299   NAME2="$$ADIR$$BNAME2" ;                                                  \
300   DNAME2="$$DEST/$$HEAD.dmg" ;                                              \
301                                                                             \
302   if [ ! -f $$NAME ]; then                                                  \
303     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
304     exit 1 ;                                                                \
305   fi ;                                                                      \
306   if [ ! -f $$NAME2 ]; then                                                 \
307     echo "$$NAME2 does not exist!  Did you forget to \`make dmg'?" ;        \
308     exit 1 ;                                                                \
309   fi ;                                                                      \
310   chmod a-w $$NAME ;                                                        \
311   if [ -f $$DNAME ]; then                                                   \
312     /bin/echo -n "WARNING: $$DNAME already exists!  Overwrite? ";           \
313     read line;                                                              \
314     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
315       exit 1 ;                                                              \
316     fi ;                                                                    \
317   fi ;                                                                      \
318   if [ -f $$DNAME2 ]; then                                                  \
319     /bin/echo -n "WARNING: $$DNAME2 already exists!  Overwrite? ";          \
320     read line;                                                              \
321     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
322       exit 1 ;                                                              \
323     fi ;                                                                    \
324   fi ;                                                                      \
325   cp -p $$NAME $$DNAME ;                                                    \
326   cp -p $$NAME2 $$DNAME2 ;                                                  \
327   chmod u+w $$DNAME $$DNAME2 ;                                              \
328   cd $$DEST ;                                                               \
329                                                                             \
330   TMP=/tmp/xd.$$$$ ;                                                        \
331   sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ;    \
332   echo '' ;                                                                 \
333   diff -U0 download.html $$TMP ;                                            \
334   echo '' ;                                                                 \
335                                                                             \
336   for EXT in tar.gz dmg ; do                                                \
337     OLDEST=`ls xscreensaver*.$$EXT | head -n 1` ;                           \
338     /bin/echo -n "Delete $$DEST/$$OLDEST? ";                                \
339     read line;                                                              \
340     if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                     \
341       set -x ;                                                              \
342       rm $$OLDEST ;                                                         \
343       cvs remove $$OLDEST ;                                                 \
344       set +x ;                                                              \
345     fi ;                                                                    \
346   done ;                                                                    \
347   set -x ;                                                                  \
348   cvs add -kb $$BNAME $$BNAME2 ;                                            \
349   cat $$TMP > download.html ;                                               \
350   rm -f $$TMP ;                                                             \
351                                                                             \
352   (cd ..; $(MAKE) xscreensaver/changelog.html                               \
353                   xscreensaver/screenshots/index.html );                    \
354   cvs diff -U0 changelog.html ;                                             \
355   set +x ;                                                                  \
356                                                                             \
357   /bin/echo -n "Ok? ";                                                      \
358   read line;                                                                \
359   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
360     exit 1 ;                                                                \
361   fi ;                                                                      \
362                                                                             \
363   cvs commit -m "$$VERS"
364
365
366 count::
367         @ \
368   /bin/echo -n "Current hack count: " ; \
369   ( ( cd hacks;     make -s INSTALL=true install-program install-scripts ) ; \
370     ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \
371     grep true | \
372     grep -v helper | \
373     grep -v ljlatest | \
374     wc -l