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