1 # utils/Makefile.in --- xscreensaver, Copyright (c) 1997-2000 Jamie Zawinski.
2 # the `../configure' script generates `utils/Makefile' from this file.
5 # The utilities in this directory are used mostly by the demos in ../hacks/.
6 # The Makefile in that directory builds executables by simply referencing
7 # the .o files in this directory.
10 ##############################################################################
12 # Some rambling about dynamic libraries follows, ignore it if you don't care
13 # (which is almost assuredly the case.)
16 # It would probably be sensible to just build a single .a file in this
17 # directory, and link the hacks against that (statically.) I haven't done
18 # that for two reasons: first, it works now, and why fix what ain't broke;
19 # second, it wouldn't actually improve anything for the end user (it would
20 # just make the Makefiles be a little smaller.)
22 # People sometimes suggest that the stuff in this directory should be in a
23 # dynamic library, and that the hacks should be linked dynamically against
24 # it. I haven't done this for a number of reasons:
26 # * First, the only thing that would improve would be disk space, in that
27 # the executable files themselves would be smaller. That's it. Many other
28 # things would get worse if we used a dynamic library:
30 # * Complication of installation procedures: suddenly, before any of the
31 # hacks will work, you need to have a dynamic library installed, and
32 # the system configured to use it. This is, basically, rocket science.
33 # Most people don't know how to do this, it's a huge pain, and on many
34 # systems, it requires root access.
36 # * Complication of the Makefile: every system builds dynamic libraries
37 # differently. Every compiler takes different flags. I don't want to
38 # do the hand-holding for the scores of Unix systems and compilers on
39 # which people try to build this program.
41 # * Reduction of maintainability: gdb is remarkably bad at dealing with
42 # debug info in dynamic libraries, and when debugging a hack, one would
43 # constantly be fighting the linker and the debugger (or linking
44 # statically when debugging.)
46 # * Version skew: when things are statically linked, it's perfectly ok to
47 # make incompatible changes to the APIs defined in this directory, so long
48 # as the current version in ../hacks/ is in sync. Much more care would
49 # need to be taken with such things if dynamic libraries were involved,
50 # to make sure that the major and minor versions of the library changed
51 # at the appropriate time. This isn't too hard, but it's more work, and
52 # yet another opportunity to screw up.
54 # * Runtime memory usage goes *up*. That's right, up! When a program
55 # links in a dynamic library, the whole library is brought into the
56 # address space, not just the files that are actually used. Normally,
57 # this is ok, because if several programs are using (for example)
58 # libX11.so, chances are that the savings outweighs the overhead. But
59 # the nature of xscreensaver is that only one of the hacks ever runs at
60 # a time -- so there would never be a second program using the utils/
61 # dynamic library with which things could be shared.
63 # * Runtime speed decreases slightly, since dynamic code is marginally
64 # slower. On modern machines, this probably doesn't make a perceptible
65 # difference, however.
67 # So basically, I just don't think using libraries would be a win, and it would
68 # definitely cause more of a maintenance and portability headache. However,
69 # if someone else wants to do the work to make it be an option to configure,
70 # and verifies that it works on several (more than three) different Unixes,
71 # I'd be happy to take the patches.
74 ##############################################################################
90 DEPEND_FLAGS = @DEPEND_FLAGS@
91 DEPEND_DEFINES = @DEPEND_DEFINES@
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@
96 INSTALL_DATA = @INSTALL_DATA@
97 INSTALL_DIRS = @INSTALL_DIRS@
101 INCLUDES = -I$(srcdir) -I.. @INCLUDES@
103 SRCS = alpha.c colors.c fade.c grabscreen.c hsv.c overlay.c \
104 resources.c spline.c usleep.c visual.c visual-gl.c xmu.c \
105 logo.c yarandom.c erase.c sgivideo.c xshm.c xdbe.c
106 OBJS = alpha.o colors.o fade.o grabscreen.o hsv.o overlay.o \
107 resources.o spline.o usleep.o visual.o visual-gl.o xmu.o \
108 logo.o yarandom.o erase.o sgivideo.o xshm.o xdbe.o
109 HDRS = alpha.h colors.h fade.h grabscreen.h hsv.h resources.h \
110 spline.h usleep.h utils.h version.h visual.h vroot.h xmu.h \
111 yarandom.h erase.h sgivideo.h xshm.h xdbe.h
112 LOGOS = logo-180.gif logo-180.xpm logo-50.gif logo-50.xpm \
113 logo-big.gif logo.eps
114 EXTRAS = README Makefile.in ad2c
115 VMSFILES = compile_axp.com compile_decc.com vms-gtod.c vms-gtod.h \
118 TARFILES = $(EXTRAS) $(VMSFILES) $(SRCS) $(HDRS) $(LOGOS)
124 install: install-program install-man
125 uninstall: uninstall-program uninstall-man
128 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
136 -rm -f *.o a.out core
139 -rm -f Makefile TAGS *~ "#"*
141 # Adds all current dependencies to Makefile
143 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
145 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
148 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
149 # close. This excludes dependencies on files in /usr/include, etc. It tries
150 # to include only dependencies on files which are themselves a part of this
153 @echo updating dependencies in `pwd`/Makefile.in... ; \
154 $(DEPEND) -w 0 -f - \
155 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
156 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
159 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
160 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
161 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
162 -e 's@ $$(srcdir)/\(.*config.h\)@ \1@g' ; \
164 ) > /tmp/distdepend.$$$$ && \
165 mv Makefile.in Makefile.in.bak && \
166 mv /tmp/distdepend.$$$$ Makefile.in
170 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
176 # How we build object files in this directory.
178 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
181 # Rules for generating the VMS makefiles on Unix, so that it doesn't have to
184 VMS_AXP_COMPILE=$$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-])
186 compile_axp.com: Makefile.in
187 @echo generating $@ from $<... ; \
188 ( ( for c in $(SRCS) vms-*.c ; do \
189 c=`echo $$c | tr a-z A-Z` ; \
190 echo "$(VMS_AXP_COMPILE) $$c" ; \
193 echo '$$ lib/cre utils.olb_axp' ; \
194 echo '$$ lib utils.olb_axp *.obj' ; \
195 echo '$$! delete/noconf *.obj;' ; \
198 compile_decc.com: compile_axp.com
199 @echo generating $@ from $<... ; \
200 sed 's/axp/decc/g' < $< > $@
202 distdepend:: compile_axp.com compile_decc.com
205 ##############################################################################
207 # DO NOT DELETE: updated by make distdepend
208 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
210 alpha.o: $(srcdir)/utils.h
212 alpha.o: $(srcdir)/alpha.h
213 alpha.o: $(srcdir)/visual.h
214 alpha.o: $(srcdir)/hsv.h
215 alpha.o: $(srcdir)/yarandom.h
216 alpha.o: $(srcdir)/resources.h
217 colors.o: $(srcdir)/utils.h
218 colors.o: ../config.h
219 colors.o: $(srcdir)/hsv.h
220 colors.o: $(srcdir)/yarandom.h
221 colors.o: $(srcdir)/visual.h
222 colors.o: $(srcdir)/colors.h
223 fade.o: $(srcdir)/utils.h
225 fade.o: $(srcdir)/visual.h
226 fade.o: $(srcdir)/usleep.h
227 fade.o: $(srcdir)/fade.h
228 grabscreen.o: $(srcdir)/utils.h
229 grabscreen.o: ../config.h
230 grabscreen.o: $(srcdir)/yarandom.h
231 grabscreen.o: $(srcdir)/usleep.h
232 grabscreen.o: $(srcdir)/colors.h
233 grabscreen.o: $(srcdir)/grabscreen.h
234 grabscreen.o: $(srcdir)/sgivideo.h
235 grabscreen.o: $(srcdir)/visual.h
236 grabscreen.o: $(srcdir)/resources.h
237 grabscreen.o: $(srcdir)/vroot.h
238 hsv.o: $(srcdir)/utils.h
240 hsv.o: $(srcdir)/hsv.h
241 overlay.o: $(srcdir)/utils.h
242 overlay.o: ../config.h
243 overlay.o: $(srcdir)/visual.h
244 resources.o: $(srcdir)/utils.h
245 resources.o: ../config.h
246 resources.o: $(srcdir)/resources.h
247 spline.o: $(srcdir)/utils.h
248 spline.o: ../config.h
249 spline.o: $(srcdir)/spline.h
250 usleep.o: ../config.h
251 visual.o: $(srcdir)/utils.h
252 visual.o: ../config.h
253 visual.o: $(srcdir)/resources.h
254 visual.o: $(srcdir)/visual.h
255 visual-gl.o: $(srcdir)/utils.h
256 visual-gl.o: ../config.h
257 visual-gl.o: $(srcdir)/visual.h
259 logo.o: $(srcdir)/utils.h
261 logo.o: $(srcdir)/resources.h
262 logo.o: $(srcdir)/logo-50.xpm
263 logo.o: $(srcdir)/logo-180.xpm
264 yarandom.o: ../config.h
265 yarandom.o: $(srcdir)/yarandom.h
266 erase.o: $(srcdir)/utils.h
268 erase.o: $(srcdir)/yarandom.h
269 erase.o: $(srcdir)/usleep.h
270 erase.o: $(srcdir)/resources.h
271 sgivideo.o: $(srcdir)/utils.h
272 sgivideo.o: ../config.h
273 sgivideo.o: $(srcdir)/sgivideo.h
274 sgivideo.o: $(srcdir)/resources.h
275 sgivideo.o: $(srcdir)/visual.h
276 xshm.o: $(srcdir)/utils.h
278 xshm.o: $(srcdir)/xshm.h
279 xshm.o: $(srcdir)/resources.h
280 xdbe.o: $(srcdir)/utils.h
282 xdbe.o: $(srcdir)/xdbe.h
283 xdbe.o: $(srcdir)/resources.h