1 # driver/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
2 # the `../configure' script generates `driver/Makefile' from this file.
13 exec_prefix = @exec_prefix@
16 man1dir = $(mandir)/man1
23 DEFS2 = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
27 DEPEND_FLAGS = @DEPEND_FLAGS@
28 DEPEND_DEFINES = @DEPEND_DEFINES@
32 SUID_FLAGS = -o root -m 4755
33 INSTALL_PROGRAM = @INSTALL_PROGRAM@
34 INSTALL_SETUID = @INSTALL_SETUID@
35 INSTALL_DATA = @INSTALL_DATA@
36 INSTALL_DIRS = @INSTALL_DIRS@
40 X_PRE_LIBS = @X_PRE_LIBS@
41 X_EXTRA_LIBS = @X_EXTRA_LIBS@
45 # X_LIBS would more properly be called X_LDFLAGS (it contains the -L args.)
46 # X_PRE_LIBS contains extra libraries you have to link against on some systems,
47 # and that must come before -lX11. (e.g., -lSM and -lICE.)
48 # X_EXTRA_LIBS contains extra libraries needed by X that aren't a part of X.
49 # (e.g., -lsocket, -lnsl, etc.)
51 # I think (but am not totally sure) that LIBS is also really "LDFLAGS".
53 # SAVER_LIBS is the link line for "xscreensaver", and
54 # CMD_LIBS is the link line for "xscreensaver-command".
57 AD_DIR = @APPDEFAULTS@
59 UTILS_SRC = $(srcdir)/../utils
62 INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
64 MOTIF_SRCS = dialogs-Xm.c
65 MOTIF_OBJS = dialogs-Xm.o
67 ATHENA_SRCS = dialogs-Xaw.c
68 ATHENA_OBJS = dialogs-Xaw.o
73 KERBEROS_SRCS = kpasswd.c
74 KERBEROS_OBJS = kpasswd.o
79 TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c
81 TOOLKIT_SRCS = @TOOLKIT_SRCS@
82 TOOLKIT_OBJS = @TOOLKIT_OBJS@
83 TOOLKIT_LIBS = @TOOLKIT_LIBS@
85 PASSWD_SRCS = @PASSWD_SRCS@
86 PASSWD_OBJS = @PASSWD_OBJS@
87 PASSWD_LIBS = @PASSWD_LIBS@
89 LOCK_SRCS = @LOCK_SRCS@
90 LOCK_OBJS = @LOCK_OBJS@
92 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
93 $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
94 $(UTILS_SRC)/visual.c $(UTILS_SRC)/xroger.c \
95 $(UTILS_SRC)/spline.c $(UTILS_SRC)/yarandom.c
96 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
97 $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
98 $(UTILS_BIN)/visual.o $(UTILS_BIN)/xroger.o \
99 $(UTILS_BIN)/spline.o $(UTILS_BIN)/yarandom.o
101 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
102 $(UTILS_SRC)/visual.c
103 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
104 $(UTILS_BIN)/visual.o
106 SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
107 xset.c splash.c setuid.c stderr.c
108 SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
109 xset.o splash.o setuid.o stderr.o
111 SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
112 $(SAVER_UTIL_SRCS) @XMU_SRCS@
113 SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
114 $(SAVER_UTIL_OBJS) @XMU_OBJS@
116 CMD_SRCS = remote.c xscreensaver-command.c
117 CMD_OBJS = remote.o xscreensaver-command.o
119 DEMO_SRCS_1 = demo.c prefs.c
120 DEMO_OBJS_1 = demo.o prefs.o
122 DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
123 $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
124 DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
125 $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
127 SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
128 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
131 CMD_LIBS = $(LIBS) $(X_LIBS) \
132 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
134 DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
135 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
137 EXES = xscreensaver xscreensaver-command xscreensaver-demo
139 HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
140 MEN = xscreensaver.man xscreensaver-demo.man \
141 xscreensaver-command.man
142 EXTRAS = README Makefile.in XScreenSaver.ad.in dialogs.xd .gdbinit
143 VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
144 vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
145 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
147 TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
148 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
149 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(HDRS) \
155 install: install-program install-ad install-man
156 uninstall: uninstall-program uninstall-ad uninstall-man
159 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
160 INSTALL_SETUID='$(INSTALL_SETUID) -s' \
163 install-program: $(EXES)
164 @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
165 @inst="$(INSTALL_PROGRAM)" ; \
166 if [ @NEED_SETUID@ = yes ]; then \
168 if [ "$$me" = root ]; then \
169 inst="$(INSTALL_SETUID)" ; \
173 $$e " Warning: xscreensaver has been compiled with support for shadow" ;\
174 $$e " passwords. If your system actually uses shadow passwords," ;\
175 $$e " then xscreensaver must be installed as a setuid root" ;\
176 $$e " program in order for locking to work. To do this, you" ;\
177 $$e " must run 'make install' as 'root', not as '$$me'." ;\
179 $$e " For now, xscreensaver will be installed non-setuid, which" ;\
180 $$e " means that locking might not work. (Try it and see.)" ;\
184 echo $$inst xscreensaver $(bindir)/xscreensaver ; \
185 $$inst xscreensaver $(bindir)/xscreensaver
186 $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
187 $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
189 install-ad: XScreenSaver.ad
190 @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
191 $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver
195 if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
196 for man in $$men; do \
197 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
198 echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
199 $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
203 @for program in $(EXES); do \
204 echo rm -f $(bindir)/$$program ; \
205 rm -f $(bindir)/$$program ; \
209 rm -f $(AD_DIR)/XScreenSaver
213 for man in $$men; do \
214 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
215 echo rm -f $(man1dir)/$$instname ; \
216 rm -f $(man1dir)/$$instname ; \
220 -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
223 -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
225 # Adds all current dependencies to Makefile
226 depend: XScreenSaver_ad.h
227 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
229 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
230 $(SAVER_SRCS) $(CMD_SRCS)
232 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
233 # close. This excludes dependencies on files in /usr/include, etc. It tries
234 # to include only dependencies on files which are themselves a part of this
236 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
237 @echo updating dependencies in `pwd`/Makefile.in... ; \
238 $(DEPEND) -w 0 -f - \
239 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
240 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
241 $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
242 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
244 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
245 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
246 -e 's@\.\./utils@$$(UTILS_SRC)@g' \
247 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
248 -e 's@$$.*\(XScreenSaver_ad\)@\1@g' \
249 -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ; \
251 ) > /tmp/distdepend.$$$$ && \
252 mv Makefile.in Makefile.in.bak && \
253 mv /tmp/distdepend.$$$$ Makefile.in
255 # Updates the version number in the app-defaults file to be in sync with
256 # the version number in version.h. This is so people can tell when they
257 # have a version skew between the app-defaults file and the executable.
259 @S=XScreenSaver.ad.in ; \
260 U=$(UTILS_SRC)/version.h ; \
261 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
262 D=`date '+%d-%b-%y'` ; \
263 echo -n "Updating version number in $$S to $$V $$D... " ; \
265 sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/" \
266 -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9]\)/$$D/" \
268 if cmp -s $$S $$T ; then \
269 echo "unchanged." ; \
277 @for S in $(MEN); do \
278 U=$(UTILS_SRC)/version.h ; \
279 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
280 V="`date '+%d-%b-%y'` ($$V)" ; \
281 echo -n "Updating footer in $$S to \"$$V\"... " ; \
283 sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/" \
285 if cmp -s $$S $$T ; then \
286 echo "unchanged." ; \
296 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
299 @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
303 # Rules for noticing when the objects from the utils directory are out of
304 # date with respect to their sources, and going and building them according
305 # to the rules in their own Makefile...
307 $(UTILS_BIN)/fade.o: $(UTILS_SRC)/fade.c
308 $(UTILS_BIN)/overlay.o: $(UTILS_SRC)/overlay.c
309 $(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
310 $(UTILS_BIN)/usleep.o: $(UTILS_SRC)/usleep.c
311 $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c
312 $(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
313 $(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
314 $(UTILS_BIN)/spline.o: $(UTILS_SRC)/spline.c
315 $(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
319 $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
321 # How we build object files in this directory.
323 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
325 # subprocs is the only one that takes an extra -D option.
326 subprocs.o: subprocs.c
327 $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
330 # How we build the default app-defaults file into the program.
332 XScreenSaver_ad.h: XScreenSaver.ad
333 $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
335 # The executables linked in this directory.
337 xscreensaver: $(SAVER_OBJS)
338 $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
340 xscreensaver-command: $(CMD_OBJS)
341 $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
343 xscreensaver-demo: $(DEMO_OBJS)
344 $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
348 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PWENT_OBJS) $(TOOLKIT_OBJS) \
349 subprocs.o setuid.o demo.o splash.o prefs.o \
351 test-passwd.o: XScreenSaver_ad.h
353 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
354 $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
357 $(CC) $(LDFLAGS) -o $@ test-uid.o
359 test-xdpms: test-xdpms.o
360 $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
363 # This kludge is so that I can build/test the Athena version of the
364 # xscreensaver-demo program without having to re-run configure.
365 # Normally it builds it with Motif if possible; this lets me build
368 xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
369 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
370 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
371 $(LIBS) $(X_LIBS) -lXaw \
372 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
373 xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
374 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
375 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
376 $(LIBS) $(X_LIBS) -lXaw3d \
377 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
378 demo-Xaw.o: demo.c XScreenSaver_ad.h
379 $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
380 $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
384 ##############################################################################
386 # DO NOT DELETE: updated by make distdepend
387 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
389 xscreensaver.o: ../config.h
390 xscreensaver.o: $(srcdir)/xscreensaver.h
391 xscreensaver.o: $(srcdir)/prefs.h
392 xscreensaver.o: $(UTILS_SRC)/version.h
393 xscreensaver.o: $(UTILS_SRC)/yarandom.h
394 xscreensaver.o: $(UTILS_SRC)/resources.h
395 xscreensaver.o: $(UTILS_SRC)/visual.h
396 xscreensaver.o: XScreenSaver_ad.h
397 windows.o: ../config.h
398 windows.o: $(srcdir)/xscreensaver.h
399 windows.o: $(srcdir)/prefs.h
400 windows.o: $(UTILS_SRC)/visual.h
401 windows.o: $(UTILS_SRC)/fade.h
402 timers.o: ../config.h
403 timers.o: $(srcdir)/xscreensaver.h
404 timers.o: $(srcdir)/prefs.h
405 subprocs.o: ../config.h
406 subprocs.o: $(srcdir)/xscreensaver.h
407 subprocs.o: $(srcdir)/prefs.h
408 subprocs.o: $(UTILS_SRC)/yarandom.h
410 xset.o: $(srcdir)/xscreensaver.h
411 xset.o: $(srcdir)/prefs.h
412 splash.o: ../config.h
413 splash.o: $(srcdir)/xscreensaver.h
414 splash.o: $(srcdir)/prefs.h
415 splash.o: $(UTILS_SRC)/resources.h
416 setuid.o: ../config.h
417 setuid.o: $(srcdir)/xscreensaver.h
418 setuid.o: $(srcdir)/prefs.h
419 stderr.o: ../config.h
420 stderr.o: $(srcdir)/xscreensaver.h
421 stderr.o: $(srcdir)/prefs.h
422 stderr.o: $(UTILS_SRC)/resources.h
423 stderr.o: $(UTILS_SRC)/visual.h
424 dialogs-Xm.o: ../config.h
425 dialogs-Xm.o: $(UTILS_SRC)/visual.h
426 dialogs-Xaw.o: ../config.h
427 dialogs-Xaw.o: $(UTILS_SRC)/visual.h
428 passwd.o: ../config.h
430 lock.o: $(srcdir)/xscreensaver.h
431 lock.o: $(srcdir)/prefs.h
432 lock.o: $(UTILS_SRC)/resources.h
434 demo.o: $(UTILS_SRC)/version.h
435 demo.o: $(srcdir)/prefs.h
436 demo.o: $(UTILS_SRC)/resources.h
437 demo.o: $(UTILS_SRC)/visual.h
438 demo.o: $(srcdir)/remote.h
439 demo.o: XScreenSaver_ad.h
441 prefs.o: $(srcdir)/prefs.h
442 prefs.o: $(UTILS_SRC)/resources.h
443 remote.o: ../config.h
444 remote.o: $(srcdir)/remote.h
445 xscreensaver-command.o: ../config.h
446 xscreensaver-command.o: $(srcdir)/remote.h
447 xscreensaver-command.o: $(UTILS_SRC)/version.h
448 test-passwd.o: ../config.h
449 test-passwd.o: $(srcdir)/xscreensaver.h
450 test-passwd.o: $(srcdir)/prefs.h
451 test-passwd.o: $(UTILS_SRC)/resources.h
452 test-passwd.o: $(UTILS_SRC)/version.h
453 test-passwd.o: XScreenSaver_ad.h
454 test-uid.o: ../config.h
455 test-xdpms.o: ../config.h