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@
100 GL_SRCS = @SAVER_GL_SRCS@
101 GL_OBJS = @SAVER_GL_OBJS@
102 GL_LIBS = @SAVER_GL_LIBS@
104 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
105 $(UTILS_SRC)/visual.c
106 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
107 $(UTILS_BIN)/visual.o
109 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
110 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/spline.c \
111 $(UTILS_SRC)/yarandom.c \
113 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
114 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/spline.o \
115 $(UTILS_BIN)/yarandom.o \
118 SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
119 xset.c splash.c setuid.c stderr.c
120 SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
121 xset.o splash.o setuid.o stderr.o
123 SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
124 $(SAVER_UTIL_SRCS) $(GL_SRCS) $(XMU_SRCS)
125 SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
126 $(SAVER_UTIL_OBJS) $(GL_OBJS) $(XMU_OBJS)
128 CMD_SRCS = remote.c xscreensaver-command.c
129 CMD_OBJS = remote.o xscreensaver-command.o
131 DEMO_SRCS_1 = demo.c prefs.c
132 DEMO_OBJS_1 = demo.o prefs.o
134 DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
135 $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
136 DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
137 $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
139 SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ $(GL_LIBS) \
140 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
143 CMD_LIBS = $(LIBS) $(X_LIBS) \
144 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
146 DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
147 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
149 EXES = xscreensaver xscreensaver-command xscreensaver-demo
151 HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
152 MEN = xscreensaver.man xscreensaver-demo.man \
153 xscreensaver-command.man
154 EXTRAS = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
156 VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
157 vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
158 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
160 TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
161 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
162 $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \
163 $(HDRS) $(TEST_SRCS) $(MEN)
168 install: install-program install-ad install-man @INSTALL_PAM@
169 uninstall: uninstall-program uninstall-ad uninstall-man
172 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
173 INSTALL_SETUID='$(INSTALL_SETUID) -s' \
176 install-program: $(EXES)
177 @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
178 @inst="$(INSTALL_PROGRAM)" ; \
179 if [ @NEED_SETUID@ = yes ]; then \
181 if [ "$$me" = root ]; then \
182 inst="$(INSTALL_SETUID)" ; \
186 $$e " ####################################################################";\
187 $$e " Warning: xscreensaver has been compiled with support for shadow" ;\
188 $$e " passwords. If your system actually uses shadow passwords," ;\
189 $$e " then xscreensaver must be installed as a setuid root" ;\
190 $$e " program in order for locking to work. To do this, you" ;\
191 $$e " must run 'make install' as 'root', not as '$$me'." ;\
193 $$e " For now, xscreensaver will be installed non-setuid, which" ;\
194 $$e " means that locking might not work. (Try it and see.)" ;\
195 $$e " ####################################################################";\
199 echo $$inst xscreensaver $(bindir)/xscreensaver ; \
200 $$inst xscreensaver $(bindir)/xscreensaver
201 $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
202 $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
204 install-ad: XScreenSaver.ad
205 @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
206 @-echo $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; \
207 if $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver ; then \
211 if [ -f $(AD_DIR)/XScreenSaver ]; then \
213 $$e " ####################################################################";\
214 $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
215 $$e " That file exists, and is unwritable. It is probably from" ;\
216 $$e " an older version of xscreensaver, and could cause things" ;\
217 $$e " to malfunction. Please delete it!" ;\
218 $$e " ####################################################################";\
223 $$e " ####################################################################";\
224 $$e " Warning: unable to install $(AD_DIR)/XScreenSaver" ;\
225 $$e " The directory is unwritable. This is probably ok;" ;\
226 $$e " xscreensaver should work without that file." ;\
227 $$e " ####################################################################";\
235 if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
236 for man in $$men; do \
237 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
238 echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
239 $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
243 @for program in $(EXES); do \
244 echo rm -f $(bindir)/$$program ; \
245 rm -f $(bindir)/$$program ; \
249 rm -f $(AD_DIR)/XScreenSaver
253 for man in $$men; do \
254 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
255 echo rm -f $(man1dir)/$$instname ; \
256 rm -f $(man1dir)/$$instname ; \
260 @src="$(srcdir)/xscreensaver.pam" ; \
261 dest=`sed -n 's/.*PAM_SERVICE_NAME[ ]*"\([^"]*\)".*$$/\1/p' \
264 conf="$(PAM_CONF)" ; \
266 if [ -d $$dir ] ; then \
267 echo $(INSTALL_DATA) $$src $$dir/$$dest ; \
268 $(INSTALL_DATA) $$src $$dir/$$dest ; \
269 if [ ! -f $$dir/$$dest ]; then \
272 $$e " ####################################################################";\
273 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
274 $$e " Authentication Modules (PAM). However, we were unable to" ;\
275 $$e " install the file $$dir/$$dest. PAM is unlikely" ;\
276 $$e " to work without this file (and old-style password" ;\
277 $$e " authentication will be used instead, which may or may not" ;\
279 $$e " ####################################################################";\
282 elif [ -f $$conf ]; then \
283 if ( grep $$dest $$conf >/dev/null ); then \
288 $$e " ####################################################################";\
289 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
290 $$e " Authentication Modules (PAM). To complete the installation";\
291 $$e " of PAM support, you must add this to the file $$conf:" ;\
292 $$e " ####################################################################";\
294 cat $$src | grep -v '#%' | sed "s/^/ $$dest /" ; \
301 -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
304 -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
306 # Adds all current dependencies to Makefile
307 depend: XScreenSaver_ad.h
308 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
310 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
311 $(SAVER_SRCS) $(CMD_SRCS)
313 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
314 # close. This excludes dependencies on files in /usr/include, etc. It tries
315 # to include only dependencies on files which are themselves a part of this
317 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
318 @echo updating dependencies in `pwd`/Makefile.in... ; \
319 $(DEPEND) -w 0 -f - \
320 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
321 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
322 $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
323 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
325 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
326 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
327 -e 's@\.\./utils@$$(UTILS_SRC)@g' \
328 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
329 -e 's@$$.*\(XScreenSaver_ad\)@\1@g' \
330 -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ; \
332 ) > /tmp/distdepend.$$$$ && \
333 mv Makefile.in Makefile.in.bak && \
334 mv /tmp/distdepend.$$$$ Makefile.in
336 # Updates the version number in the app-defaults file to be in sync with
337 # the version number in version.h. This is so people can tell when they
338 # have a version skew between the app-defaults file and the executable.
340 @S=XScreenSaver.ad.in ; \
341 U=$(UTILS_SRC)/version.h ; \
342 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
343 D=`date '+%d-%b-%y'` ; \
344 echo -n "Updating version number in $$S to $$V $$D... " ; \
346 sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/" \
347 -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9]\)/$$D/" \
349 if cmp -s $$S $$T ; then \
350 echo "unchanged." ; \
358 @for S in $(MEN); do \
359 U=$(UTILS_SRC)/version.h ; \
360 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
361 V="`date '+%d-%b-%y'` ($$V)" ; \
362 echo -n "Updating footer in $$S to \"$$V\"... " ; \
364 sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/" \
366 if cmp -s $$S $$T ; then \
367 echo "unchanged." ; \
377 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
380 @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
384 # Rules for noticing when the objects from the utils directory are out of
385 # date with respect to their sources, and going and building them according
386 # to the rules in their own Makefile...
388 $(UTILS_BIN)/fade.o: $(UTILS_SRC)/fade.c
389 $(UTILS_BIN)/overlay.o: $(UTILS_SRC)/overlay.c
390 $(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
391 $(UTILS_BIN)/usleep.o: $(UTILS_SRC)/usleep.c
392 $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c
393 $(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
394 $(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
395 $(UTILS_BIN)/spline.o: $(UTILS_SRC)/spline.c
396 $(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
400 $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
402 # How we build object files in this directory.
404 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
406 # subprocs is the only one that takes an extra -D option.
407 subprocs.o: subprocs.c
408 $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
411 # How we build the default app-defaults file into the program.
413 XScreenSaver_ad.h: XScreenSaver.ad
414 $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
416 # The executables linked in this directory.
418 xscreensaver: $(SAVER_OBJS)
419 $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
421 xscreensaver-command: $(CMD_OBJS)
422 $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
424 xscreensaver-demo: $(DEMO_OBJS)
425 $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
429 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
430 subprocs.o setuid.o splash.o prefs.o \
432 test-passwd.o: XScreenSaver_ad.h
434 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
435 $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
438 $(CC) $(LDFLAGS) -o $@ test-uid.o
440 test-xdpms: test-xdpms.o
441 $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
443 test-grab: test-grab.o
444 $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
447 # This kludge is so that I can build/test the Athena version of the
448 # xscreensaver-demo program without having to re-run configure.
449 # Normally it builds it with Motif if possible; this lets me build
452 xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
453 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
454 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
455 $(LIBS) $(X_LIBS) -lXaw \
456 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
457 xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
458 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
459 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
460 $(LIBS) $(X_LIBS) -lXaw3d \
461 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
462 demo-Xaw.o: demo.c XScreenSaver_ad.h
463 $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
464 $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
468 ##############################################################################
470 # DO NOT DELETE: updated by make distdepend
471 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
473 xscreensaver.o: ../config.h
474 xscreensaver.o: $(srcdir)/xscreensaver.h
475 xscreensaver.o: $(srcdir)/prefs.h
476 xscreensaver.o: $(UTILS_SRC)/version.h
477 xscreensaver.o: $(UTILS_SRC)/yarandom.h
478 xscreensaver.o: $(UTILS_SRC)/resources.h
479 xscreensaver.o: $(UTILS_SRC)/visual.h
480 xscreensaver.o: $(UTILS_SRC)/usleep.h
481 xscreensaver.o: XScreenSaver_ad.h
482 windows.o: ../config.h
483 windows.o: $(srcdir)/xscreensaver.h
484 windows.o: $(srcdir)/prefs.h
485 windows.o: $(UTILS_SRC)/visual.h
486 windows.o: $(UTILS_SRC)/fade.h
487 timers.o: ../config.h
488 timers.o: $(srcdir)/xscreensaver.h
489 timers.o: $(srcdir)/prefs.h
490 subprocs.o: ../config.h
491 subprocs.o: $(srcdir)/xscreensaver.h
492 subprocs.o: $(srcdir)/prefs.h
493 subprocs.o: $(UTILS_SRC)/yarandom.h
495 xset.o: $(srcdir)/xscreensaver.h
496 xset.o: $(srcdir)/prefs.h
497 splash.o: ../config.h
498 splash.o: $(srcdir)/xscreensaver.h
499 splash.o: $(srcdir)/prefs.h
500 splash.o: $(UTILS_SRC)/resources.h
501 setuid.o: ../config.h
502 setuid.o: $(srcdir)/xscreensaver.h
503 setuid.o: $(srcdir)/prefs.h
504 stderr.o: ../config.h
505 stderr.o: $(srcdir)/xscreensaver.h
506 stderr.o: $(srcdir)/prefs.h
507 stderr.o: $(UTILS_SRC)/resources.h
508 stderr.o: $(UTILS_SRC)/visual.h
509 dialogs-Xm.o: ../config.h
510 dialogs-Xm.o: $(UTILS_SRC)/visual.h
511 dialogs-Xaw.o: ../config.h
512 dialogs-Xaw.o: $(UTILS_SRC)/visual.h
513 passwd-pwent.o: ../config.h
515 lock.o: $(srcdir)/xscreensaver.h
516 lock.o: $(srcdir)/prefs.h
517 lock.o: $(UTILS_SRC)/resources.h
518 passwd.o: ../config.h
520 demo.o: $(UTILS_SRC)/version.h
521 demo.o: $(srcdir)/prefs.h
522 demo.o: $(UTILS_SRC)/resources.h
523 demo.o: $(UTILS_SRC)/visual.h
524 demo.o: $(srcdir)/remote.h
525 demo.o: $(UTILS_SRC)/usleep.h
526 demo.o: XScreenSaver_ad.h
528 prefs.o: $(srcdir)/prefs.h
529 prefs.o: $(UTILS_SRC)/resources.h
530 remote.o: ../config.h
531 remote.o: $(srcdir)/remote.h
532 xscreensaver-command.o: ../config.h
533 xscreensaver-command.o: $(srcdir)/remote.h
534 xscreensaver-command.o: $(UTILS_SRC)/version.h
535 test-passwd.o: ../config.h
536 test-passwd.o: $(srcdir)/xscreensaver.h
537 test-passwd.o: $(srcdir)/prefs.h
538 test-passwd.o: $(UTILS_SRC)/resources.h
539 test-passwd.o: $(UTILS_SRC)/version.h
540 test-passwd.o: $(UTILS_SRC)/visual.h
541 test-passwd.o: XScreenSaver_ad.h
542 test-uid.o: ../config.h
543 test-xdpms.o: ../config.h
544 test-grab.o: ../config.h