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 PAM_CONF = /etc/pam.conf
61 UTILS_SRC = $(srcdir)/../utils
64 INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
66 MOTIF_SRCS = dialogs-Xm.c
67 MOTIF_OBJS = dialogs-Xm.o
69 ATHENA_SRCS = dialogs-Xaw.c
70 ATHENA_OBJS = dialogs-Xaw.o
72 PWENT_SRCS = passwd-pwent.c
73 PWENT_OBJS = passwd-pwent.o
75 KERBEROS_SRCS = passwd-kerberos.c
76 KERBEROS_OBJS = passwd-kerberos.o
78 PAM_SRCS = passwd-pam.c
79 PAM_OBJS = passwd-pam.o
81 LOCK_SRCS_1 = lock.c passwd.c
82 LOCK_OBJS_1 = lock.o passwd.o
84 TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c test-grab.c
86 TOOLKIT_SRCS = @TOOLKIT_SRCS@
87 TOOLKIT_OBJS = @TOOLKIT_OBJS@
88 TOOLKIT_LIBS = @TOOLKIT_LIBS@
90 PASSWD_SRCS = @PASSWD_SRCS@
91 PASSWD_OBJS = @PASSWD_OBJS@
92 PASSWD_LIBS = @PASSWD_LIBS@
94 LOCK_SRCS = @LOCK_SRCS@
95 LOCK_OBJS = @LOCK_OBJS@
97 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
99 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
100 $(UTILS_BIN)/visual.o
102 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
103 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/spline.c \
104 $(UTILS_SRC)/yarandom.c \
106 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
107 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/spline.o \
108 $(UTILS_BIN)/yarandom.o \
111 SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
112 xset.c splash.c setuid.c stderr.c
113 SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
114 xset.o splash.o setuid.o stderr.o
116 SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
117 $(SAVER_UTIL_SRCS) @XMU_SRCS@
118 SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
119 $(SAVER_UTIL_OBJS) @XMU_OBJS@
121 CMD_SRCS = remote.c xscreensaver-command.c
122 CMD_OBJS = remote.o xscreensaver-command.o
124 DEMO_SRCS_1 = demo.c prefs.c
125 DEMO_OBJS_1 = demo.o prefs.o
127 DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
128 $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
129 DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
130 $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
132 SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
133 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
136 CMD_LIBS = $(LIBS) $(X_LIBS) \
137 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
139 DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
140 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
142 EXES = xscreensaver xscreensaver-command xscreensaver-demo
144 HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
145 MEN = xscreensaver.man xscreensaver-demo.man \
146 xscreensaver-command.man
147 EXTRAS = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
149 VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
150 vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
151 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
153 TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
154 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
155 $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \
156 $(HDRS) $(TEST_SRCS) $(MEN)
161 install: install-program install-ad install-man @INSTALL_PAM@
162 uninstall: uninstall-program uninstall-ad uninstall-man
165 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
166 INSTALL_SETUID='$(INSTALL_SETUID) -s' \
169 install-program: $(EXES)
170 @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
171 @inst="$(INSTALL_PROGRAM)" ; \
172 if [ @NEED_SETUID@ = yes ]; then \
174 if [ "$$me" = root ]; then \
175 inst="$(INSTALL_SETUID)" ; \
179 $$e " ####################################################################";\
180 $$e " Warning: xscreensaver has been compiled with support for shadow" ;\
181 $$e " passwords. If your system actually uses shadow passwords," ;\
182 $$e " then xscreensaver must be installed as a setuid root" ;\
183 $$e " program in order for locking to work. To do this, you" ;\
184 $$e " must run 'make install' as 'root', not as '$$me'." ;\
186 $$e " For now, xscreensaver will be installed non-setuid, which" ;\
187 $$e " means that locking might not work. (Try it and see.)" ;\
188 $$e " ####################################################################";\
192 echo $$inst xscreensaver $(bindir)/xscreensaver ; \
193 $$inst xscreensaver $(bindir)/xscreensaver
194 $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
195 $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
197 install-ad: XScreenSaver.ad
198 @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
199 @-echo $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; \
200 if $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; then \
204 if [ -f $(AD_DIR)/XScreenSaver ]; then \
206 $$e " ####################################################################";\
207 $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
208 $$e " That file exists, and is unwritable. It is probably from" ;\
209 $$e " an older version of xscreensaver, and could cause things" ;\
210 $$e " to malfunction. Please delete it!" ;\
211 $$e " ####################################################################";\
216 $$e " ####################################################################";\
217 $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
218 $$e " The directory is unwritable. This is probably ok;" ;\
219 $$e " xscreensaver should work without that file." ;\
220 $$e " ####################################################################";\
228 if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
229 for man in $$men; do \
230 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
231 echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
232 $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
236 @for program in $(EXES); do \
237 echo rm -f $(bindir)/$$program ; \
238 rm -f $(bindir)/$$program ; \
242 rm -f $(AD_DIR)/XScreenSaver
246 for man in $$men; do \
247 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
248 echo rm -f $(man1dir)/$$instname ; \
249 rm -f $(man1dir)/$$instname ; \
253 @src="$(srcdir)/xscreensaver.pam" ; \
254 dest=`sed -n 's/.*PAM_SERVICE_NAME[ ]*"\([^"]*\)".*$$/\1/p' \
257 conf="$(PAM_CONF)" ; \
259 if [ -d $$dir ] ; then \
260 echo $(INSTALL_DATA) $$src $$dir/$$dest ; \
261 $(INSTALL_DATA) $$src $$dir/$$dest ; \
262 if [ ! -f $$dir/$$dest ]; then \
265 $$e " ####################################################################";\
266 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
267 $$e " Authentication Modules (PAM). However, we were unable to" ;\
268 $$e " install the file $$dir/$$dest. PAM is unlikely" ;\
269 $$e " to work without this file (and old-style password" ;\
270 $$e " authentication will be used instead, which may or may not" ;\
272 $$e " ####################################################################";\
275 elif [ -f $$conf ]; then \
276 if ( grep $$dest $$conf >/dev/null ); then \
281 $$e " ####################################################################";\
282 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
283 $$e " Authentication Modules (PAM). To complete the installation";\
284 $$e " of PAM support, you must add this to the file $$conf:" ;\
285 $$e " ####################################################################";\
287 cat $$src | grep -v '#%' | sed "s/^/ $$dest /" ; \
294 -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
297 -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
299 # Adds all current dependencies to Makefile
300 depend: XScreenSaver_ad.h
301 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
303 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
304 $(SAVER_SRCS) $(CMD_SRCS)
306 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
307 # close. This excludes dependencies on files in /usr/include, etc. It tries
308 # to include only dependencies on files which are themselves a part of this
310 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
311 @echo updating dependencies in `pwd`/Makefile.in... ; \
312 $(DEPEND) -w 0 -f - \
313 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
314 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
315 $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
316 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
318 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
319 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
320 -e 's@\.\./utils@$$(UTILS_SRC)@g' \
321 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
322 -e 's@$$.*\(XScreenSaver_ad\)@\1@g' \
323 -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ; \
325 ) > /tmp/distdepend.$$$$ && \
326 mv Makefile.in Makefile.in.bak && \
327 mv /tmp/distdepend.$$$$ Makefile.in
329 # Updates the version number in the app-defaults file to be in sync with
330 # the version number in version.h. This is so people can tell when they
331 # have a version skew between the app-defaults file and the executable.
333 @S=XScreenSaver.ad.in ; \
334 U=$(UTILS_SRC)/version.h ; \
335 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
336 D=`date '+%d-%b-%y'` ; \
337 echo -n "Updating version number in $$S to $$V $$D... " ; \
339 sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/" \
340 -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9]\)/$$D/" \
342 if cmp -s $$S $$T ; then \
343 echo "unchanged." ; \
351 @for S in $(MEN); do \
352 U=$(UTILS_SRC)/version.h ; \
353 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
354 V="`date '+%d-%b-%y'` ($$V)" ; \
355 echo -n "Updating footer in $$S to \"$$V\"... " ; \
357 sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/" \
359 if cmp -s $$S $$T ; then \
360 echo "unchanged." ; \
370 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
373 @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
377 # Rules for noticing when the objects from the utils directory are out of
378 # date with respect to their sources, and going and building them according
379 # to the rules in their own Makefile...
381 $(UTILS_BIN)/fade.o: $(UTILS_SRC)/fade.c
382 $(UTILS_BIN)/overlay.o: $(UTILS_SRC)/overlay.c
383 $(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
384 $(UTILS_BIN)/usleep.o: $(UTILS_SRC)/usleep.c
385 $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c
386 $(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
387 $(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
388 $(UTILS_BIN)/spline.o: $(UTILS_SRC)/spline.c
389 $(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
393 $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
395 # How we build object files in this directory.
397 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
399 # subprocs is the only one that takes an extra -D option.
400 subprocs.o: subprocs.c
401 $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
404 # How we build the default app-defaults file into the program.
406 XScreenSaver_ad.h: XScreenSaver.ad
407 $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
409 # The executables linked in this directory.
411 xscreensaver: $(SAVER_OBJS)
412 $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
414 xscreensaver-command: $(CMD_OBJS)
415 $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
417 xscreensaver-demo: $(DEMO_OBJS)
418 $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
422 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
423 subprocs.o setuid.o splash.o prefs.o \
425 test-passwd.o: XScreenSaver_ad.h
427 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
428 $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
431 $(CC) $(LDFLAGS) -o $@ test-uid.o
433 test-xdpms: test-xdpms.o
434 $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
436 test-grab: test-grab.o
437 $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
440 # This kludge is so that I can build/test the Athena version of the
441 # xscreensaver-demo program without having to re-run configure.
442 # Normally it builds it with Motif if possible; this lets me build
445 xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
446 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
447 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
448 $(LIBS) $(X_LIBS) -lXaw \
449 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
450 xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
451 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
452 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
453 $(LIBS) $(X_LIBS) -lXaw3d \
454 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
455 demo-Xaw.o: demo.c XScreenSaver_ad.h
456 $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
457 $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
461 ##############################################################################
463 # DO NOT DELETE: updated by make distdepend
464 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
466 xscreensaver.o: ../config.h
467 xscreensaver.o: $(srcdir)/xscreensaver.h
468 xscreensaver.o: $(srcdir)/prefs.h
469 xscreensaver.o: $(UTILS_SRC)/version.h
470 xscreensaver.o: $(UTILS_SRC)/yarandom.h
471 xscreensaver.o: $(UTILS_SRC)/resources.h
472 xscreensaver.o: $(UTILS_SRC)/visual.h
473 xscreensaver.o: $(UTILS_SRC)/usleep.h
474 xscreensaver.o: XScreenSaver_ad.h
475 windows.o: ../config.h
476 windows.o: $(srcdir)/xscreensaver.h
477 windows.o: $(srcdir)/prefs.h
478 windows.o: $(UTILS_SRC)/visual.h
479 windows.o: $(UTILS_SRC)/fade.h
480 timers.o: ../config.h
481 timers.o: $(srcdir)/xscreensaver.h
482 timers.o: $(srcdir)/prefs.h
483 subprocs.o: ../config.h
484 subprocs.o: $(srcdir)/xscreensaver.h
485 subprocs.o: $(srcdir)/prefs.h
486 subprocs.o: $(UTILS_SRC)/yarandom.h
488 xset.o: $(srcdir)/xscreensaver.h
489 xset.o: $(srcdir)/prefs.h
490 splash.o: ../config.h
491 splash.o: $(srcdir)/xscreensaver.h
492 splash.o: $(srcdir)/prefs.h
493 splash.o: $(UTILS_SRC)/resources.h
494 setuid.o: ../config.h
495 setuid.o: $(srcdir)/xscreensaver.h
496 setuid.o: $(srcdir)/prefs.h
497 stderr.o: ../config.h
498 stderr.o: $(srcdir)/xscreensaver.h
499 stderr.o: $(srcdir)/prefs.h
500 stderr.o: $(UTILS_SRC)/resources.h
501 stderr.o: $(UTILS_SRC)/visual.h
502 dialogs-Xm.o: ../config.h
503 dialogs-Xm.o: $(UTILS_SRC)/visual.h
504 dialogs-Xaw.o: ../config.h
505 dialogs-Xaw.o: $(UTILS_SRC)/visual.h
506 passwd-pwent.o: ../config.h
508 lock.o: $(srcdir)/xscreensaver.h
509 lock.o: $(srcdir)/prefs.h
510 lock.o: $(UTILS_SRC)/resources.h
511 passwd.o: ../config.h
513 demo.o: $(UTILS_SRC)/version.h
514 demo.o: $(srcdir)/prefs.h
515 demo.o: $(UTILS_SRC)/resources.h
516 demo.o: $(UTILS_SRC)/visual.h
517 demo.o: $(srcdir)/remote.h
518 demo.o: $(UTILS_SRC)/usleep.h
519 demo.o: XScreenSaver_ad.h
521 prefs.o: $(srcdir)/prefs.h
522 prefs.o: $(UTILS_SRC)/resources.h
523 remote.o: ../config.h
524 remote.o: $(srcdir)/remote.h
525 xscreensaver-command.o: ../config.h
526 xscreensaver-command.o: $(srcdir)/remote.h
527 xscreensaver-command.o: $(UTILS_SRC)/version.h
528 test-passwd.o: ../config.h
529 test-passwd.o: $(srcdir)/xscreensaver.h
530 test-passwd.o: $(srcdir)/prefs.h
531 test-passwd.o: $(UTILS_SRC)/resources.h
532 test-passwd.o: $(UTILS_SRC)/version.h
533 test-passwd.o: $(UTILS_SRC)/visual.h
534 test-passwd.o: XScreenSaver_ad.h
535 test-uid.o: ../config.h
536 test-xdpms.o: ../config.h
537 test-grab.o: ../config.h