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