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