1 # Makefile.in --- xscreensaver, Copyright (c) 1999-2014 Jamie Zawinski.
2 # the `../configure' script generates `Makefile' from this file.
9 SUBDIRS = utils driver hacks hacks/glx po
10 SUBDIRS2 = $(SUBDIRS) OSX android
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 ax_pthread.m4 config.sub makevms.com \
15 intltool-merge.in intltool-extract.in intltool-update.in \
17 OSX/xscreensaver.xcodeproj/project.pbxproj
21 MAKE_SUBDIR = for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@ || exit 5; done
22 MAKE_SUBDIR2 = for dir in $(SUBDIRS2); do $(MAKE) -C $$dir $@ || exit 5; done
45 @$(MAKE) update_spec_version
47 @$(MAKE) -C po update-po
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 export COPYFILE_DISABLE=true ; \
84 GZIP="-9v" $(TAR) -vczf $$ADIR$$NAME.tar.gz \
85 `echo $(TARFILES) $$FILES | sed "s|^|$$NAME/|g; s| | $$NAME/|g" ` ; \
89 # This also makes me sick...
90 # autoconf generates a configure script that begins with a very hard to read,
91 # nearly impossible to customize --help blurb. This horrid set of regexps
92 # go through and clean up the help text, by inserting whitespace and ripping
93 # out options we don't use. Odds are good that this will fail with any version
94 # of autoconf other than the ones I've tried (2.12 and 2.13.)
100 @TMP=configure.$$$$ ; \
101 echo "munging configure's --help message..." ; \
104 while (<>) { $$file .= $$_; } \
107 s/^(Configuration:)$$/\n$$1\n/m; \
108 s/^(Directory and file names:)$$/\n$$1\n/m; \
109 s/^ --sbindir=.*\n//m; \
110 s/^ --sysconfdir.*\n//m; \
111 s/^ --sharedstatedir.*\n.*\n//m; \
112 s/^ --localstatedir.*\n//m; \
113 s/^ --infodir.*\n//m; \
114 s/^(Host type:)$$/\n$$1\n/m; \
115 s/\nFeatures and packages:\n.*library files are in DIR\n/\n/s;\
116 s/--enable and --with options recognized://m; \
117 s/\n --with-x .*?(["\n])/$$1/s; \
118 s/\n(Installation options:\n)/$$1/s; \
120 s/^ --oldincludedir=.*$$/ \
121 --x-includes=DIR X include files are in DIR\n \
122 --x-libraries=DIR X library files are in DIR/m; \
124 s@mandir=.\$${prefix}/man.@mandir=\\\$${datadir}/man@; \
126 s@rm -f conftest@rm -rf conftest@g; \
131 cat $$TMP > configure ) ; \
136 SRC=utils/version.h ; \
137 VERS=`sed -n 's/[^0-9]*\([0-9]\)\.\([0-9][^. ]*\).*/\1 \2/p' $$SRC` ; \
139 MAJOR="$$1"; MINOR="$$2"; \
140 NEW=`echo $$MINOR + 1 | bc` ; \
141 NEW=`echo $$NEW | sed 's/^\([0-9]\)$$/0\1/'` ; \
142 D=`date '+%d-%b-%Y'`; \
144 if [ ! -f $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz ]; then \
145 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$MINOR.tar.gz does not exist.";\
147 if [ -f $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz ]; then \
148 echo "WARNING: $${ADIR}xscreensaver-$$MAJOR.$$NEW.tar.gz already exists.";\
150 /bin/echo -n "Bumping $$MAJOR.$$MINOR to $$MAJOR.$$NEW ($$D), ok? "; \
152 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
156 sed -e "s/\([0-9]\.[0-9][0-9]*\)/$$MAJOR.$$NEW/" \
157 -e "s/\(([0-9][0-9]*-[A-Za-z][a-z][a-z]-[0-9][0-9][0-9]*\))/($$D)/" \
159 /bin/echo -n "New version and date are "; \
160 sed -n "s/[^0-9]*\([0-9]\.[0-9][0-9]*\) (\([-A-Za-z0-9]*\)).*/\1, \2./p" \
162 cat $$TMP > $$SRC ; \
164 echo "overwrote $$SRC"; \
167 bump_version:: bump-version
168 tick-version:: bump-version
169 tick_version:: bump-version
173 SRC=utils/version.h ; \
174 D=`date '+%d-%b-%Y'`; \
176 sed -e "s/([0-9][^()]*)/($$D)/" < $$SRC > $$TMP ; \
177 /bin/echo -n "Updating date in $$SRC to \"$$D\"... " ; \
178 if cmp -s $$SRC $$TMP ; then \
179 echo "unchanged." ; \
181 cat $$TMP > $$SRC ; \
187 update_spec_version::
188 @S=$(srcdir)/xscreensaver.spec ; \
189 U=$(srcdir)/utils/version.h ; \
190 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' < $$U` ; \
191 /bin/echo -n "Updating $$S to \"$$VERS\"... " ; \
193 sed "s/^\(%define.version[^0-9]*\)\(.*\)/\1$$VERS/" \
195 if cmp -s $$S $$T ; then \
196 echo "unchanged." ; \
205 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
206 DIR=`pwd`/rpm_build ; \
207 ARCH=`rpm --showrc | sed -n 's/^build arch *: //p'` ; \
209 TGZ=xscreensaver-$$VERS.tar.gz ; \
210 if [ ! -f $${ADIR}$$TGZ ]; then \
211 echo "$${ADIR}$$TGZ does not exist! Did you forget to \`make tar'?" ; \
214 rm -rf /var/tmp/xscreensaver-$$VERS-root ; \
217 ( cd $$DIR; mkdir BUILD RPMS RPMS/$$ARCH SOURCES SPECS SRPMS ) ; \
218 cp -p $${ADIR}$$TGZ $$DIR/SOURCES/ ; \
219 rpmbuild --define "_topdir $$DIR" \
220 --define "USE_GL yes" \
221 -v -ba xscreensaver.spec ; \
223 echo 'RPM build complete' ; \
225 rm -f $$DIR/$$TGZ ; \
226 rm -rf $$DIR/BUILD/xscreensaver-$$VERS ; \
227 mv $$DIR/SRPMS/xscreensaver*-$$VERS-*.rpm . ; \
228 mv $$DIR/RPMS/$$ARCH/xscreensaver*-$$VERS-*.rpm . ; \
231 ls -lFG xscreensaver*-$$VERS-*.rpm
235 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
236 D=xscreensaver-$$VERS ; \
238 NAME="$${ADIR}$$D.tar.gz" ; \
239 if [ ! -f $$NAME ]; then \
240 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
247 if [ -d $$D ]; then \
251 zcat $${ADIR}$$D.tar.gz | tar -xf - ; \
257 mkdir BIN/lesstif ; \
263 ../../configure --without-xpm --without-xdbe --without-xshm \
264 --with-motif=/usr/local/motif ; \
265 echo --------------------------------------------------------------- ; \
267 ( cd driver; gmake tests ) ; \
268 echo --------------------------------------------------------------- ); \
273 ../../configure --with-motif=/usr/local/lesstif --without-gnome ; \
274 echo --------------------------------------------------------------- ; \
275 ( cd utils; gmake all ) ; \
276 ( cd driver; gmake all ) ; \
277 echo --------------------------------------------------------------- ); \
282 $(MAKE) -C OSX release dmg
286 DEST=$$HOME/www/xscreensaver ; \
287 VERS=`sed -n 's/[^0-9]*\([0-9]\.[0-9][^. ]*\).*/\1/p' utils/version.h` ; \
288 HEAD="xscreensaver-$$VERS" ; \
290 BNAME="$$HEAD.tar.gz" ; \
291 NAME="$$ADIR$$BNAME" ; \
292 DNAME="$$DEST/$$HEAD.tar.gz" ; \
293 BNAME2="$$HEAD.dmg" ; \
294 NAME2="$$ADIR$$BNAME2" ; \
295 DNAME2="$$DEST/$$HEAD.dmg" ; \
297 if ! git diff --quiet ; then \
298 echo "uncommitted changes exist!" ; \
302 $(MAKE) -C OSX updates.xml ; \
304 if [ ! -f $$NAME ]; then \
305 echo "$$NAME does not exist! Did you forget to \`make tar'?" ; \
308 if [ ! -f $$NAME2 ]; then \
309 echo "$$NAME2 does not exist! Did you forget to \`make dmg'?" ; \
313 if [ -f $$DNAME ]; then \
314 /bin/echo -n "WARNING: $$DNAME already exists! Overwrite? "; \
316 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
320 if [ -f $$DNAME2 ]; then \
321 /bin/echo -n "WARNING: $$DNAME2 already exists! Overwrite? "; \
323 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
328 git tag -a "v$$VERS" -m "$$VERS" ; \
329 git commit -m "$$VERS" . ; \
331 ( cd $$DEST ; git pull ) ; \
333 cp -p $$NAME $$DNAME ; \
334 cp -p $$NAME2 $$DNAME2 ; \
335 chmod u+w $$DNAME $$DNAME2 ; \
336 cp -p OSX/updates.xml $$DEST ; \
340 sed "s/xscreensaver-5\.[0-9][0-9ab]*/$$HEAD/g" download.html > $$TMP ; \
342 diff -U0 download.html $$TMP ; \
345 for EXT in tar.gz dmg ; do \
346 OLDEST=`ls xscreensaver*.$$EXT | \
349 /bin/echo -n "Delete $$DEST/$$OLDEST? "; \
351 if [ "x$$line" = "xyes" -o "x$$line" = "xy" ]; then \
359 cat $$TMP > download.html ; \
362 git add $$BNAME $$BNAME2 ; \
364 $(MAKE) -C ../ xscreensaver/changelog.html xscreensaver/screenshots/index.html; \
365 git diff changelog.html ; \
368 /bin/echo -n "Ok? "; \
370 if [ "x$$line" != "xyes" -a "x$$line" != "xy" ]; then \
374 git tag -a "v$$VERS" -m "$$VERS" ; \
375 git commit -m "$$VERS" . ; \
381 /bin/echo -n "Current hack count: " ; \
382 ( ( cd hacks; make -s INSTALL=true install-program install-scripts ) ; \
383 ( cd hacks/glx; make -s INSTALL=true install-program ) ) | \