http://ftp.x.org/contrib/applications/xscreensaver-3.22.tar.gz
[xscreensaver] / driver / Makefile.in
index 9c789a9f637f9d025dba865d693ca6c121f1f116..11e3c322e3882c9449c29f2ccd86c327d05ea165 100644 (file)
@@ -1,4 +1,4 @@
-# driver/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
+# driver/Makefile.in --- xscreensaver, Copyright (c) 1997-1999 Jamie Zawinski.
 # the `../configure' script generates `driver/Makefile' from this file.
 
 @SET_MAKE@
@@ -55,85 +55,120 @@ X_EXTRA_LIBS       = @X_EXTRA_LIBS@
 
 
 AD_DIR         = @APPDEFAULTS@
+PAM_DIR                = /etc/pam.d
+PAM_CONF       = /etc/pam.conf
 
 UTILS_SRC      = $(srcdir)/../utils
 UTILS_BIN      = ../utils
 
 INCLUDES       = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
 
-PASSWD_LIBS    = @PASSWD_LIBS@
-MOTIF_SRCS     = dialogs-Xm.c
-MOTIF_OBJS     = dialogs-Xm.o
+MOTIF_SRCS     = demo-Xm.c demo-Xm-widgets.c
+MOTIF_OBJS     = demo-Xm.o demo-Xm-widgets.o
+
+GTK_SRCS       = demo-Gtk.c demo-Gtk-widgets.c
+GTK_OBJS       = demo-Gtk.o demo-Gtk-widgets.o
+
+PWENT_SRCS     = passwd-pwent.c
+PWENT_OBJS     = passwd-pwent.o
 
-ATHENA_SRCS    = dialogs-Xaw.c
-ATHENA_OBJS    = dialogs-Xaw.o
+KERBEROS_SRCS  = passwd-kerberos.c
+KERBEROS_OBJS  = passwd-kerberos.o
 
-PWENT_SRCS     = passwd.c
-PWENT_OBJS     = passwd.o
+PAM_SRCS       = passwd-pam.c
+PAM_OBJS       = passwd-pam.o
 
-KERBEROS_SRCS  = kpasswd.c
-KERBEROS_OBJS  = kpasswd.o
+LOCK_SRCS_1    = lock.c passwd.c
+LOCK_OBJS_1    = lock.o passwd.o
+NOLOCK_SRCS_1  = lock.c
+NOLOCK_OBJS_1  = lock.o
 
-LOCK_SRCS_1    = lock.c
-LOCK_OBJS_1    = lock.o
+TEST_SRCS      = test-passwd.c test-uid.c test-xdpms.c test-grab.c \
+                 test-apm.c xdpyinfo.c
 
-TEST_SRCS      = test-passwd.c test-uid.c
+MOTIF_LIBS     = @MOTIF_LIBS@ @XPM_LIBS@
+GTK_LIBS       = @GTK_LIBS@
 
-DIALOG_SRCS    = @DIALOG_SRCS@
-DIALOG_OBJS    = @DIALOG_OBJS@
 PASSWD_SRCS    = @PASSWD_SRCS@
 PASSWD_OBJS    = @PASSWD_OBJS@
+PASSWD_LIBS    = @PASSWD_LIBS@
+
 LOCK_SRCS      = @LOCK_SRCS@
 LOCK_OBJS      = @LOCK_OBJS@
 
-UTIL_SRCS      = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
-                 $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
-                 $(UTILS_SRC)/visual.c $(UTILS_SRC)/xroger.c \
-                 $(UTILS_SRC)/spline.c \
-                 $(UTILS_SRC)/yarandom.c @XMU_SRCS@
-UTIL_OBJS      = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
-                 $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
-                 $(UTILS_BIN)/visual.o $(UTILS_BIN)/xroger.o \
-                 $(UTILS_BIN)/spline.o \
-                 $(UTILS_BIN)/yarandom.o @XMU_OBJS@
-
-SAVER_SRCS_1   = demo.c stderr.c subprocs.c setuid.c timers.c windows.c \
-                 xscreensaver.c splash.c xset.c
-SAVER_OBJS_1   = demo.o stderr.o subprocs.o setuid.o timers.o windows.o \
-                 xscreensaver.o splash.o xset.o
-
-SAVER_SRCS     = $(SAVER_SRCS_1) $(DIALOG_SRCS) $(LOCK_SRCS) $(UTIL_SRCS)
-SAVER_OBJS     = $(SAVER_OBJS_1) $(DIALOG_OBJS) $(LOCK_OBJS) $(UTIL_OBJS)
-
-CMD_SRCS       = xscreensaver-command.c
-CMD_OBJS       = xscreensaver-command.o
-
-SAVER_LIBS     = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
+XMU_SRCS       = @XMU_SRCS@
+XMU_OBJS       = @XMU_OBJS@
+
+GL_SRCS                = @SAVER_GL_SRCS@
+GL_OBJS                = @SAVER_GL_OBJS@
+GL_LIBS                = @SAVER_GL_LIBS@
+
+DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
+                 $(UTILS_SRC)/visual.c
+DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
+                 $(UTILS_BIN)/visual.o
+
+SAVER_UTIL_SRCS        = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
+                 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/spline.c \
+                 $(UTILS_SRC)/yarandom.c \
+                 $(DEMO_UTIL_SRCS)
+SAVER_UTIL_OBJS        = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
+                 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/spline.o \
+                 $(UTILS_BIN)/yarandom.o \
+                 $(DEMO_UTIL_OBJS)
+
+SAVER_SRCS_1   = xscreensaver.c windows.c timers.c subprocs.c \
+                 xset.c splash.c setuid.c stderr.c
+SAVER_OBJS_1   = xscreensaver.o windows.o timers.o subprocs.o \
+                 xset.o splash.o setuid.o stderr.o
+
+SAVER_SRCS     = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
+                 $(SAVER_UTIL_SRCS) $(GL_SRCS) $(XMU_SRCS)
+SAVER_OBJS     = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
+                 $(SAVER_UTIL_OBJS) $(GL_OBJS) $(XMU_OBJS)
+
+CMD_SRCS       = remote.c xscreensaver-command.c
+CMD_OBJS       = remote.o xscreensaver-command.o
+
+DEMO_SRCS_1    = prefs.c $(XMU_SRCS)
+DEMO_OBJS_1    = prefs.o $(XMU_OBJS)
+
+DEMO_SRCS      = prefs.c remote.c $(DEMO_UTIL_SRCS)
+DEMO_OBJS      = prefs.o remote.o $(DEMO_UTIL_OBJS)
+
+SAVER_LIBS     = $(LIBS) $(X_LIBS) @SAVER_LIBS@ $(GL_LIBS) \
                  $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
                  $(PASSWD_LIBS)
 
-CMD_LIBS       = $(X_LIBS) $(X_PRE_LIBS)      \
-                 -lX11 -lXext $(X_EXTRA_LIBS) \
-                 $(LIBS)
+CMD_LIBS       = $(LIBS) $(X_LIBS) \
+                 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
 
-EXES           = xscreensaver xscreensaver-command
+EXES           = xscreensaver xscreensaver-command xscreensaver-demo
+EXES2          = @ALL_DEMO_PROGRAMS@
 
-HDRS           = XScreenSaver_ad.h xscreensaver.h
-MEN            = xscreensaver.man xscreensaver-command.man
-EXTRAS         = README Makefile.in XScreenSaver.ad.in dialogs.xd .gdbinit
+HDRS           = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h \
+                 demo-Gtk-widgets.h demo-Gtk-stubs.h
+MEN            = xscreensaver.man xscreensaver-demo.man \
+                 xscreensaver-command.man
+ALL_MEN                = xscreensaver.man \
+                 xscreensaver-demo.man xscreensaver-command.man
+EXTRAS         = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
+                 xscreensaver.kss xscreensaver-demo.glade .gdbinit
 VMSFILES       = compile_axp.com compile_decc.com link_axp.com link_decc.com \
                  vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
                  vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
 
 TARFILES       = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
-                 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
-                 $(LOCK_SRCS_1) $(CMD_SRCS) $(HDRS) $(TEST_SRCS) $(MEN)
+                 $(MOTIF_SRCS) $(GTK_SRCS) $(PWENT_SRCS) \
+                 $(KERBEROS_SRCS) $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) \
+                 $(CMD_SRCS) $(HDRS) $(TEST_SRCS) $(ALL_MEN)
 
 
-all: $(EXES)
+default: $(EXES)
+all: $(EXES) $(EXES2)
 
-install:   install-program   install-ad   install-man
-uninstall: uninstall-program uninstall-ad uninstall-man
+install:   install-program   install-ad   install-kde   install-man   @INSTALL_PAM@
+uninstall: uninstall-program uninstall-ad uninstall-kde uninstall-man
 
 install-strip:
        $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
@@ -141,15 +176,18 @@ install-strip:
                install
 
 install-program: $(EXES)
-       @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
+       @if [ ! -d $(install_prefix)$(bindir) ]; then                   \
+         $(INSTALL_DIRS) $(install_prefix)$(bindir) ;                  \
+        fi
        @inst="$(INSTALL_PROGRAM)" ;                                    \
        if [ @NEED_SETUID@ = yes ]; then                                \
-          me="`whoami`" ;                                              \
+          me=`PATH="$$PATH:/usr/ucb" whoami` ;                         \
           if [ "$$me" = root ]; then                                   \
             inst="$(INSTALL_SETUID)" ;                                 \
           else                                                         \
            e=echo ;                                                    \
  $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
  $$e "  Warning: xscreensaver has been compiled with support for shadow"     ;\
  $$e "           passwords.  If your system actually uses shadow passwords," ;\
  $$e "           then xscreensaver must be installed as a setuid root"      ;\
@@ -157,46 +195,163 @@ install-program: $(EXES)
  $$e "           must run 'make install' as 'root', not as '$$me'."         ;\
  $$e ""                                                                             ;\
  $$e "           For now, xscreensaver will be installed non-setuid, which"  ;\
- $$e "           means that locking might not work."                        ;\
+ $$e "           means that locking might not work.  (Try it and see.)"             ;\
+ $$e "  ####################################################################";\
  $$e ""                                                                             ;\
-          fi ;                                                         \
-       fi ;                                                            \
-       echo $$inst xscreensaver $(bindir)/xscreensaver ;               \
-       $$inst xscreensaver $(bindir)/xscreensaver
-       $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
+          fi ;                                                               \
+       fi ;                                                                  \
+       echo $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver ;    \
+       $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver
+       $(INSTALL_PROGRAM) xscreensaver-command \
+         $(install_prefix)$(bindir)/xscreensaver-command
+       $(INSTALL_PROGRAM) xscreensaver-demo \
+         $(install_prefix)$(bindir)/xscreensaver-demo
 
 install-ad: XScreenSaver.ad
-       @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
-       $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver
+       @if [ ! -d $(install_prefix)$(AD_DIR) ]; then                         \
+         $(INSTALL_DIRS) $(install_prefix)$(AD_DIR) ;                        \
+        fi
+       @-echo $(INSTALL_DATA) XScreenSaver.ad                                \
+         $(install_prefix)$(AD_DIR)/XScreenSaver ;                           \
+       if $(INSTALL_DATA) XScreenSaver.ad                                    \
+         $(install_prefix)$(AD_DIR)/XScreenSaver ; then                      \
+         true ;                                                              \
+       else                                                                  \
+         e=echo ;                                                            \
+         if [ -f $(install_prefix)$(AD_DIR)/XScreenSaver ]; then             \
+ $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
+ $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
+ $$e "           That file exists, and is unwritable.  It is probably from"  ;\
+ $$e "           an older version of xscreensaver, and could cause things"   ;\
+ $$e "           to malfunction.  Please delete it!"                        ;\
+ $$e "  ####################################################################";\
+ $$e ""                                                                             ;\
+           exit 1 ;                                                          \
+         else                                                                \
+ $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
+ $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
+ $$e "           The directory is unwritable.  This is probably ok;"        ;\
+ $$e "           xscreensaver should work without that file."               ;\
+ $$e "  ####################################################################";\
+ $$e ""                                                                             ;\
+           exit 0 ;                                                          \
+         fi                                                                  \
+       fi
 
 install-man: $(MEN)
        @men="$(MEN)" ;                                                 \
-       if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ;  \
+       if [ ! -d $(install_prefix)$(man1dir) ]; then                   \
+         $(INSTALL_DIRS) $(install_prefix)$(man1dir) ;                 \
+        fi ;                                                           \
        for man in $$men; do                                            \
          instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
-         echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;  \
-         $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ;       \
+         echo $(INSTALL_DATA) $(srcdir)/$$man                          \
+          $(install_prefix)$(man1dir)/$$instname ;                     \
+         $(INSTALL_DATA) $(srcdir)/$$man                               \
+           $(install_prefix)$(man1dir)/$$instname ;                    \
        done
 
 uninstall-program:
        @for program in $(EXES); do                                     \
-         echo rm -f $(bindir)/$$program ;                              \
-         rm -f $(bindir)/$$program ;                                   \
+         echo rm -f $(install_prefix)$(bindir)/$$program ;             \
+         rm -f $(install_prefix)$(bindir)/$$program ;                  \
        done
 
 uninstall-ad:
-       rm -f $(AD_DIR)/XScreenSaver
+       rm -f $(install_prefix)$(AD_DIR)/XScreenSaver
 
 uninstall-man:
        @men="$(MEN)" ;                                                 \
        for man in $$men; do                                            \
          instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
-         echo rm -f $(man1dir)/$$instname ;                            \
-         rm -f $(man1dir)/$$instname ;                                 \
+         echo rm -f $(install_prefix)$(man1dir)/$$instname ;           \
+         rm -f $(install_prefix)$(man1dir)/$$instname ;                \
        done
 
+install-pam:
+       @src="$(srcdir)/xscreensaver.pam" ;                             \
+       dest=`sed -n 's/.*PAM_SERVICE_NAME[     ]*"\([^"]*\)".*$$/\1/p' \
+          < ../config.h` ;                                             \
+       dir="$(install_prefix)$(PAM_DIR)" ;                             \
+       conf="$(PAM_CONF)" ;                                            \
+                                                                       \
+       if [ -d $$dir ] ; then                                          \
+         echo $(INSTALL_DATA) $$src $$dir/$$dest ;                     \
+         $(INSTALL_DATA) $$src $$dir/$$dest ;                          \
+         if [ ! -f $$dir/$$dest ]; then                                \
+           e=echo ;                                                    \
+ $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
+ $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
+ $$e "           Authentication Modules (PAM).  However, we were unable to"  ;\
+ $$e "           install the file $$dir/$$dest.  PAM is unlikely"           ;\
+ $$e "           to work without this file (and old-style password"         ;\
+ $$e "           authentication will be used instead, which may or may not"  ;\
+ $$e "           work.)"                                                    ;\
+ $$e "  ####################################################################";\
+ $$e ""                                                                             ;\
+         fi ;                                                          \
+       elif [ -f $$conf ]; then                                        \
+         if ( grep $$dest $$conf >/dev/null ); then                    \
+          true ;                                                       \
+         else                                                          \
+           e=echo ;                                                    \
+ $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
+ $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
+ $$e "           Authentication Modules (PAM).  To complete the installation";\
+ $$e "           of PAM support, you must add the following line to the file";\
+ $$e "           $$conf:"                                                   ;\
+ $$e ""                                                                             ;\
+ $$e   "       $$dest  auth required   /usr/lib/security/pam_unix.so.1"     ;\
+ $$e ""                                                                             ;\
+ $$e "           Be careful: if you mess up that file, you could completely" ;\
+ $$e "           hose your machine (e.g., \`login' and \`su' won't work, and";\
+ $$e "           you'll have to boot single-user to fix it.)"                ;\
+ $$e "  ####################################################################";\
+           echo "";                                                    \
+         fi ;                                                          \
+       fi
+
+install-kde:
+       @src="$(srcdir)/xscreensaver.kss" ;                                   \
+       if [ "$$KDEDIR" != "" ]; then                                         \
+         dir="$(install_prefix)$$KDEDIR/bin" ;                               \
+         dest="$$dir/xscreensaver.kss" ;                                     \
+         echo $(INSTALL_PROGRAM) $$src $$dest ;                              \
+         if $(INSTALL_PROGRAM) $$src $$dest ; then                           \
+           true ;                                                            \
+         else                                                                \
+           e=echo ;                                                          \
+ $$e ""                                                                             ;\
+ $$e "  ####################################################################";\
+ $$e "  Warning: unable to install $$dest"                                  ;\
+           if [ ! -d $(install_prefix)$$KDEDIR ]; then                       \
+ $$e "           $(install_prefix)$$KDEDIR (\$$KDEDIR) does not exist."             ;\
+           elif [ ! -d $(install_prefix)$$KDEDIR/bin ]; then                 \
+ $$e "           $(install_prefix)$$KDEDIR/bin (\$$KDEDIR/bin) does not exist.";\
+           elif [ -f $$dest ]; then                                          \
+ $$e "           That file exists, and is unwritable."                      ;\
+           else                                                              \
+ $$e "           The directory is unwritable."                              ;\
+           fi                                                               ;\
+ $$e "  ####################################################################";\
+ $$e ""                                                                             ;\
+           exit 1 ;                                                          \
+         fi ;                                                                \
+       fi
+
+uninstall-kde:
+       @if [ "$$KDEDIR" != "" ]; then                                  \
+         dest="$(install_prefix)$$KDEDIR/bin/xscreensaver.kss" ;       \
+         echo rm -f $$dest ;                                           \
+         rm -f $$dest ;                                                \
+       fi
+
 clean:
-       -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
+       -rm -f *.o a.out core $(EXES) $(EXES2) XScreenSaver_ad.h
 
 distclean: clean
        -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
@@ -217,8 +372,9 @@ distdepend: update_ad_version update_man_version XScreenSaver_ad.h
        $(DEPEND) -w 0 -f -                                                 \
        -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
        $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
-       $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS)          \
-       $(LOCK_SRCS_1) $(CMD_SRCS) |                                        \
+       $(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS)                           \
+       $(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS)             \
+       $(TEST_SRCS) |                                                      \
        (                                                                   \
          awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
          sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
@@ -293,7 +449,7 @@ $(UTILS_BIN)/xroger.o:              $(UTILS_SRC)/xroger.c
 $(UTILS_BIN)/spline.o:         $(UTILS_SRC)/spline.c
 $(UTILS_BIN)/yarandom.o:       $(UTILS_SRC)/yarandom.c
 
-$(UTIL_OBJS):
+$(SAVER_UTIL_OBJS):
        cd $(UTILS_BIN) ; \
        $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
 
@@ -303,7 +459,8 @@ $(UTIL_OBJS):
 
 # subprocs is the only one that takes an extra -D option.
 subprocs.o: subprocs.c
-       $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
+       $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) \
+         $(srcdir)/subprocs.c
 
 
 # How we build the default app-defaults file into the program.
@@ -320,56 +477,140 @@ xscreensaver-command: $(CMD_OBJS)
        $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
 
 
-TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PWENT_OBJS) $(DIALOG_OBJS) \
-        subprocs.o setuid.o demo.o \
-       $(UTIL_OBJS)
+xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
+       cp -p @PREFERRED_DEMO_PROGRAM@ $@
+
+xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(MOTIF_OBJS) $(LIBS) $(X_LIBS) \
+       $(MOTIF_LIBS) $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
 
-test-passwd: $(TEST_PASSWD_OBJS)
+xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
+       $(GTK_LIBS) $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
+
+
+
+TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
+        subprocs.o setuid.o splash.o prefs.o \
+       $(SAVER_UTIL_OBJS)
+test-passwd.o: XScreenSaver_ad.h
+
+tests:: test-passwd
+test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
        $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
 
+tests:: test-uid
+test-uid: test-uid.o
+       $(CC) $(LDFLAGS) -o $@ test-uid.o
+
+tests:: test-xdpms
+test-xdpms: test-xdpms.o
+       $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
+
+tests:: test-grab
+test-grab: test-grab.o
+       $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
+
+tests:: test-apm
+test-apm: test-apm.o
+       $(CC) $(LDFLAGS) -o $@ test-apm.o $(SAVER_LIBS) -lapm
+
+
+xdpyinfo.o: xdpyinfo.c
+       $(CC) -c $(INCLUDES) -DHAVE_GLX $(CFLAGS) $(X_CFLAGS) \
+         $(srcdir)/xdpyinfo.c
+
+xdpyinfo: xdpyinfo.o
+       $(CC) $(LDFLAGS) -o $@ xdpyinfo.o \
+               $(LIBS) $(X_LIBS) @GL_LIBS@ \
+               $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) -lm
+
+
 ##############################################################################
 #
 # DO NOT DELETE: updated by make distdepend
 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
 
-demo.o: ../config.h
-demo.o: $(srcdir)/xscreensaver.h
-demo.o: $(UTILS_SRC)/resources.h
-stderr.o: ../config.h
-stderr.o: $(srcdir)/xscreensaver.h
-stderr.o: $(UTILS_SRC)/resources.h
-stderr.o: $(UTILS_SRC)/visual.h
-subprocs.o: ../config.h
-subprocs.o: $(srcdir)/xscreensaver.h
-subprocs.o: $(UTILS_SRC)/yarandom.h
-setuid.o: ../config.h
-setuid.o: $(srcdir)/xscreensaver.h
-timers.o: ../config.h
-timers.o: $(srcdir)/xscreensaver.h
-windows.o: ../config.h
-windows.o: $(srcdir)/xscreensaver.h
-windows.o: $(UTILS_SRC)/visual.h
-windows.o: $(UTILS_SRC)/fade.h
 xscreensaver.o: ../config.h
 xscreensaver.o: $(srcdir)/xscreensaver.h
+xscreensaver.o: $(srcdir)/prefs.h
 xscreensaver.o: $(UTILS_SRC)/version.h
 xscreensaver.o: $(UTILS_SRC)/yarandom.h
 xscreensaver.o: $(UTILS_SRC)/resources.h
 xscreensaver.o: $(UTILS_SRC)/visual.h
+xscreensaver.o: $(UTILS_SRC)/usleep.h
 xscreensaver.o: XScreenSaver_ad.h
-splash.o: ../config.h
-splash.o: $(srcdir)/xscreensaver.h
-splash.o: $(UTILS_SRC)/visual.h
+windows.o: ../config.h
+windows.o: $(srcdir)/xscreensaver.h
+windows.o: $(srcdir)/prefs.h
+windows.o: $(UTILS_SRC)/visual.h
+windows.o: $(UTILS_SRC)/fade.h
+timers.o: ../config.h
+timers.o: $(srcdir)/xscreensaver.h
+timers.o: $(srcdir)/prefs.h
+subprocs.o: ../config.h
+subprocs.o: $(srcdir)/xscreensaver.h
+subprocs.o: $(srcdir)/prefs.h
+subprocs.o: $(UTILS_SRC)/yarandom.h
 xset.o: ../config.h
 xset.o: $(srcdir)/xscreensaver.h
-dialogs-Xm.o: ../config.h
-dialogs-Xm.o: $(UTILS_SRC)/visual.h
-dialogs-Xaw.o: ../config.h
-dialogs-Xaw.o: $(UTILS_SRC)/visual.h
-passwd.o: ../config.h
+xset.o: $(srcdir)/prefs.h
+splash.o: ../config.h
+splash.o: $(srcdir)/xscreensaver.h
+splash.o: $(srcdir)/prefs.h
+splash.o: $(UTILS_SRC)/resources.h
+setuid.o: ../config.h
+setuid.o: $(srcdir)/xscreensaver.h
+setuid.o: $(srcdir)/prefs.h
+stderr.o: ../config.h
+stderr.o: $(srcdir)/xscreensaver.h
+stderr.o: $(srcdir)/prefs.h
+stderr.o: $(UTILS_SRC)/resources.h
+stderr.o: $(UTILS_SRC)/visual.h
+demo-Xm.o: ../config.h
+demo-Xm.o: $(UTILS_SRC)/version.h
+demo-Xm.o: $(srcdir)/prefs.h
+demo-Xm.o: $(UTILS_SRC)/resources.h
+demo-Xm.o: $(UTILS_SRC)/visual.h
+demo-Xm.o: $(srcdir)/remote.h
+demo-Xm.o: $(UTILS_SRC)/usleep.h
+demo-Xm.o: XScreenSaver_ad.h
+demo-Xm-widgets.o: ../config.h
+demo-Gtk.o: ../config.h
+demo-Gtk.o: $(UTILS_SRC)/version.h
+demo-Gtk.o: $(srcdir)/prefs.h
+demo-Gtk.o: $(UTILS_SRC)/resources.h
+demo-Gtk.o: $(UTILS_SRC)/visual.h
+demo-Gtk.o: $(srcdir)/remote.h
+demo-Gtk.o: $(UTILS_SRC)/usleep.h
+demo-Gtk.o: $(srcdir)/demo-Gtk-widgets.h
+demo-Gtk.o: XScreenSaver_ad.h
+demo-Gtk-widgets.o: ../config.h
+demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-stubs.h
+demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-widgets.h
+passwd-pwent.o: ../config.h
 lock.o: ../config.h
 lock.o: $(srcdir)/xscreensaver.h
+lock.o: $(srcdir)/prefs.h
 lock.o: $(UTILS_SRC)/resources.h
+passwd.o: ../config.h
+prefs.o: ../config.h
+prefs.o: $(srcdir)/prefs.h
+prefs.o: $(UTILS_SRC)/resources.h
+remote.o: ../config.h
+remote.o: $(srcdir)/remote.h
 xscreensaver-command.o: ../config.h
+xscreensaver-command.o: $(srcdir)/remote.h
 xscreensaver-command.o: $(UTILS_SRC)/version.h
+test-passwd.o: ../config.h
+test-passwd.o: $(srcdir)/xscreensaver.h
+test-passwd.o: $(srcdir)/prefs.h
+test-passwd.o: $(UTILS_SRC)/resources.h
+test-passwd.o: $(UTILS_SRC)/version.h
+test-passwd.o: $(UTILS_SRC)/visual.h
+test-passwd.o: XScreenSaver_ad.h
+test-uid.o: ../config.h
+test-xdpms.o: ../config.h
+test-grab.o: ../config.h
+test-apm.o: ../config.h