From http://www.jwz.org/xscreensaver/xscreensaver-5.30.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 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                   ax_pthread.m4 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 $(MAKE) -C $$dir $@ || exit 5; done
23 MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do $(MAKE) -C $$dir $@ || 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         @$(MAKE) -C po 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) -vczf $$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 configure::
98         aclocal
99         autoconf
100         autoheader
101         @TMP=configure.$$$$ ;                                                \
102         echo "munging configure's --help message..." ;                       \
103         ( perl -e '                                                          \
104                 my $$file="";                                                \
105                 while (<>) { $$file .= $$_; }                                \
106                 $$_ = $$file;                                                \
107                                                                              \
108                 s/^(Configuration:)$$/\n$$1\n/m;                             \
109                 s/^(Directory and file names:)$$/\n$$1\n/m;                  \
110                 s/^  --sbindir=.*\n//m;                                      \
111                 s/^  --sysconfdir.*\n//m;                                    \
112                 s/^  --sharedstatedir.*\n.*\n//m;                            \
113                 s/^  --localstatedir.*\n//m;                                 \
114                 s/^  --infodir.*\n//m;                                       \
115                 s/^(Host type:)$$/\n$$1\n/m;                                 \
116                 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
117                 s/--enable and --with options recognized://m;                \
118                 s/\n  --with-x .*?(["\n])/$$1/s;                             \
119                 s/\n(Installation options:\n)/$$1/s;                         \
120                                                                              \
121                 s/^  --oldincludedir=.*$$/ \
122  --x-includes=DIR        X include files are in DIR\n \
123  --x-libraries=DIR       X library files are in DIR/m; \
124                                                                              \
125                 s@mandir=.\$${prefix}/man.@mandir=\\\$${datadir}/man@;       \
126                                                                              \
127                 s@rm -f conftest@rm -rf conftest@g;                          \
128                                                                              \
129                 print;'                                                      \
130         < configure                                                          \
131         > $$TMP &&                                                           \
132         cat $$TMP > configure ) ;                                            \
133         rm -f $$TMP
134
135 bump-version::
136         @                                                                   \
137   SRC=utils/version.h ;                                                     \
138   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ;     \
139   set - $$VERS ;                                                            \
140   MAJOR="$$1"; MINOR="$$2";                                                 \
141   NEW=`echo $$MINOR + 1 | bc` ;                                             \
142   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
143   D=`date '+%d-%b-%Y'`;                                                     \
144   ADIR=archive/ ;                                                           \
145   if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then             \
146    echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
147   fi ;                                                                      \
148   if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                 \
149     echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
150   fi ;                                                                      \
151   /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";      \
152   read line;                                                                \
153   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
154     exit 1 ;                                                                \
155   fi ;                                                                      \
156   TMP=/tmp/bv.$$ ;                                                          \
157   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
158       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
159         $$SRC > $$TMP ;                                                     \
160   /bin/echo -n "New version and date are ";                                 \
161   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
162      $$TMP;                                                                 \
163   cat $$TMP > $$SRC ;                                                       \
164   rm -f $$TMP;                                                              \
165   echo "overwrote $$SRC";                                                   \
166   ls -lFd $$SRC
167
168 bump_version:: bump-version
169 tick-version:: bump-version
170 tick_version:: bump-version
171
172 version-date::
173         @                                                                   \
174   SRC=utils/version.h ;                                                     \
175   D=`date '+%d-%b-%Y'`;                                                     \
176   TMP=/tmp/bv.$$ ;                                                          \
177   sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ;                         \
178   /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ;                    \
179   if cmp -s $$SRC $$TMP ; then                                              \
180     echo "unchanged." ;                                                     \
181   else                                                                      \
182     cat $$TMP > $$SRC ;                                                     \
183     echo "done." ;                                                          \
184   fi ;                                                                      \
185   rm -f $$TMP
186
187
188 update_spec_version::
189         @S=$(srcdir)/xscreensaver.spec ;                                    \
190         U=$(srcdir)/utils/version.h ;                                       \
191         VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ;      \
192         /bin/echo -n "Updating $$S to \"$$VERS\"... " ;                     \
193         T=/tmp/xs.$$$$ ;                                                    \
194         sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/"                 \
195           < $$S > $$T ;                                                     \
196         if cmp -s $$S $$T ; then                                            \
197           echo "unchanged." ;                                               \
198         else                                                                \
199           cat $$T > $$S ;                                                   \
200           echo "done." ;                                                    \
201         fi ;                                                                \
202         rm $$T
203
204 rpm::
205         @                                                                  \
206   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
207   DIR=`pwd`/rpm_build ;                                                    \
208   ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                    \
209   ADIR=archive/ ;                                                          \
210   TGZ=xscreensaver-$$VERS.tar.gz ;                                         \
211   if [ ! -f $${ADIR}$$TGZ ]; then                                          \
212     echo "$${ADIR}$$TGZ does not exist!  Did you forget to \`make tar'?" ; \
213     exit 1 ;                                                               \
214   fi ;                                                                     \
215   rm -rf /var/tmp/xscreensaver-$$VERS-root ;                               \
216   rm -rf $$DIR ;                                                           \
217   mkdir $$DIR ;                                                            \
218   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
219   cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ;                                     \
220   rpmbuild --define "_topdir $$DIR"                                        \
221            --define "USE_GL yes"                                           \
222            -v -ba xscreensaver.spec ;                                      \
223   echo '' ;                                                                \
224   echo 'RPM build complete' ;                                              \
225   echo '' ;                                                                \
226   rm -f $$DIR/$$TGZ ;                                                      \
227   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
228   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
229   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
230   rm -rf $$DIR ;                                                           \
231   echo '' ;                                                                \
232   ls -lFG xscreensaver*-$$VERS-*.rpm
233
234 test-tar::
235         @                                                                   \
236   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
237   D=xscreensaver-$$VERS ;                                                   \
238   ADIR=archive/ ;                                                           \
239   NAME="$${ADIR}$$D.tar.gz" ;                                               \
240   if [ ! -f $$NAME ]; then                                                  \
241     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
242     exit 1 ;                                                                \
243   fi ;                                                                      \
244                                                                             \
245   set -e ;                                                                  \
246   set -x ;                                                                  \
247                                                                             \
248   if [ -d $$D ]; then                                                       \
249    chmod -R u+w $$D ;                                                       \
250   fi ;                                                                      \
251   rm -rf $$D ;                                                              \
252   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
253   cd $$D ;                                                                  \
254   chmod -R a-w . ;                                                          \
255   chmod u+w . ;                                                             \
256   mkdir BIN ;                                                               \
257   mkdir BIN/motif ;                                                         \
258   mkdir BIN/lesstif ;                                                       \
259   chmod a-w . ;                                                             \
260                                                                             \
261   ( cd BIN/motif ;                                                          \
262     CC=cc ;                                                                 \
263     export CC ;                                                             \
264     ../../configure --without-xpm --without-xdbe --without-xshm             \
265                     --with-motif=/usr/local/motif ;                         \
266     echo --------------------------------------------------------------- ;  \
267     gmake all ;                                                             \
268     ( cd driver; gmake tests ) ;                                            \
269     echo --------------------------------------------------------------- ); \
270                                                                             \
271   ( cd BIN/lesstif ;                                                        \
272     CC=cc ;                                                                 \
273     export CC ;                                                             \
274     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
275     echo --------------------------------------------------------------- ;  \
276     ( cd utils; 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
285 www::
286         @                                                                   \
287   DEST=$$HOME/www/xscreensaver ;                                            \
288   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
289   HEAD="xscreensaver-$$VERS" ;                                              \
290   ADIR=archive/ ;                                                           \
291   BNAME="$$HEAD.tar.gz" ;                                                   \
292   NAME="$$ADIR$$BNAME" ;                                                    \
293   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
294   BNAME2="$$HEAD.dmg" ;                                                     \
295   NAME2="$$ADIR$$BNAME2" ;                                                  \
296   DNAME2="$$DEST/$$HEAD.dmg" ;                                              \
297                                                                             \
298   if ! git diff --quiet ; then                                              \
299     echo "uncommitted changes exist!" ;                                     \
300     exit 1 ;                                                                \
301   fi ;                                                                      \
302                                                                             \
303   $(MAKE) -C OSX updates.xml ;                                              \
304                                                                             \
305   if [ ! -f $$NAME ]; then                                                  \
306     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
307     exit 1 ;                                                                \
308   fi ;                                                                      \
309   if [ ! -f $$NAME2 ]; then                                                 \
310     echo "$$NAME2 does not exist!  Did you forget to \`make dmg'?" ;        \
311     exit 1 ;                                                                \
312   fi ;                                                                      \
313   chmod a-w $$NAME ;                                                        \
314   if [ -f $$DNAME ]; then                                                   \
315     /bin/echo -n "WARNING: $$DNAME already exists!  Overwrite? ";           \
316     read line;                                                              \
317     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
318       exit 1 ;                                                              \
319     fi ;                                                                    \
320   fi ;                                                                      \
321   if [ -f $$DNAME2 ]; then                                                  \
322     /bin/echo -n "WARNING: $$DNAME2 already exists!  Overwrite? ";          \
323     read line;                                                              \
324     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
325       exit 1 ;                                                              \
326     fi ;                                                                    \
327   fi ;                                                                      \
328                                                                             \
329   git commit -a -m "$$VERS" . ;                                             \
330   git tag -a "v$$VERS" -m "$$VERS" . ;                                      \
331                                                                             \
332   ( cd $$DEST ; git pull . ) ;                                              \
333                                                                             \
334   cp -p $$NAME $$DNAME ;                                                    \
335   cp -p $$NAME2 $$DNAME2 ;                                                  \
336   chmod u+w $$DNAME $$DNAME2 ;                                              \
337   cp -p OSX/updates.xml $$DEST ;                                            \
338   cd $$DEST ;                                                               \
339                                                                             \
340   TMP=/tmp/xd.$$$$ ;                                                        \
341   sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ;    \
342   echo '' ;                                                                 \
343   diff -U0 download.html $$TMP ;                                            \
344   echo '' ;                                                                 \
345                                                                             \
346   for EXT in tar.gz dmg ; do                                                \
347     OLDEST=`ls xscreensaver*.$$EXT |                                        \
348       fgrep -v 5.14 |                                                       \
349       head -n 1` ;                                                          \
350     /bin/echo -n "Delete $$DEST/$$OLDEST? ";                                \
351     read line;                                                              \
352     if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                     \
353       set -x ;                                                              \
354       rm $$OLDEST ;                                                         \
355       git rm $$OLDEST ;                                                     \
356       set +x ;                                                              \
357     fi ;                                                                    \
358   done ;                                                                    \
359   set -x ;                                                                  \
360   cat $$TMP > download.html ;                                               \
361   rm -f $$TMP ;                                                             \
362                                                                             \
363   git add $$BNAME $$BNAME2 ;                                                \
364                                                                             \
365   $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
366   git diff changelog.html ;                                                 \
367   set +x ;                                                                  \
368                                                                             \
369   /bin/echo -n "Ok? ";                                                      \
370   read line;                                                                \
371   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
372     exit 1 ;                                                                \
373   fi ;                                                                      \
374                                                                             \
375   git commit -m "$$VERS" . ;                                                \
376   git tag -a "v$$VERS" -m "$$VERS" ;                                        \
377   git push ;                                                                \
378
379
380 count::
381         @ \
382   /bin/echo -n "Current hack count: " ; \
383   ( ( cd hacks;     make -s INSTALL=true install-program install-scripts ) ; \
384     ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \
385     grep true | \
386     grep -v helper | \
387     grep -v ljlatest | \
388     wc -l