http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.34.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   rm -rf $$DIR ;                                                           \
178   mkdir $$DIR ;                                                            \
179   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
180   cp -p $${ADIR}xscreensaver-$$VERS.tar.gz $$DIR/SOURCES/ ;                \
181   rpm --define "_topdir $$DIR"                                             \
182       --define "USE_GL yes"                                                \
183       -v -ba xscreensaver.spec ;                                           \
184   echo '' ;                                                                \
185   echo 'RPM build complete' ;                                              \
186   echo '' ;                                                                \
187   rm -f $$DIR/xscreensaver-$$VERS.tar.gz ;                                 \
188   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
189   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
190   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
191   rm -rf $$DIR ;                                                           \
192   echo '' ;                                                                \
193   ls -lFG xscreensaver*-$$VERS-*.rpm
194
195 test-tar::
196         @                                                                   \
197   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
198   D=xscreensaver-$$VERS ;                                                   \
199   ADIR=archive/ ;                                                           \
200   NAME="$${ADIR}$$D.tar.gz" ;                                               \
201   if [ ! -f $$NAME ]; then                                                  \
202     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
203     exit 1 ;                                                                \
204   fi ;                                                                      \
205                                                                             \
206   set -e ;                                                                  \
207   set -x ;                                                                  \
208                                                                             \
209   if [ -d $$D ]; then                                                       \
210    chmod -R u+w $$D ;                                                       \
211   fi ;                                                                      \
212   rm -rf $$D ;                                                              \
213   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
214   cd $$D ;                                                                  \
215   chmod -R a-w . ;                                                          \
216   chmod u+w . ;                                                             \
217   mkdir BIN ;                                                               \
218   mkdir BIN/motif ;                                                         \
219   mkdir BIN/lesstif ;                                                       \
220   chmod a-w . ;                                                             \
221                                                                             \
222   ( cd BIN/motif ;                                                          \
223     CC=cc ;                                                                 \
224     export CC ;                                                             \
225     ../../configure --without-xpm --without-xdbe --without-xshm             \
226                     --with-motif=/usr/local/motif ;                         \
227     echo --------------------------------------------------------------- ;  \
228     gmake all ;                                                             \
229     ( cd driver; gmake tests ) ;                                            \
230     echo --------------------------------------------------------------- ); \
231                                                                             \
232   ( cd BIN/lesstif ;                                                        \
233     CC=cc ;                                                                 \
234     export CC ;                                                             \
235     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
236     echo --------------------------------------------------------------- ;  \
237     ( cd utils; gmake all ) ;                                               \
238     ( cd driver; gmake all ) ;                                              \
239     echo --------------------------------------------------------------- ); \
240                                                                             \
241   chmod -R u+w .
242
243
244 www::
245         @                                                                   \
246   DEST=$$HOME/www/xscreensaver ;                                            \
247   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
248   HEAD="xscreensaver-$$VERS" ;                                              \
249   ADIR=archive/ ;                                                           \
250   BNAME="$$HEAD.tar.gz" ;                                                   \
251   NAME="$$ADIR$$BNAME" ;                                                    \
252   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
253                                                                             \
254   if [ ! -f $$NAME ]; then                                                  \
255     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
256     exit 1 ;                                                                \
257   fi ;                                                                      \
258   chmod a-w $$NAME ;                                                        \
259   if [ -f $$DNAME ]; then                                                   \
260     echo -n "WARNING: $$DNAME already exists!  Overwrite? ";                \
261     read line;                                                              \
262     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
263       exit 1 ;                                                              \
264     fi ;                                                                    \
265   fi ;                                                                      \
266   cp -p $$NAME $$DNAME ;                                                    \
267   chmod u+w $$DNAME ;                                                       \
268   cd $$DEST ;                                                               \
269                                                                             \
270   TMP=/tmp/xd.$$$$ ;                                                        \
271   sed "s/xscreensaver-[0-9]\.[0-9][0-9]*/$$HEAD/g" download.html > $$TMP ;  \
272   echo '' ;                                                                 \
273   diff -u0 download.html $$TMP ;                                            \
274   echo '' ;                                                                 \
275                                                                             \
276   OLDEST=`ls xscreensaver*.tar.gz | head -1` ;                              \
277   echo -n "Delete $$DEST/$$OLDEST? ";                                       \
278   read line;                                                                \
279   if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                       \
280     set -x ;                                                                \
281     rm $$OLDEST ;                                                           \
282     cvs remove $$OLDEST ;                                                   \
283   else                                                                      \
284     set -x ;                                                                \
285   fi ;                                                                      \
286   cvs add -kb $$BNAME ;                                                     \
287   cat $$TMP > download.html ;                                               \
288   rm -f $$TMP ;                                                             \
289                                                                             \
290   (cd ..; $(MAKE) xscreensaver/changelog.html );                            \
291   cvs diff -u0 changelog.html ;                                             \
292   set +x ;                                                                  \
293                                                                             \
294   echo -n "Ok? ";                                                           \
295   read line;                                                                \
296   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
297     exit 1 ;                                                                \
298   fi ;                                                                      \
299                                                                             \
300   cvs commit -m "$$VERS"