8f74c1f20622b4c5d73c91409f8f88195531cdb8
[xscreensaver] / Makefile.in
1 # Makefile.in --- xscreensaver, Copyright (c) 1999-2005 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) generate_potfiles_in
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                 print;'                                                      \
125         < configure                                                          \
126         > $$TMP &&                                                           \
127         cat $$TMP > configure ) ;                                            \
128         rm -f $$TMP
129
130 bump-version::
131         @                                                                   \
132   SRC=utils/version.h ;                                                     \
133   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ;     \
134   set - $$VERS ;                                                            \
135   MAJOR="$$1"; MINOR="$$2";                                                 \
136   NEW=`echo $$MINOR + 1 | bc` ;                                             \
137   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
138   D=`date '+%d-%b-%Y'`;                                                     \
139   ADIR=archive/ ;                                                           \
140   if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then             \
141    echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
142   fi ;                                                                      \
143   if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                 \
144     echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
145   fi ;                                                                      \
146   /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";      \
147   read line;                                                                \
148   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
149     exit 1 ;                                                                \
150   fi ;                                                                      \
151   TMP=/tmp/bv.$$ ;                                                          \
152   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
153       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
154         $$SRC > $$TMP ;                                                     \
155   /bin/echo -n "New version and date are ";                                 \
156   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
157      $$TMP;                                                                 \
158   cat $$TMP > $$SRC ;                                                       \
159   rm -f $$TMP;                                                              \
160   echo "overwrote $$SRC";                                                   \
161   ls -lFd $$SRC
162
163 bump_version:: bump-version
164 tick-version:: bump-version
165 tick_version:: bump-version
166
167 version-date::
168         @                                                                   \
169   SRC=utils/version.h ;                                                     \
170   D=`date '+%d-%b-%Y'`;                                                     \
171   TMP=/tmp/bv.$$ ;                                                          \
172   sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ;                         \
173   /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ;                    \
174   if cmp -s $$SRC $$TMP ; then                                              \
175     echo "unchanged." ;                                                     \
176   else                                                                      \
177     cat $$TMP > $$SRC ;                                                     \
178     echo "done." ;                                                          \
179   fi ;                                                                      \
180   rm -f $$TMP
181
182
183 update_spec_version::
184         @S=$(srcdir)/xscreensaver.spec ;                                    \
185         U=$(srcdir)/utils/version.h ;                                       \
186         VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ;      \
187         /bin/echo -n "Updating $$S to \"$$VERS\"... " ;                     \
188         T=/tmp/xs.$$$$ ;                                                    \
189         sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/"                 \
190           < $$S > $$T ;                                                     \
191         if cmp -s $$S $$T ; then                                            \
192           echo "unchanged." ;                                               \
193         else                                                                \
194           cat $$T > $$S ;                                                   \
195           echo "done." ;                                                    \
196         fi ;                                                                \
197         rm $$T
198
199 rpm::
200         @                                                                  \
201   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
202   DIR=`pwd`/rpm_build ;                                                    \
203   ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                    \
204   ADIR=archive/ ;                                                          \
205   TGZ=xscreensaver-$$VERS.tar.gz ;                                         \
206   if [ ! -f $${ADIR}$$TGZ ]; then                                          \
207     echo "$${ADIR}$$TGZ does not exist!  Did you forget to \`make tar'?" ; \
208     exit 1 ;                                                               \
209   fi ;                                                                     \
210   rm -rf /var/tmp/xscreensaver-$$VERS-root ;                               \
211   rm -rf $$DIR ;                                                           \
212   mkdir $$DIR ;                                                            \
213   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
214   cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ;                                     \
215   rpmbuild --define "_topdir $$DIR"                                        \
216            --define "USE_GL yes"                                           \
217            -v -ba xscreensaver.spec ;                                      \
218   echo '' ;                                                                \
219   echo 'RPM build complete' ;                                              \
220   echo '' ;                                                                \
221   rm -f $$DIR/$$TGZ ;                                                      \
222   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
223   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
224   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
225   rm -rf $$DIR ;                                                           \
226   echo '' ;                                                                \
227   ls -lFG xscreensaver*-$$VERS-*.rpm
228
229 test-tar::
230         @                                                                   \
231   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
232   D=xscreensaver-$$VERS ;                                                   \
233   ADIR=archive/ ;                                                           \
234   NAME="$${ADIR}$$D.tar.gz" ;                                               \
235   if [ ! -f $$NAME ]; then                                                  \
236     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
237     exit 1 ;                                                                \
238   fi ;                                                                      \
239                                                                             \
240   set -e ;                                                                  \
241   set -x ;                                                                  \
242                                                                             \
243   if [ -d $$D ]; then                                                       \
244    chmod -R u+w $$D ;                                                       \
245   fi ;                                                                      \
246   rm -rf $$D ;                                                              \
247   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
248   cd $$D ;                                                                  \
249   chmod -R a-w . ;                                                          \
250   chmod u+w . ;                                                             \
251   mkdir BIN ;                                                               \
252   mkdir BIN/motif ;                                                         \
253   mkdir BIN/lesstif ;                                                       \
254   chmod a-w . ;                                                             \
255                                                                             \
256   ( cd BIN/motif ;                                                          \
257     CC=cc ;                                                                 \
258     export CC ;                                                             \
259     ../../configure --without-xpm --without-xdbe --without-xshm             \
260                     --with-motif=/usr/local/motif ;                         \
261     echo --------------------------------------------------------------- ;  \
262     gmake all ;                                                             \
263     ( cd driver; gmake tests ) ;                                            \
264     echo --------------------------------------------------------------- ); \
265                                                                             \
266   ( cd BIN/lesstif ;                                                        \
267     CC=cc ;                                                                 \
268     export CC ;                                                             \
269     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
270     echo --------------------------------------------------------------- ;  \
271     ( cd utils; gmake all ) ;                                               \
272     ( cd driver; gmake all ) ;                                              \
273     echo --------------------------------------------------------------- ); \
274                                                                             \
275   chmod -R u+w .
276
277 dmg::
278         cd OSX ; $(MAKE) release dmg
279
280 www::
281         @                                                                   \
282   DEST=$$HOME/www/xscreensaver ;                                            \
283   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ;  \
284   HEAD="xscreensaver-$$VERS" ;                                              \
285   ADIR=archive/ ;                                                           \
286   BNAME="$$HEAD.tar.gz" ;                                                   \
287   NAME="$$ADIR$$BNAME" ;                                                    \
288   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
289   BNAME2="$$HEAD.dmg" ;                                                     \
290   NAME2="$$ADIR$$BNAME2" ;                                                  \
291   DNAME2="$$DEST/$$HEAD.dmg" ;                                              \
292                                                                             \
293   if [ ! -f $$NAME ]; then                                                  \
294     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
295     exit 1 ;                                                                \
296   fi ;                                                                      \
297   if [ ! -f $$NAME2 ]; then                                                 \
298     echo "$$NAME2 does not exist!  Did you forget to \`make dmg'?" ;        \
299     exit 1 ;                                                                \
300   fi ;                                                                      \
301   chmod a-w $$NAME ;                                                        \
302   if [ -f $$DNAME ]; then                                                   \
303     /bin/echo -n "WARNING: $$DNAME already exists!  Overwrite? ";           \
304     read line;                                                              \
305     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
306       exit 1 ;                                                              \
307     fi ;                                                                    \
308   fi ;                                                                      \
309   if [ -f $$DNAME2 ]; then                                                  \
310     /bin/echo -n "WARNING: $$DNAME2 already exists!  Overwrite? ";          \
311     read line;                                                              \
312     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
313       exit 1 ;                                                              \
314     fi ;                                                                    \
315   fi ;                                                                      \
316   cp -p $$NAME $$DNAME ;                                                    \
317   cp -p $$NAME2 $$DNAME2 ;                                                  \
318   chmod u+w $$DNAME $$DNAME2 ;                                              \
319   cd $$DEST ;                                                               \
320                                                                             \
321   TMP=/tmp/xd.$$$$ ;                                                        \
322   sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ;  \
323   echo '' ;                                                                 \
324   diff -U0 download.html $$TMP ;                                            \
325   echo '' ;                                                                 \
326                                                                             \
327   OLDEST=`ls xscreensaver*.tar.gz | head -1` ;                              \
328   /bin/echo -n "Delete $$DEST/$$OLDEST? ";                                  \
329   read line;                                                                \
330   if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                       \
331     set -x ;                                                                \
332     rm $$OLDEST ;                                                           \
333     cvs remove $$OLDEST ;                                                   \
334   else                                                                      \
335     set -x ;                                                                \
336   fi ;                                                                      \
337   cvs add -kb $$BNAME $$BNAME2 ;                                            \
338   cat $$TMP > download.html ;                                               \
339   rm -f $$TMP ;                                                             \
340                                                                             \
341   (cd ..; $(MAKE) xscreensaver/changelog.html                               \
342                   xscreensaver/screenshots/index.html );                    \
343   cvs diff -U0 changelog.html ;                                             \
344   set +x ;                                                                  \
345                                                                             \
346   /bin/echo -n "Ok? ";                                                      \
347   read line;                                                                \
348   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
349     exit 1 ;                                                                \
350   fi ;                                                                      \
351                                                                             \
352   cvs commit -m "$$VERS"
353
354 check_years::
355         @for file in `find . -name '*.*' \
356                 \! -name '*~' \! -name '*.o' \! -name '*.gz' \! -name '*.Z' \
357                 \! -name '*.po' \! -name 'config.*'  \! -name '*.glade*' \
358                 \! -name '*.m4' \! -name '*.pdb' \! -name '*.xpm' \
359                 \! -name '*.jpg' \! -name '*.gif' \! -name '*.eps' \
360                 \! -name '*.png' \! -name '*.tif' \! -name '*.bak' \
361                 | sort` \
362         ; do \
363           y=`date -r "$$file" '+%Y'` ; \
364           if ! ( grep "\b$$y\b" $$file >/dev/null ); then \
365             if ( grep "opyright\|(c)\|\.BR" $$file >/dev/null ); then \
366               echo "$$file              does not mention $$y" ; \
367             fi ; \
368           fi ; \
369         done
370
371 count::
372         @ \
373   /bin/echo -n "Current hack count: " ; \
374   ( ( cd hacks;     make -s INSTALL=true install-program install-scripts ) ; \
375     ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \
376     grep true | \
377     grep -v helper | \
378     grep -v ljlatest | \
379     wc -l