http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.04.2.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 po
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 aclocal.m4 \
13                   config.sub install-sh makevms.com \
14                   intltool-merge.in intltool-extract.in intltool-update.in \
15                   xscreensaver.lsm.sh xscreensaver.spec \
16
17 TAR             = tar
18
19 MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
20
21 default::
22         @$(MAKE_SUBDIR)
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 *~ "#"* intltool-extract intltool-merge intltool-update
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   ADIR=archive/ ;                                                           \
69   for subdir in $(SUBDIRS) ; do                                             \
70     d=`pwd` ;                                                               \
71     cd $$subdir ;                                                           \
72     FILES="$$FILES `$(MAKE) echo_tarfiles                                   \
73       | grep -v '^.*make\['                                                 \
74       | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\"                            \
75       ` ";                                                                  \
76     cd $$d ; done ;                                                         \
77   echo creating tar file $$ADIR$$NAME.tar.gz... ;                           \
78   GZIP="-9v" $(TAR) -vchzf $$ADIR$$NAME.tar.gz                              \
79     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ;     \
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 the ones I've tried (2.12 and 2.13.)
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   ADIR=archive/ ;                                                           \
134   if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then             \
135    echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
136   fi ;                                                                      \
137   if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                 \
138     echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
139   fi ;                                                                      \
140   echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? ";           \
141   read line;                                                                \
142   if [ "x$$line" != "xyes" -a  "x$$line" != "xy" ]; then                    \
143     exit 1 ;                                                                \
144   fi ;                                                                      \
145   TMP=/tmp/bv.$$ ;                                                          \
146   sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/"                          \
147       -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/"   \
148         $$SRC > $$TMP ;                                                     \
149   echo -n "New version and date are ";                                      \
150   sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p"  \
151      $$TMP;                                                                 \
152   cat $$TMP > $$SRC ;                                                       \
153   rm -f $$TMP;                                                              \
154   echo "overwrote $$SRC";                                                   \
155   ls -lFd $$SRC
156
157 update_spec_version::
158         @S=$(srcdir)/xscreensaver.spec ;                                    \
159         U=$(srcdir)/utils/version.h ;                                       \
160         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
161         echo -n "Updating $$S to \"$$V\"... " ;                             \
162         T=/tmp/xs.$$$$ ;                                                    \
163         sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$V/"                    \
164           < $$S > $$T ;                                                     \
165         if cmp -s $$S $$T ; then                                            \
166           echo "unchanged." ;                                               \
167         else                                                                \
168           cat $$T > $$S ;                                                   \
169           echo "done." ;                                                    \
170         fi ;                                                                \
171         rm $$T
172
173 rpm::
174         @                                                                  \
175   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ; \
176   DIR=`pwd`/rpm_build ;                                                    \
177   ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ;                    \
178   ADIR=archive/ ;                                                          \
179   TGZ=xscreensaver-$$VERS.tar.gz ;                                         \
180   if [ ! -f $${ADIR}$$TGZ ]; then                                          \
181     echo "$${ADIR}$$TGZ does not exist!  Did you forget to \`make tar'?" ; \
182     exit 1 ;                                                               \
183   fi ;                                                                     \
184   rm -rf /var/tmp/xscreensaver-$$VERS-root ;                               \
185   rm -rf $$DIR ;                                                           \
186   mkdir $$DIR ;                                                            \
187   ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ;         \
188   cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ;                                     \
189   rpm --define "_topdir $$DIR"                                             \
190       --define "USE_GL yes"                                                \
191       -v -ba xscreensaver.spec ;                                           \
192   echo '' ;                                                                \
193   echo 'RPM build complete' ;                                              \
194   echo '' ;                                                                \
195   rm -f $$DIR/$$TGZ ;                                                      \
196   rm -rf $$DIR/BUILD/xscreensaver-$$VERS ;                                 \
197   mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ;                            \
198   mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ;                      \
199   rm -rf $$DIR ;                                                           \
200   echo '' ;                                                                \
201   ls -lFG xscreensaver*-$$VERS-*.rpm
202
203 test-tar::
204         @                                                                   \
205   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
206   D=xscreensaver-$$VERS ;                                                   \
207   ADIR=archive/ ;                                                           \
208   NAME="$${ADIR}$$D.tar.gz" ;                                               \
209   if [ ! -f $$NAME ]; then                                                  \
210     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
211     exit 1 ;                                                                \
212   fi ;                                                                      \
213                                                                             \
214   set -e ;                                                                  \
215   set -x ;                                                                  \
216                                                                             \
217   if [ -d $$D ]; then                                                       \
218    chmod -R u+w $$D ;                                                       \
219   fi ;                                                                      \
220   rm -rf $$D ;                                                              \
221   zcat $${ADIR}$$D.tar.gz | tar -xf - ;                                     \
222   cd $$D ;                                                                  \
223   chmod -R a-w . ;                                                          \
224   chmod u+w . ;                                                             \
225   mkdir BIN ;                                                               \
226   mkdir BIN/motif ;                                                         \
227   mkdir BIN/lesstif ;                                                       \
228   chmod a-w . ;                                                             \
229                                                                             \
230   ( cd BIN/motif ;                                                          \
231     CC=cc ;                                                                 \
232     export CC ;                                                             \
233     ../../configure --without-xpm --without-xdbe --without-xshm             \
234                     --with-motif=/usr/local/motif ;                         \
235     echo --------------------------------------------------------------- ;  \
236     gmake all ;                                                             \
237     ( cd driver; gmake tests ) ;                                            \
238     echo --------------------------------------------------------------- ); \
239                                                                             \
240   ( cd BIN/lesstif ;                                                        \
241     CC=cc ;                                                                 \
242     export CC ;                                                             \
243     ../../configure --with-motif=/usr/local/lesstif --without-gnome ;       \
244     echo --------------------------------------------------------------- ;  \
245     ( cd utils; gmake all ) ;                                               \
246     ( cd driver; gmake all ) ;                                              \
247     echo --------------------------------------------------------------- ); \
248                                                                             \
249   chmod -R u+w .
250
251
252 www::
253         @                                                                   \
254   DEST=$$HOME/www/xscreensaver ;                                            \
255   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
256   HEAD="xscreensaver-$$VERS" ;                                              \
257   ADIR=archive/ ;                                                           \
258   BNAME="$$HEAD.tar.gz" ;                                                   \
259   NAME="$$ADIR$$BNAME" ;                                                    \
260   DNAME="$$DEST/$$HEAD.tar.gz" ;                                            \
261                                                                             \
262   if [ ! -f $$NAME ]; then                                                  \
263     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
264     exit 1 ;                                                                \
265   fi ;                                                                      \
266   chmod a-w $$NAME ;                                                        \
267   if [ -f $$DNAME ]; then                                                   \
268     echo -n "WARNING: $$DNAME already exists!  Overwrite? ";                \
269     read line;                                                              \
270     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
271       exit 1 ;                                                              \
272     fi ;                                                                    \
273   fi ;                                                                      \
274   cp -p $$NAME $$DNAME ;                                                    \
275   chmod u+w $$DNAME ;                                                       \
276   cd $$DEST ;                                                               \
277                                                                             \
278   TMP=/tmp/xd.$$$$ ;                                                        \
279   sed "s/xscreensaver-[0-9]\.[0-9][0-9]*/$$HEAD/g" download.html > $$TMP ;  \
280   echo '' ;                                                                 \
281   diff -u0 download.html $$TMP ;                                            \
282   echo '' ;                                                                 \
283                                                                             \
284   OLDEST=`ls xscreensaver*.tar.gz | head -1` ;                              \
285   echo -n "Delete $$DEST/$$OLDEST? ";                                       \
286   read line;                                                                \
287   if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                       \
288     set -x ;                                                                \
289     rm $$OLDEST ;                                                           \
290     cvs remove $$OLDEST ;                                                   \
291   else                                                                      \
292     set -x ;                                                                \
293   fi ;                                                                      \
294   cvs add -kb $$BNAME ;                                                     \
295   cat $$TMP > download.html ;                                               \
296   rm -f $$TMP ;                                                             \
297                                                                             \
298   (cd ..; $(MAKE) xscreensaver/changelog.html );                            \
299   cvs diff -u0 changelog.html ;                                             \
300   set +x ;                                                                  \
301                                                                             \
302   echo -n "Ok? ";                                                           \
303   read line;                                                                \
304   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
305     exit 1 ;                                                                \
306   fi ;                                                                      \
307                                                                             \
308   cvs commit -m "$$VERS"