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@; \
127 cat $$TMP > configure ) ; \
132 SRC=utils/version.h ; \
133 VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ; \
135 MAJOR="$$1"; MINOR="$$2"; \
136 NEW=`echo $$MINOR + 1 | bc` ; \
137 NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ; \
138 D=`date '+%d-%b-%Y'`; \
140 if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then \
141 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
143 if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then \
144 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
146 echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? "; \
148 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
152 sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/" \
153 -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/" \
155 echo -n "New version and date are "; \
156 sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p" \
158 cat $$TMP > $$SRC ; \
160 echo "overwrote $$SRC"; \
163 bump_version:: bump-version
164 tick-version:: bump-version
165 tick_version:: bump-version
169 SRC=utils/version.h ; \
170 D=`date '+%d-%b-%Y'`; \
172 sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ; \
173 echo -n "Updating date in $$SRC to \"$$D\"... " ; \
174 if cmp -s $$SRC $$TMP ; then \
175 echo "unchanged." ; \
177 cat $$TMP > $$SRC ; \
183 update_spec_version::
184 @S=$(srcdir)/xscreensaver.spec ; \
185 U=$(srcdir)/utils/version.h ; \
186 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ; \
187 echo -n "Updating $$S to \"$$VERS\"... " ; \
189 sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/" \
191 if cmp -s $$S $$T ; then \
192 echo "unchanged." ; \
201 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
202 DIR=`pwd`/rpm_build ; \
203 ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ; \
205 TGZ=xscreensaver-$$VERS.tar.gz ; \
206 if [ ! -f $${ADIR}$$TGZ ]; then \
207 echo "$${ADIR}$$TGZ does not exist! Did you forget to \`make tar'?" ; \
210 rm -rf /var/tmp/xscreensaver-$$VERS-root ; \
213 ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ; \
214 cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ; \
215 rpmbuild --define "_topdir $$DIR" \
216 --define "USE_GL yes" \
217 -v -ba xscreensaver.spec ; \
219 echo 'RPM build complete' ; \
221 rm -f $$DIR/$$TGZ ; \
222 rm -rf $$DIR/BUILD/xscreensaver-$$VERS ; \
223 mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ; \
224 mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ; \
227 ls -lFG xscreensaver*-$$VERS-*.rpm
231 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
232 D=xscreensaver-$$VERS ; \
234 NAME="$${ADIR}$$D.tar.gz" ; \
235 if [ ! -f $$NAME ]; then \
236 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
243 if [ -d $$D ]; then \
247 zcat $${ADIR}$$D.tar.gz | tar -xf - ; \
253 mkdir BIN/lesstif ; \
259 ../../configure --without-xpm --without-xdbe --without-xshm \
260 --with-motif=/usr/local/motif ; \
261 echo --------------------------------------------------------------- ; \
263 ( cd driver; gmake tests ) ; \
264 echo --------------------------------------------------------------- ); \
269 ../../configure --with-motif=/usr/local/lesstif --without-gnome ; \
270 echo --------------------------------------------------------------- ; \
271 ( cd utils; gmake all ) ; \
272 ( cd driver; gmake all ) ; \
273 echo --------------------------------------------------------------- ); \
278 cd OSX ; $(MAKE) release dmg
282 DEST=$$HOME/www/xscreensaver ; \
283 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
284 HEAD="xscreensaver-$$VERS" ; \
286 BNAME="$$HEAD.tar.gz" ; \
287 NAME="$$ADIR$$BNAME" ; \
288 DNAME="$$DEST/$$HEAD.tar.gz" ; \
289 BNAME2="$$HEAD.dmg" ; \
290 NAME2="$$ADIR$$BNAME2" ; \
291 DNAME2="$$DEST/$$HEAD.dmg" ; \
293 if [ ! -f $$NAME ]; then \
294 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
297 if [ ! -f $$NAME2 ]; then \
298 echo "$$NAME2 does not exist! Did you forget to \`make dmg'?" ; \
302 if [ -f $$DNAME ]; then \
303 echo -n "WARNING: $$DNAME already exists! Overwrite? "; \
305 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
309 if [ -f $$DNAME2 ]; then \
310 echo -n "WARNING: $$DNAME2 already exists! Overwrite? "; \
312 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
316 cp -p $$NAME $$DNAME ; \
317 cp -p $$NAME2 $$DNAME2 ; \
318 chmod u+w $$DNAME $$DNAME2 ; \
322 sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ; \
324 diff -U0 download.html $$TMP ; \
327 OLDEST=`ls xscreensaver*.tar.gz | head -1` ; \
328 echo -n "Delete $$DEST/$$OLDEST? "; \
330 if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then \
333 cvs remove $$OLDEST ; \
337 cvs add -kb $$BNAME $$BNAME2 ; \
338 cat $$TMP > download.html ; \
341 (cd ..; $(MAKE) xscreensaver/changelog.html \
342 xscreensaver/screenshots/index.html ); \
343 cvs diff -U0 changelog.html ; \
348 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
352 cvs commit -m "$$VERS"
355 @for file in `find . -name '*.*' \
356 \! -name '*~' \! -name '*.o' \! -name '*.gz' \! -name '*.Z' \
357 \! -name '*.po' \! -name 'config.*' \! -name '*.glade*' \
358 \! -name '*.m4' \! -name '*.pdb' \! -name '*.xpm' \
359 \! -name '*.jpg' \! -name '*.gif' \! -name '*.eps' \
360 \! -name '*.png' \! -name '*.tif' \! -name '*.bak' \
363 y=`date -r "$$file" '+%Y'` ; \
364 if ! ( grep "\b$$y\b" $$file >/dev/null ); then \
365 if ( grep "opyright\|(c)\|\.BR" $$file >/dev/null ); then \
366 echo "$$file does not mention $$y" ; \
373 echo -n "Current hack count: " ; \
374 ( ( cd hacks; make -s INSTALL=true install-program install-scripts ) ; \
375 ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \