1 # Makefile.in --- xscreensaver, Copyright (c) 1999-2005 Jamie Zawinski.
2 # the `../configure' script generates `Makefile' from this file.
9 SUBDIRS = utils driver hacks hacks/glx po
10 SUBDIRS2 = $(SUBDIRS) OSX
11 TARFILES = README README.hacking README.VMS INSTALL \
12 configure configure.in Makefile.in config.h.in \
13 config.h-vms install-sh setup.com config.guess aclocal.m4 \
14 config.sub makevms.com \
15 intltool-merge.in intltool-extract.in intltool-update.in \
17 xscreensaver.xcodeproj/project.pbxproj
21 MAKE_SUBDIR = for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) $@) || exit 5; done
22 MAKE_SUBDIR2 = for dir in $(SUBDIRS2);do (cd $$dir; $(MAKE) $@) || exit 5; done
45 @$(MAKE) update_spec_version
47 @cd po ; $(MAKE) generate_potfiles_in
57 -rm -f config.h Makefile config.status config.cache config.log TAGS *~ "#"* intltool-extract intltool-merge intltool-update
62 # This really makes me sick...
68 $(MAKE) version-date distdepend ; \
69 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
70 NAME="xscreensaver-$$VERS" ; \
71 rm -rf $$NAME ; ln -s . $$NAME ; \
74 for subdir in $(SUBDIRS2) ; do \
77 FILES="$$FILES `$(MAKE) echo_tarfiles \
78 | grep -v '^.*make\[' \
79 | sed \"s|^|$$subdir/|g;s| | $$subdir/|g\" \
82 echo creating tar file $$ADIR$$NAME.tar.gz... ; \
83 GZIP="-9v" $(TAR) -vchzf $$ADIR$$NAME.tar.gz \
84 `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ; \
88 # This also makes me sick...
89 # autoconf generates a configure script that begins with a very hard to read,
90 # nearly impossible to customize --help blurb. This horrid set of regexps
91 # go through and clean up the help text, by inserting whitespace and ripping
92 # out options we don't use. Odds are good that this will fail with any version
93 # of autoconf other than the ones I've tried (2.12 and 2.13.)
98 @TMP=configure.$$$$ ; \
99 echo "munging configure's --help message..." ; \
102 while (<>) { $$file .= $$_; } \
105 s/^(Configuration:)$$/\n$$1\n/m; \
106 s/^(Directory and file names:)$$/\n$$1\n/m; \
107 s/^ --sbindir=.*\n//m; \
108 s/^ --sysconfdir.*\n//m; \
109 s/^ --sharedstatedir.*\n.*\n//m; \
110 s/^ --localstatedir.*\n//m; \
111 s/^ --infodir.*\n//m; \
112 s/^(Host type:)$$/\n$$1\n/m; \
113 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
114 s/--enable and --with options recognized://m; \
115 s/\n --with-x .*?(["\n])/$$1/s; \
116 s/\n(Installation options:\n)/$$1/s; \
118 s/^ --oldincludedir=.*$$/ \
119 --x-includes=DIR X include files are in DIR\n \
120 --x-libraries=DIR X library files are in DIR/m; \
122 s@mandir=.\$${prefix}/man.@mandir=\\\$${datadir}/man@; \
124 s@rm -f conftest@rm -rf conftest@g; \
129 cat $$TMP > configure ) ; \
134 SRC=utils/version.h ; \
135 VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ; \
137 MAJOR="$$1"; MINOR="$$2"; \
138 NEW=`echo $$MINOR + 1 | bc` ; \
139 NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ; \
140 D=`date '+%d-%b-%Y'`; \
142 if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then \
143 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
145 if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then \
146 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
148 /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? "; \
150 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
154 sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/" \
155 -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/" \
157 /bin/echo -n "New version and date are "; \
158 sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p" \
160 cat $$TMP > $$SRC ; \
162 echo "overwrote $$SRC"; \
165 bump_version:: bump-version
166 tick-version:: bump-version
167 tick_version:: bump-version
171 SRC=utils/version.h ; \
172 D=`date '+%d-%b-%Y'`; \
174 sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ; \
175 /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ; \
176 if cmp -s $$SRC $$TMP ; then \
177 echo "unchanged." ; \
179 cat $$TMP > $$SRC ; \
185 update_spec_version::
186 @S=$(srcdir)/xscreensaver.spec ; \
187 U=$(srcdir)/utils/version.h ; \
188 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ; \
189 /bin/echo -n "Updating $$S to \"$$VERS\"... " ; \
191 sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/" \
193 if cmp -s $$S $$T ; then \
194 echo "unchanged." ; \
203 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
204 DIR=`pwd`/rpm_build ; \
205 ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ; \
207 TGZ=xscreensaver-$$VERS.tar.gz ; \
208 if [ ! -f $${ADIR}$$TGZ ]; then \
209 echo "$${ADIR}$$TGZ does not exist! Did you forget to \`make tar'?" ; \
212 rm -rf /var/tmp/xscreensaver-$$VERS-root ; \
215 ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ; \
216 cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ; \
217 rpmbuild --define "_topdir $$DIR" \
218 --define "USE_GL yes" \
219 -v -ba xscreensaver.spec ; \
221 echo 'RPM build complete' ; \
223 rm -f $$DIR/$$TGZ ; \
224 rm -rf $$DIR/BUILD/xscreensaver-$$VERS ; \
225 mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ; \
226 mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ; \
229 ls -lFG xscreensaver*-$$VERS-*.rpm
233 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
234 D=xscreensaver-$$VERS ; \
236 NAME="$${ADIR}$$D.tar.gz" ; \
237 if [ ! -f $$NAME ]; then \
238 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
245 if [ -d $$D ]; then \
249 zcat $${ADIR}$$D.tar.gz | tar -xf - ; \
255 mkdir BIN/lesstif ; \
261 ../../configure --without-xpm --without-xdbe --without-xshm \
262 --with-motif=/usr/local/motif ; \
263 echo --------------------------------------------------------------- ; \
265 ( cd driver; gmake tests ) ; \
266 echo --------------------------------------------------------------- ); \
271 ../../configure --with-motif=/usr/local/lesstif --without-gnome ; \
272 echo --------------------------------------------------------------- ; \
273 ( cd utils; gmake all ) ; \
274 ( cd driver; gmake all ) ; \
275 echo --------------------------------------------------------------- ); \
280 cd OSX ; $(MAKE) release dmg
284 DEST=$$HOME/www/xscreensaver ; \
285 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
286 HEAD="xscreensaver-$$VERS" ; \
288 BNAME="$$HEAD.tar.gz" ; \
289 NAME="$$ADIR$$BNAME" ; \
290 DNAME="$$DEST/$$HEAD.tar.gz" ; \
291 BNAME2="$$HEAD.dmg" ; \
292 NAME2="$$ADIR$$BNAME2" ; \
293 DNAME2="$$DEST/$$HEAD.dmg" ; \
295 if [ ! -f $$NAME ]; then \
296 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
299 if [ ! -f $$NAME2 ]; then \
300 echo "$$NAME2 does not exist! Did you forget to \`make dmg'?" ; \
304 if [ -f $$DNAME ]; then \
305 /bin/echo -n "WARNING: $$DNAME already exists! Overwrite? "; \
307 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
311 if [ -f $$DNAME2 ]; then \
312 /bin/echo -n "WARNING: $$DNAME2 already exists! Overwrite? "; \
314 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
318 cp -p $$NAME $$DNAME ; \
319 cp -p $$NAME2 $$DNAME2 ; \
320 chmod u+w $$DNAME $$DNAME2 ; \
324 sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ; \
326 diff -U0 download.html $$TMP ; \
329 OLDEST=`ls xscreensaver*.tar.gz | head -1` ; \
330 /bin/echo -n "Delete $$DEST/$$OLDEST? "; \
332 if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then \
335 cvs remove $$OLDEST ; \
339 cvs add -kb $$BNAME $$BNAME2 ; \
340 cat $$TMP > download.html ; \
343 (cd ..; $(MAKE) xscreensaver/changelog.html \
344 xscreensaver/screenshots/index.html ); \
345 cvs diff -U0 changelog.html ; \
348 /bin/echo -n "Ok? "; \
350 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
354 cvs commit -m "$$VERS"
357 @for file in `find . -name '*.*' \
358 \! -name '*~' \! -name '*.o' \! -name '*.gz' \! -name '*.Z' \
359 \! -name '*.po' \! -name 'config.*' \! -name '*.glade*' \
360 \! -name '*.m4' \! -name '*.pdb' \! -name '*.xpm' \
361 \! -name '*.jpg' \! -name '*.gif' \! -name '*.eps' \
362 \! -name '*.png' \! -name '*.tif' \! -name '*.bak' \
365 y=`date -r "$$file" '+%Y'` ; \
366 if ! ( grep "\b$$y\b" $$file >/dev/null ); then \
367 if ( grep "opyright\|(c)\|\.BR" $$file >/dev/null ); then \
368 echo "$$file does not mention $$y" ; \
375 /bin/echo -n "Current hack count: " ; \
376 ( ( cd hacks; make -s INSTALL=true install-program install-scripts ) ; \
377 ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \