http://ftp.x.org/contrib/applications/xscreensaver-3.04.tar.gz
[xscreensaver] / Makefile.in
1 # Makefile.in --- xscreensaver, Copyright (c) 1997 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
10 TARFILES        = README README.VMS README.debugging INSTALL xscreensaver.lsm \
11                   configure configure.in Makefile.in config.h.in \
12                   config.h-vms install-sh setup.com config.guess \
13                   config.sub makevms.com screenblank.txt \
14                   xscreensaver.lsm.sh xscreensaver.spec
15 TAR             = tar
16 COMPRESS        = gzip --verbose --best
17 COMPRESS_EXT    = gz
18 # COMPRESS      = compress
19 # COMPRESS_EXT  = Z
20
21 MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
22
23 all::
24         @$(MAKE_SUBDIR)
25 install:
26         @$(MAKE_SUBDIR)
27 install-program:
28         @$(MAKE_SUBDIR)
29 install-man:
30         @$(MAKE_SUBDIR)
31 install-strip:
32         @$(MAKE_SUBDIR)
33 uninstall:
34         @$(MAKE_SUBDIR)
35 uninstall-program:
36         @$(MAKE_SUBDIR)
37 uninstall-man:
38         @$(MAKE_SUBDIR)
39 depend:
40         @$(MAKE_SUBDIR)
41 distdepend:
42         @$(MAKE) update_spec_version
43         @$(MAKE_SUBDIR)
44 TAGS: tags
45 tags:
46         @$(MAKE_SUBDIR)
47 clean:
48         @$(MAKE_SUBDIR)
49 distclean: clean
50         -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"*
51         @$(MAKE_SUBDIR)
52
53 dist: tar
54
55 # This really makes me sick...
56 tar:
57         @                                                                   \
58   sh config.status ;                                                        \
59   rm -f configure ;                                                         \
60   $(MAKE) configure ;                                                       \
61   $(MAKE) distdepend ;                                                      \
62   sh xscreensaver.lsm.sh > xscreensaver.lsm.$$$$ ;                          \
63   mv xscreensaver.lsm.$$$$ xscreensaver.lsm ;                               \
64   NAME=`sed -n                                                              \
65   's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ;  \
66   rm -rf $$NAME ; ln -s . $$NAME ;                                          \
67   FILES= ;                                                                  \
68   for subdir in $(SUBDIRS) ; do                                             \
69     d=`pwd` ;                                                               \
70     cd $$subdir ;                                                           \
71     FILES="$$FILES `$(MAKE) echo_tarfiles                                   \
72       | grep -v '^.*make\['                                                 \
73       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                            \
74       ` ";                                                                  \
75     cd $$d ; done ;                                                         \
76   echo creating tar file $${NAME}.tar.$(COMPRESS_EXT)... ;                  \
77   $(TAR) -vchf -                                                            \
78     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `       \
79    | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;                           \
80   rm $$NAME
81
82
83 # This also makes me sick...
84 # autoconf generates a configure script that begins with a very hard to read,
85 # nearly impossible to customize --help blurb.  This horrid set of regexps
86 # go through and clean up the help text, by inserting whitespace and ripping
87 # out options we don't use.  Odds are good that this will fail with any version
88 # of autoconf other than 2.12.
89 #
90 configure::
91         autoconf
92         @TMP=configure.$$$$ ;                                                \
93         echo "munging configure's --help message..." ;                       \
94         ( perl -e '                                                          \
95                 my $$file="";                                                \
96                 while (<>) { $$file .= $$_; }                                \
97                 $$_ = $$file;                                                \
98                                                                              \
99                 s/^(Configuration:)$$/\n$$1\n/m;                             \
100                 s/^(Directory and file names:)$$/\n$$1\n/m;                  \
101                 s/^  --sbindir=.*\n//m;                                      \
102                 s/^  --libexecdir.*\n//m;                                    \
103                 s/^  --datadir.*\n.*\n//m;                                   \
104                 s/^  --sysconfdir.*\n//m;                                    \
105                 s/^  --sharedstatedir.*\n.*\n//m;                            \
106                 s/^  --localstatedir.*\n//m;                                 \
107                 s/^  --infodir.*\n//m;                                       \
108                 s/^(Host type:)$$/\n$$1\n/m;                                 \
109                 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
110                 s/--enable and --with options recognized://m;                \
111                 s/\n  --with-x .*?(["\n])/$$1/s;                             \
112                 s/\n(Installation options:\n)/$$1/s;                         \
113                                                                              \
114                 s/^  --oldincludedir=.*$$/ \
115  --x-includes=DIR        X include files are in DIR\n \
116  --x-libraries=DIR       X library files are in DIR/m; \
117                                                                              \
118                 print;'                                                      \
119         < configure                                                          \
120         > $$TMP &&                                                           \
121         cat $$TMP > configure ) ;                                            \
122         rm -f $$TMP
123
124 bump-version::
125         @                                                                   \
126   SRC=utils/version.h ;                                                     \
127   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][0-9]*\).*/\1 \2/p' $$SRC` ;     \
128   set - $$VERS ;                                                            \
129   MAJOR="$$1"; MINOR="$$2";                                                 \
130   NEW=`echo $$MINOR + 1 | bc` ;                                             \
131   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
132   D=`date '+%d-%b-%y'`;                                                     \
133   if [ ! -f xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then                     \
134     echo "WARNING: xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";    \
135   fi ;                                                                      \
136   if [ -f xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                         \
137     echo "WARNING: xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";      \
138   fi ;                                                                      \
139   echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";           \
140   read line;                                                                \
141   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
142     exit 1 ;                                                                \
143   fi ;                                                                      \
144   TMP=/tmp/bv.$$ ;                                                          \
145   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
146       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
147         $$SRC > $$TMP ;                                                     \
148   echo -n "New version and date are ";                                      \
149   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
150      $$TMP;                                                                 \
151   cat $$TMP > $$SRC ;                                                       \
152   rm -f $$TMP;                                                              \
153   echo "overwrote $$SRC";                                                   \
154   ls -lFd $$SRC
155
156 update_spec_version::
157         @S=$(srcdir)/xscreensaver.spec ;                                    \
158         U=$(srcdir)/utils/version.h ;                                       \
159         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
160         echo -n "Updating version number in $$S to \"$$V\"... " ;           \
161         T=/tmp/xs.$$$$ ;                                                    \
162         sed "s/^\(Version:[^0-9]*\)\(.*\)/\1$$V/"                           \
163           < $$S > $$T ;                                                     \
164         if cmp -s $$S $$T ; then                                            \
165           echo "unchanged." ;                                               \
166         else                                                                \
167           cat $$T > $$S ;                                                   \
168           echo "done." ;                                                    \
169         fi ;                                                                \
170         rm $$T
171
172 test-tar::
173         @                                                                   \
174   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
175   D=xscreensaver-$$VERS ;                                                   \
176   NAME="$$D.tar.gz" ;                                                       \
177   if [ ! -f $$NAME ]; then                                                  \
178     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
179     exit 1 ;                                                                \
180   fi ;                                                                      \
181                                                                             \
182   set -e ;                                                                  \
183   set -x ;                                                                  \
184                                                                             \
185   if [ -d $$D ]; then                                                       \
186    chmod -R u+w $$D ;                                                       \
187   fi ;                                                                      \
188   rm -rf $$D ;                                                              \
189   zcat $$D.tar.gz | tar -xf - ;                                             \
190   cd $$D ;                                                                  \
191   chmod -R a-w . ;                                                          \
192   chmod u+w . ;                                                             \
193   mkdir BIN ;                                                               \
194   mkdir BIN/athena ;                                                        \
195   mkdir BIN/motif ;                                                         \
196   mkdir BIN/lesstif ;                                                       \
197   chmod a-w . ;                                                             \
198                                                                             \
199   ( cd BIN/athena ;                                                         \
200     CC=cc ;                                                                 \
201     export CC ;                                                             \
202     ../../configure --with-athena ;                                         \
203     echo --------------------------------------------------------------- ;  \
204     gmake ;                                                                 \
205     echo --------------------------------------------------------------- ); \
206                                                                             \
207   ( cd BIN/motif ;                                                          \
208     CC=cc ;                                                                 \
209     export CC ;                                                             \
210     ../../configure --with-motif=/usr/local/motif ;                         \
211     echo --------------------------------------------------------------- ;  \
212     ( cd utils; gmake ) ;                                                   \
213     ( cd driver; gmake ) ;                                                  \
214     ( cd driver; gmake xscreensaver-demo-Xaw ) ;                            \
215     echo --------------------------------------------------------------- ); \
216                                                                             \
217   ( cd BIN/lesstif ;                                                        \
218     CC=cc ;                                                                 \
219     export CC ;                                                             \
220     ../../configure --with-motif=/usr/local/lesstif ;                       \
221     echo --------------------------------------------------------------- ;  \
222     ( cd utils; gmake ) ;                                                   \
223     ( cd driver; gmake ) ;                                                  \
224     ( cd driver; gmake xscreensaver-demo-Xaw ) ;                            \
225     echo --------------------------------------------------------------- ); \
226                                                                             \
227   chmod -R u+w .
228
229
230 www::
231         @                                                                   \
232   DEST=$$HOME/www/xscreensaver ;                                            \
233   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
234   HEAD="xscreensaver-$$VERS" ;                                              \
235   NAME="$$HEAD.tar.gz" ;                                                    \
236                                                                             \
237   if [ ! -f $$NAME ]; then                                                  \
238     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
239     exit 1 ;                                                                \
240   fi ;                                                                      \
241   if [ -f $$DEST/$$NAME ]; then                                             \
242     echo -n "WARNING: $$DEST/$$NAME already exists!  Overwrite? ";          \
243     read line;                                                              \
244     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
245       exit 1 ;                                                              \
246     fi ;                                                                    \
247   fi ;                                                                      \
248   cp -p $$NAME $$DEST/$$NAME ;                                              \
249   chmod u+w $$DEST/$$NAME ;                                                 \
250   cd $$DEST ;                                                               \
251                                                                             \
252   TMP=/tmp/xd.$$$$ ;                                                        \
253   sed "s/xscreensaver-[0-9]\.[0-9][0-9]*/$$HEAD/g" download.html > $$TMP ;  \
254   echo '' ;                                                                 \
255   diff -u0 download.html $$TMP ;                                            \
256   echo '' ;                                                                 \
257                                                                             \
258   OLDEST=`ls xscreensaver*.tar.gz | head -1` ;                              \
259   echo -n "Delete $$DEST/$$OLDEST? ";                                       \
260   read line;                                                                \
261   if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                       \
262     set -x ;                                                                \
263     rm $$OLDEST ;                                                           \
264     cvs remove $$OLDEST ;                                                   \
265   else                                                                      \
266     set -x ;                                                                \
267   fi ;                                                                      \
268   cvs add -kb $$NAME ;                                                      \
269   cat $$TMP > download.html ;                                               \
270   rm -f $$TMP ;                                                             \
271                                                                             \
272   (cd ..; $(MAKE) xscreensaver/changelog.html );                            \
273   cvs diff -u0 changelog.html ;                                             \
274   set +x ;                                                                  \
275                                                                             \
276   echo -n "Ok? ";                                                           \
277   read line;                                                                \
278   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
279     exit 1 ;                                                                \
280   fi ;                                                                      \
281                                                                             \
282   cvs commit -m "$$VERS"