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