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