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