266f4db116cba152237e967ed11f0da07a04a9de
[xscreensaver] / Makefile.in
1 # Makefile.in --- xscreensaver, Copyright (c) 1997 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
15 TAR             = tar
16 COMPRESS        = gzip --verbose --best
17 COMPRESS_EXT    = gz
18 # COMPRESS      = compress
19 # COMPRESS_EXT  = Z
20
21 MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
22
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_SUBDIR)
43 TAGS: tags
44 tags:
45         @$(MAKE_SUBDIR)
46 clean:
47         @$(MAKE_SUBDIR)
48 distclean: clean
49         -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"*
50         @$(MAKE_SUBDIR)
51
52 dist: tar
53
54 # This really makes me sick...
55 tar:
56         @                                                                   \
57   sh config.status ;                                                        \
58   rm -f configure ;                                                         \
59   $(MAKE) configure ;                                                       \
60   $(MAKE) distdepend ;                                                      \
61   sh xscreensaver.lsm.sh > xscreensaver.lsm.$$$$ ;                          \
62   mv xscreensaver.lsm.$$$$ xscreensaver.lsm ;                               \
63   NAME=`sed -n                                                              \
64   's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/xscreensaver-\1/p' utils/version.h` ;  \
65   rm -rf $$NAME ; ln -s . $$NAME ;                                          \
66   FILES= ;                                                                  \
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 $${NAME}.tar.$(COMPRESS_EXT)... ;                  \
76   $(TAR) -vchf -                                                            \
77     `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" `       \
78    | $(COMPRESS) > $${NAME}.tar.$(COMPRESS_EXT) ;                           \
79   rm $$NAME
80
81
82 # This also makes me sick...
83 # autoconf generates a configure script that begins with a very hard to read,
84 # nearly impossible to customize --help blurb.  This horrid set of regexps
85 # go through and clean up the help text, by inserting whitespace and ripping
86 # out options we don't use.  Odds are good that this will fail with any version
87 # of autoconf other than 2.12.
88 #
89 configure::
90         autoconf
91         @TMP=configure.$$$$ ;                                                \
92         echo "munging configure's --help message..." ;                       \
93         ( perl -e '                                                          \
94                 my $$file="";                                                \
95                 while (<>) { $$file .= $$_; }                                \
96                 $$_ = $$file;                                                \
97                                                                              \
98                 s/^(Configuration:)$$/\n$$1\n/m;                             \
99                 s/^(Directory and file names:)$$/\n$$1\n/m;                  \
100                 s/^  --sbindir=.*\n//m;                                      \
101                 s/^  --libexecdir.*\n//m;                                    \
102                 s/^  --datadir.*\n.*\n//m;                                   \
103                 s/^  --sysconfdir.*\n//m;                                    \
104                 s/^  --sharedstatedir.*\n.*\n//m;                            \
105                 s/^  --localstatedir.*\n//m;                                 \
106                 s/^  --infodir.*\n//m;                                       \
107                 s/^(Host type:)$$/\n$$1\n/m;                                 \
108                 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
109                 s/--enable and --with options recognized://m;                \
110                 s/\n  --with-x .*?(["\n])/$$1/s;                             \
111                 s/\n(Installation options:\n)/$$1/s;                         \
112                                                                              \
113                 s/^  --oldincludedir=.*$$/ \
114  --x-includes=DIR        X include files are in DIR\n \
115  --x-libraries=DIR       X library files are in DIR/m; \
116                                                                              \
117                 print;'                                                      \
118         < configure                                                          \
119         > $$TMP &&                                                           \
120         cat $$TMP > configure ) ;                                            \
121         rm -f $$TMP
122
123 bump-version::
124         @                                                                   \
125   SRC=utils/version.h ;                                                     \
126   VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][0-9]*\).*/\1 \2/p' $$SRC` ;     \
127   set - $$VERS ;                                                            \
128   MAJOR="$$1"; MINOR="$$2";                                                 \
129   NEW=`echo $$MINOR + 1 | bc` ;                                             \
130   NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ;                            \
131   D=`date '+%d-%b-%y'`;                                                     \
132   if [ ! -f xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then                     \
133     echo "WARNING: xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";    \
134   fi ;                                                                      \
135   if [ -f xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then                         \
136     echo "WARNING: 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 test-tar::
156         @                                                                   \
157   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
158   D=xscreensaver-$$VERS ;                                                   \
159   NAME="$$D.tar.gz" ;                                                       \
160   if [ ! -f $$NAME ]; then                                                  \
161     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
162     exit 1 ;                                                                \
163   fi ;                                                                      \
164                                                                             \
165   set -e ;                                                                  \
166   set -x ;                                                                  \
167                                                                             \
168   if [ -d $$D ]; then                                                       \
169    chmod -R u+w $$D ;                                                       \
170   fi ;                                                                      \
171   rm -rf $$D ;                                                              \
172   zcat $$D.tar.gz | tar -xf - ;                                             \
173   cd $$D ;                                                                  \
174   chmod -R a-w . ;                                                          \
175   chmod u+w . ;                                                             \
176   mkdir BIN ;                                                               \
177   mkdir BIN/athena ;                                                        \
178   mkdir BIN/motif ;                                                         \
179   mkdir BIN/lesstif ;                                                       \
180   chmod a-w . ;                                                             \
181                                                                             \
182   ( cd BIN/athena ;                                                         \
183     CC=cc ;                                                                 \
184     export CC ;                                                             \
185     ../../configure --with-athena ;                                         \
186     echo --------------------------------------------------------------- ;  \
187     gmake ;                                                                 \
188     echo --------------------------------------------------------------- ); \
189                                                                             \
190   ( cd BIN/motif ;                                                          \
191     CC=cc ;                                                                 \
192     export CC ;                                                             \
193     ../../configure --with-motif=/usr/local/motif ;                         \
194     echo --------------------------------------------------------------- ;  \
195     ( cd utils; gmake ) ;                                                   \
196     ( cd driver; gmake ) ;                                                  \
197     ( cd driver; gmake xscreensaver-demo-Xaw ) ;                            \
198     echo --------------------------------------------------------------- ); \
199                                                                             \
200   ( cd BIN/lesstif ;                                                        \
201     CC=cc ;                                                                 \
202     export CC ;                                                             \
203     ../../configure --with-motif=/usr/local/lesstif ;                       \
204     echo --------------------------------------------------------------- ;  \
205     ( cd utils; gmake ) ;                                                   \
206     ( cd driver; gmake ) ;                                                  \
207     ( cd driver; gmake xscreensaver-demo-Xaw ) ;                            \
208     echo --------------------------------------------------------------- ); \
209                                                                             \
210   chmod -R u+w .
211
212
213 www::
214         @                                                                   \
215   DEST=$$HOME/www/xscreensaver ;                                            \
216   VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][0-9]*\).*/\1/p' utils/version.h` ;  \
217   HEAD="xscreensaver-$$VERS" ;                                              \
218   NAME="$$HEAD.tar.gz" ;                                                    \
219                                                                             \
220   if [ ! -f $$NAME ]; then                                                  \
221     echo "$$NAME does not exist!  Did you forget to \`make tar'?" ;         \
222     exit 1 ;                                                                \
223   fi ;                                                                      \
224   if [ -f $$DEST/$$NAME ]; then                                             \
225     echo -n "WARNING: $$DEST/$$NAME already exists!  Overwrite? ";          \
226     read line;                                                              \
227     if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                   \
228       exit 1 ;                                                              \
229     fi ;                                                                    \
230   fi ;                                                                      \
231   cp -p $$NAME $$DEST/$$NAME ;                                              \
232   chmod u+w $$DEST/$$NAME ;                                                 \
233   cd $$DEST ;                                                               \
234                                                                             \
235   TMP=/tmp/xd.$$$$ ;                                                        \
236   sed "s/xscreensaver-[0-9]\.[0-9][0-9]*/$$HEAD/g" download.html > $$TMP ;  \
237   echo '' ;                                                                 \
238   diff -u0 download.html $$TMP ;                                            \
239   echo '' ;                                                                 \
240                                                                             \
241   OLDEST=`ls xscreensaver*.tar.gz | head -1` ;                              \
242   echo -n "Delete $$DEST/$$OLDEST? ";                                       \
243   read line;                                                                \
244   if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then                       \
245     set -x ;                                                                \
246     rm $$OLDEST ;                                                           \
247     cvs remove $$OLDEST ;                                                   \
248   else                                                                      \
249     set -x ;                                                                \
250   fi ;                                                                      \
251   cvs add -kb $$NAME ;                                                      \
252   cat $$TMP > download.html ;                                               \
253   rm -f $$TMP ;                                                             \
254                                                                             \
255   (cd ..; $(MAKE) xscreensaver/changelog.html );                            \
256   cvs diff -u0 changelog.html ;                                             \
257   set +x ;                                                                  \
258                                                                             \
259   echo -n "Ok? ";                                                           \
260   read line;                                                                \
261   if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then                     \
262     exit 1 ;                                                                \
263   fi ;                                                                      \
264                                                                             \
265   cvs commit -m "$$VERS"