http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.34.tar.gz
[xscreensaver] / driver / Makefile.in
1 # driver/Makefile.in --- xscreensaver, Copyright (c) 1997-1999 Jamie Zawinski.
2 # the `../configure' script generates `driver/Makefile' from this file.
3
4 @SET_MAKE@
5 .SUFFIXES:
6 .SUFFIXES: .c .o
7
8 srcdir          = @srcdir@
9 VPATH           = @srcdir@
10
11 install_prefix  =
12 prefix          = @prefix@
13 exec_prefix     = @exec_prefix@
14 bindir          = @bindir@
15 mandir          = @mandir@
16 man1dir         = $(mandir)/man1
17 mansuffix       = 1
18
19 GNOME_DATADIR   = @GNOME_DATADIR@
20 GNOME_CCDIR     = $(GNOME_DATADIR)/control-center/Desktop
21 GNOME_PANELDIR  = $(GNOME_DATADIR)/gnome/apps/Settings/Desktop
22 GNOME_ICONDIR   = $(GNOME_DATADIR)/pixmaps
23 GNOME_BINDIR    = $(bindir)
24
25 CC              = @CC@
26 CFLAGS          = @CFLAGS@
27 LDFLAGS         = @LDFLAGS@
28 DEFS            = @DEFS@
29 DEFS2           = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
30 LIBS            = @LIBS@
31 PERL            = @PERL@
32
33 DEPEND          = @DEPEND@
34 DEPEND_FLAGS    = @DEPEND_FLAGS@
35 DEPEND_DEFINES  = @DEPEND_DEFINES@
36
37 SHELL           = /bin/sh
38 INSTALL         = @INSTALL@
39 SUID_FLAGS      = -o root -m 4755
40 INSTALL_PROGRAM = @INSTALL_PROGRAM@
41 INSTALL_SCRIPT  = @INSTALL_SCRIPT@
42 INSTALL_SETUID  = @INSTALL_SETUID@
43 INSTALL_DATA    = @INSTALL_DATA@
44 INSTALL_DIRS    = @INSTALL_DIRS@
45
46 X_CFLAGS        = @X_CFLAGS@
47 X_LIBS          = @X_LIBS@
48 X_PRE_LIBS      = @X_PRE_LIBS@
49 X_EXTRA_LIBS    = @X_EXTRA_LIBS@
50 XMU_LIBS        = @XMU_LIBS@
51
52 # Note:
53 #
54 # X_LIBS would more properly be called X_LDFLAGS (it contains the -L args.)
55 # X_PRE_LIBS contains extra libraries you have to link against on some systems,
56 #         and that must come before -lX11.  (e.g., -lSM and -lICE.)
57 # X_EXTRA_LIBS contains extra libraries needed by X that aren't a part of X.
58 #         (e.g., -lsocket, -lnsl, etc.)
59 #
60 # I think (but am not totally sure) that LIBS is also really "LDFLAGS".
61 #
62 # SAVER_LIBS is the link line for "xscreensaver", and
63 # CMD_LIBS is the link line for "xscreensaver-command".
64 # GETIMG_LIBS is the link line for "xscreensaver-getimage".
65
66
67 AD_DIR          = @APPDEFAULTS@
68 PAM_DIR         = /etc/pam.d
69 PAM_CONF        = /etc/pam.conf
70
71 UTILS_SRC       = $(srcdir)/../utils
72 UTILS_BIN       = ../utils
73
74 INCLUDES        = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
75
76 MOTIF_SRCS      = demo-Xm.c demo-Xm-widgets.c
77 MOTIF_OBJS      = demo-Xm.o demo-Xm-widgets.o
78
79 GTK_SRCS        = demo-Gtk.c demo-Gtk-widgets.c
80 GTK_OBJS        = demo-Gtk.o demo-Gtk-widgets.o
81
82 PWENT_SRCS      = passwd-pwent.c
83 PWENT_OBJS      = passwd-pwent.o
84
85 KERBEROS_SRCS   = passwd-kerberos.c
86 KERBEROS_OBJS   = passwd-kerberos.o
87
88 PAM_SRCS        = passwd-pam.c
89 PAM_OBJS        = passwd-pam.o
90
91 LOCK_SRCS_1     = lock.c passwd.c
92 LOCK_OBJS_1     = lock.o passwd.o
93 NOLOCK_SRCS_1   = lock.c
94 NOLOCK_OBJS_1   = lock.o
95
96 TEST_SRCS       = test-passwd.c test-uid.c test-xdpms.c test-grab.c \
97                   test-apm.c test-fade.c xdpyinfo.c
98 TEST_EXES       = test-passwd   test-uid   test-xdpms   test-grab \
99                   test-apm   test-fade   xdpyinfo
100
101 MOTIF_LIBS      = @MOTIF_LIBS@ @XPM_LIBS@ $(XMU_LIBS)
102 GTK_LIBS        = @GTK_LIBS@ $(XMU_LIBS)
103
104 XDPMS_LIBS      = @XDPMS_LIBS@
105
106 PASSWD_SRCS     = @PASSWD_SRCS@
107 PASSWD_OBJS     = @PASSWD_OBJS@
108 PASSWD_LIBS     = @PASSWD_LIBS@
109
110 LOCK_SRCS       = @LOCK_SRCS@
111 LOCK_OBJS       = @LOCK_OBJS@
112
113 XMU_SRCS        = @XMU_SRCS@
114 XMU_OBJS        = @XMU_OBJS@
115
116 GL_SRCS         = @SAVER_GL_SRCS@
117 GL_OBJS         = @SAVER_GL_OBJS@
118 GL_LIBS         = @SAVER_GL_LIBS@
119
120 LOGO            = $(UTILS_SRC)/logo-50.xpm
121 DEMO_UTIL_SRCS  = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
122                   $(UTILS_SRC)/visual.c
123 DEMO_UTIL_OBJS  = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
124                   $(UTILS_BIN)/visual.o
125
126 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
127                   $(UTILS_SRC)/logo.c $(UTILS_SRC)/yarandom.c \
128                   $(DEMO_UTIL_SRCS)
129 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
130                   $(UTILS_BIN)/logo.o $(UTILS_BIN)/yarandom.o \
131                   $(DEMO_UTIL_OBJS)
132
133 GETIMG_SRCS_1   = xscreensaver-getimage.c
134 GETIMG_OBJS_1   = xscreensaver-getimage.o
135
136 GETIMG_SRCS     = $(GETIMG_SRCS_1) \
137                   $(UTILS_SRC)/colorbars.o $(UTILS_SRC)/resources.o \
138                   $(UTILS_SRC)/yarandom.o $(UTILS_SRC)/visual.o \
139                   $(UTILS_SRC)/usleep.o $(UTILS_SRC)/hsv.o \
140                   $(UTILS_SRC)/colors.o $(UTILS_SRC)/grabscreen.o \
141                   $(UTILS_SRC)/logo.o prefs.o $(XMU_SRCS)
142
143 GETIMG_OBJS     = $(GETIMG_OBJS_1) \
144                   $(UTILS_BIN)/colorbars.o $(UTILS_BIN)/resources.o \
145                   $(UTILS_BIN)/yarandom.o $(UTILS_BIN)/visual.o \
146                   $(UTILS_BIN)/usleep.o $(UTILS_BIN)/hsv.o \
147                   $(UTILS_BIN)/colors.o $(UTILS_BIN)/grabscreen.o \
148                   $(UTILS_BIN)/logo.o prefs.o $(XMU_OBJS)
149
150 SAVER_SRCS_1    = xscreensaver.c windows.c timers.c subprocs.c \
151                   xset.c splash.c setuid.c stderr.c
152 SAVER_OBJS_1    = xscreensaver.o windows.o timers.o subprocs.o \
153                   xset.o splash.o setuid.o stderr.o
154
155 SAVER_SRCS      = $(SAVER_SRCS_1) prefs.c dpms.c $(LOCK_SRCS) \
156                   $(SAVER_UTIL_SRCS) $(GL_SRCS) $(XMU_SRCS)
157 SAVER_OBJS      = $(SAVER_OBJS_1) prefs.o dpms.o $(LOCK_OBJS) \
158                   $(SAVER_UTIL_OBJS) $(GL_OBJS) $(XMU_OBJS)
159
160 CMD_SRCS        = remote.c xscreensaver-command.c
161 CMD_OBJS        = remote.o xscreensaver-command.o
162
163 DEMO_SRCS_1     = prefs.c dpms.c $(XMU_SRCS)
164 DEMO_OBJS_1     = prefs.o dpms.o $(XMU_OBJS)
165
166 DEMO_SRCS       = prefs.c dpms.c remote.c $(DEMO_UTIL_SRCS)
167 DEMO_OBJS       = prefs.o dpms.o remote.o $(DEMO_UTIL_OBJS)
168
169 SAVER_LIBS      = $(LIBS) $(X_LIBS) $(XMU_LIBS) @SAVER_LIBS@ \
170                   $(XDPMS_LIBS) $(GL_LIBS) $(X_PRE_LIBS) \
171                   -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
172                   $(PASSWD_LIBS)
173
174 CMD_LIBS        = $(LIBS) $(X_LIBS) \
175                   $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
176
177 GETIMG_LIBS     = $(LIBS) $(X_LIBS) \
178                   $(X_PRE_LIBS) -lXt -lX11 $(XMU_LIBS) -lXext $(X_EXTRA_LIBS)
179
180 EXES            = xscreensaver xscreensaver-command xscreensaver-demo \
181                   xscreensaver-getimage
182 EXES2           = @ALL_DEMO_PROGRAMS@
183 SCRIPTS         = xscreensaver-getimage-file xscreensaver-getimage-video
184
185 HDRS            = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h \
186                   demo-Gtk-widgets.h demo-Gtk-stubs.h
187 MEN             = xscreensaver.man xscreensaver-demo.man \
188                   xscreensaver-command.man \
189                   xscreensaver-getimage.man \
190                   xscreensaver-getimage-file.man \
191                   xscreensaver-getimage-video.man
192 EXTRAS          = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
193                   xscreensaver.kss xscreensaver-demo.glade \
194                   screensaver-properties.desktop.in \
195                   screensaver-properties-capplet \
196                   .gdbinit
197 VMSFILES        = compile_axp.com compile_decc.com link_axp.com link_decc.com \
198                   vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
199                   vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
200
201 TARFILES        = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
202                   $(MOTIF_SRCS) $(GTK_SRCS) $(PWENT_SRCS) \
203                   $(KERBEROS_SRCS) $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) \
204                   $(CMD_SRCS) $(GETIMG_SRCS_1) $(HDRS) $(SCRIPTS) \
205                   $(TEST_SRCS) $(MEN)
206
207
208 default: $(EXES)
209 all: $(EXES) $(EXES2)
210 tests: $(TEST_EXES)
211
212 install:   install-program   install-ad    install-scripts \
213            install-gnome     install-kde   install-man   @INSTALL_PAM@
214 uninstall: uninstall-program uninstall-ad  \
215            uninstall-gnome   uninstall-kde uninstall-man
216
217 install-strip:
218         $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
219                 install
220
221 install-program: $(EXES)
222         @if [ ! -d $(install_prefix)$(bindir) ]; then                   \
223           $(INSTALL_DIRS) $(install_prefix)$(bindir) ;                  \
224          fi
225         @inst="$(INSTALL_PROGRAM)" ;                                    \
226         if [ @NEED_SETUID@ = yes ]; then                                \
227            me=`PATH="$$PATH:/usr/ucb" whoami` ;                         \
228            if [ "$$me" = root ]; then                                   \
229              inst="$(INSTALL_SETUID)" ;                                 \
230            else                                                         \
231             e=echo ;                                                    \
232  $$e ""                                                                      ;\
233  $$e "  ####################################################################";\
234  $$e "  Warning: xscreensaver has been compiled with support for shadow"     ;\
235  $$e "           passwords.  If your system actually uses shadow passwords," ;\
236  $$e "           then xscreensaver must be installed as a setuid root"       ;\
237  $$e "           program in order for locking to work.  To do this, you"     ;\
238  $$e "           must run 'make install' as 'root', not as '$$me'."          ;\
239  $$e ""                                                                      ;\
240  $$e "           For now, xscreensaver will be installed non-setuid, which"  ;\
241  $$e "           means that locking might not work.  (Try it and see.)"      ;\
242  $$e "  ####################################################################";\
243  $$e ""                                                                      ;\
244            fi ;                                                               \
245         fi ;                                                                  \
246         echo $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver ;    \
247         $$inst xscreensaver $(install_prefix)$(bindir)/xscreensaver
248         @echo $(INSTALL_PROGRAM) xscreensaver-command \
249           $(install_prefix)$(bindir)/xscreensaver-command ; \
250         $(INSTALL_PROGRAM) xscreensaver-command \
251           $(install_prefix)$(bindir)/xscreensaver-command
252         @echo $(INSTALL_PROGRAM) xscreensaver-demo \
253           $(install_prefix)$(bindir)/xscreensaver-demo ; \
254         $(INSTALL_PROGRAM) xscreensaver-demo \
255           $(install_prefix)$(bindir)/xscreensaver-demo
256         @echo $(INSTALL_PROGRAM) xscreensaver-getimage \
257           $(install_prefix)$(bindir)/xscreensaver-getimage ; \
258         $(INSTALL_PROGRAM) xscreensaver-getimage \
259           $(install_prefix)$(bindir)/xscreensaver-getimage
260
261 install-ad: XScreenSaver.ad
262         @if [ ! -d $(install_prefix)$(AD_DIR) ]; then                         \
263           $(INSTALL_DIRS) $(install_prefix)$(AD_DIR) ;                        \
264          fi
265         @-echo $(INSTALL_DATA) XScreenSaver.ad                                \
266           $(install_prefix)$(AD_DIR)/XScreenSaver ;                           \
267         if $(INSTALL_DATA) XScreenSaver.ad                                    \
268           $(install_prefix)$(AD_DIR)/XScreenSaver ; then                      \
269           true ;                                                              \
270         else                                                                  \
271           e=echo ;                                                            \
272           if [ -f $(install_prefix)$(AD_DIR)/XScreenSaver ]; then             \
273  $$e ""                                                                      ;\
274  $$e "  ####################################################################";\
275  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
276  $$e "           That file exists, and is unwritable.  It is probably from"  ;\
277  $$e "           an older version of xscreensaver, and could cause things"   ;\
278  $$e "           to malfunction.  Please delete it!"                         ;\
279  $$e "  ####################################################################";\
280  $$e ""                                                                      ;\
281             exit 1 ;                                                          \
282           else                                                                \
283  $$e ""                                                                      ;\
284  $$e "  ####################################################################";\
285  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
286  $$e "           The directory is unwritable.  This is probably ok;"         ;\
287  $$e "           xscreensaver should work without that file."                ;\
288  $$e "  ####################################################################";\
289  $$e ""                                                                      ;\
290             exit 0 ;                                                          \
291           fi                                                                  \
292         fi
293
294 install-scripts: $(SCRIPTS) munge-scripts
295         @for program in $(SCRIPTS); do                                  \
296           if [ -r $$program ] ; then                                    \
297             p=$$program ;                                               \
298           else                                                          \
299             p=$(srcdir)/$$program ;                                     \
300           fi ;                                                          \
301           echo $(INSTALL_SCRIPT) $$p                                    \
302             $(install_prefix)$(bindir)/$$program ;                      \
303           $(INSTALL_SCRIPT) $$p                                         \
304             $(install_prefix)$(bindir)/$$program ;                      \
305         done
306
307 munge-scripts: $(SCRIPTS)
308         @tmp=/tmp/mf.$$$$ ;                                             \
309         perl="${PERL}" ;                                                \
310         for program in $(SCRIPTS); do                                   \
311           echo "adjusting location of perl in $$program..." ;           \
312           sed "s@^\(#!\)\(/[^ ]*/perl[^ ]*\)\(.*\)\$$@\1$$perl\3@"      \
313               < $(srcdir)/$$program > $$tmp ;                           \
314           if cmp -s $(srcdir)/$$program $$tmp ; then                    \
315             true ;                                                      \
316           else                                                          \
317             cat $$tmp > ./$$program ;                                   \
318           fi ;                                                          \
319         done
320
321 install-man: $(MEN)
322         @men="$(MEN)" ;                                                 \
323         if [ ! -d $(install_prefix)$(man1dir) ]; then                   \
324           $(INSTALL_DIRS) $(install_prefix)$(man1dir) ;                 \
325          fi ;                                                           \
326         for man in $$men; do                                            \
327           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
328           echo $(INSTALL_DATA) $(srcdir)/$$man                          \
329            $(install_prefix)$(man1dir)/$$instname ;                     \
330           $(INSTALL_DATA) $(srcdir)/$$man                               \
331             $(install_prefix)$(man1dir)/$$instname ;                    \
332         done
333
334 uninstall-program:
335         @for program in $(EXES) $(SCRIPTS); do                          \
336           echo rm -f $(install_prefix)$(bindir)/$$program ;             \
337           rm -f $(install_prefix)$(bindir)/$$program ;                  \
338         done
339
340 uninstall-ad:
341         rm -f $(install_prefix)$(AD_DIR)/XScreenSaver
342
343 uninstall-man:
344         @men="$(MEN)" ;                                                 \
345         for man in $$men; do                                            \
346           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
347           echo rm -f $(install_prefix)$(man1dir)/$$instname ;           \
348           rm -f $(install_prefix)$(man1dir)/$$instname ;                \
349         done
350
351 install-pam:
352         @src="$(srcdir)/xscreensaver.pam" ;                             \
353         dest=`sed -n 's/.*PAM_SERVICE_NAME[     ]*"\([^"]*\)".*$$/\1/p' \
354            < ../config.h` ;                                             \
355         dir="$(install_prefix)$(PAM_DIR)" ;                             \
356         conf="$(PAM_CONF)" ;                                            \
357                                                                         \
358         if [ -d $$dir ] ; then                                          \
359                                                                         \
360           if [ -f $$dir/xdm ]; then                                     \
361             src2=$$dir/xdm ;                                            \
362           elif [ -f $$dir/login ]; then                                 \
363             src2=$$dir/login ;                                          \
364           fi ;                                                          \
365                                                                         \
366           if [ -z "$$src2" ]; then                                      \
367             echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
368             $(INSTALL_DATA) $$src $$dir/$$dest ;                        \
369           else                                                          \
370             src="xscreensaver.pam.$$$$" ;                               \
371             echo "grep '^#%\|^auth' $$src2 > $$src" ;                   \
372                   grep '^#%\|^auth' $$src2 > $$src ;                    \
373             echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
374                  $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
375             echo rm -f $$src ;                                          \
376                  rm -f $$src ;                                          \
377           fi ;                                                          \
378                                                                         \
379           if [ ! -f $$dir/$$dest ]; then                                \
380             e=echo ;                                                    \
381  $$e ""                                                                      ;\
382  $$e "  ####################################################################";\
383  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
384  $$e "           Authentication Modules (PAM).  However, we were unable to"  ;\
385  $$e "           install the file $$dir/$$dest.  PAM is unlikely"            ;\
386  $$e "           to work without this file (and old-style password"          ;\
387  $$e "           authentication will be used instead, which may or may not"  ;\
388  $$e "           work.)"                                                     ;\
389  $$e "  ####################################################################";\
390  $$e ""                                                                      ;\
391           fi ;                                                          \
392         elif [ -f $$conf ]; then                                        \
393           if ( grep $$dest $$conf >/dev/null ); then                    \
394            true ;                                                       \
395           else                                                          \
396             e=echo ;                                                    \
397  $$e ""                                                                      ;\
398  $$e "  ####################################################################";\
399  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
400  $$e "           Authentication Modules (PAM).  To complete the installation";\
401  $$e "           of PAM support, you must add the following line to the file";\
402  $$e "           $$conf:"                                                    ;\
403  $$e ""                                                                      ;\
404  $$e    "       $$dest  auth required   /usr/lib/security/pam_unix.so.1"     ;\
405  $$e ""                                                                      ;\
406  $$e "           Be careful: if you mess up that file, you could completely" ;\
407  $$e "           hose your machine (e.g., \`login' and \`su' won't work, and";\
408  $$e "           you'll have to boot single-user to fix it.)"                ;\
409  $$e "  ####################################################################";\
410             echo "";                                                    \
411           fi ;                                                          \
412         fi
413
414 install-gnome:: screensaver-properties.desktop
415         @lost1=""                                                            ;\
416          lost2=""                                                            ;\
417          if [ "$(GNOME_DATADIR)" != "" ]; then                                \
418                                                                               \
419            if [ ! -d "$(install_prefix)$(GNOME_CCDIR)" ]; then                \
420              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)"          ;\
421                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)"          ;\
422            fi                                                                ;\
423                                                                               \
424            echo    $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
425              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
426                                                                               \
427            if      $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
428              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
429              then true                                                       ;\
430            else                                                               \
431              lost1="$(install_prefix)$(GNOME_CCDIR)"                         ;\
432            fi                                                                ;\
433                                                                               \
434            if [ ! -d "$(install_prefix)$(GNOME_PANELDIR)" ]; then             \
435              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)"       ;\
436                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)"       ;\
437            fi                                                                ;\
438                                                                               \
439            echo $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
440                         $(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
441            if   $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
442        $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
443              then true                                                       ;\
444            else                                                               \
445              lost2="$(install_prefix)$(GNOME_PANELDIR)"                      ;\
446            fi                                                                ;\
447                                                                               \
448            if [ "$$lost1" != "" -o "$$lost2" != "" ]; then                    \
449              e=echo ;                                                         \
450  $$e ""                                                                      ;\
451  $$e "  ####################################################################";\
452  $$e "  Warning: unable to install screensaver-properties.desktop into"      ;\
453                  plurality="this file"                                       ;\
454           if [ "$$lost1" != "" -a "$$lost2" != "" ]; then                     \
455  $$e "           $$lost1/ or into"                                           ;\
456  $$e "           $$lost2/."                                                  ;\
457                  plurality="these files"                                     ;\
458           elif [ "$$lost1" != "" ]; then                                      \
459  $$e "           $$lost1/."                                                  ;\
460           else                                                                \
461  $$e "           $$lost2/."                                                  ;\
462           fi                                                                 ;\
463  $$e "           Without $$plurality," 'the "Screen Saver" section of the'   ;\
464  $$e "           Gnome Control Center (gnomecc) will not work properly."     ;\
465  $$e "  ####################################################################";\
466  $$e ""                                                                      ;\
467              exit 1 ;                                                         \
468            fi                                                                ;\
469          fi
470
471 install-gnome:: screensaver-properties-capplet
472         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
473            if [ ! -d "$(install_prefix)$(GNOME_BINDIR)" ]; then               \
474              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_BINDIR)"         ;\
475                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_BINDIR)"         ;\
476            fi                                                                ;\
477            program=screensaver-properties-capplet                            ;\
478            echo $(INSTALL_SCRIPT) $$program                                   \
479                   $(install_prefix)$(GNOME_BINDIR)/$$program                 ;\
480            if   $(INSTALL_SCRIPT) $$program                                   \
481                   $(install_prefix)$(GNOME_BINDIR)/$$program                 ;\
482              then true                                                       ;\
483            else                                                               \
484              e=echo ;                                                         \
485  $$e ""                                                                      ;\
486  $$e "  ####################################################################";\
487  $$e "  Warning: unable to install $$program into"                           ;\
488  $$e "           $(install_prefix)$(GNOME_BINDIR)/."                         ;\
489  $$e "           Without this file, the Gnome session manager will not"      ;\
490  $$e "           launch xscreensaver properly at login time."                ;\
491  $$e "  ####################################################################";\
492  $$e ""                                                                      ;\
493              exit 1 ;                                                         \
494            fi ;                                                               \
495          fi
496
497 install-gnome:: $(LOGO)
498         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
499            if [ ! -d "$(install_prefix)$(GNOME_ICONDIR)" ]; then              \
500              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_ICONDIR)"        ;\
501                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_ICONDIR)"        ;\
502            fi                                                                ;\
503            target=xscreensaver.xpm                                           ;\
504            echo $(INSTALL_DATA) $(LOGO)                                       \
505                   $(install_prefix)$(GNOME_ICONDIR)/$$target                 ;\
506                 $(INSTALL_DATA) $(LOGO)                                       \
507                   $(install_prefix)$(GNOME_ICONDIR)/$$target                 ;\
508         fi
509
510 uninstall-gnome::
511         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
512           f=screensaver-properties.desktop                                   ;\
513           echo rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
514                rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
515           echo rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
516                rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
517         fi
518
519 uninstall-gnome::
520         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
521           program=screensaver-properties-capplet                             ;\
522           echo rm -f $(install_prefix)$(bindir)/$$program                    ;\
523                rm -f $(install_prefix)$(bindir)/$$program                    ;\
524          fi
525
526 uninstall-gnome::
527         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
528           target=xscreensaver.xpm                                            ;\
529           echo rm -f $(install_prefix)$(GNOME_ICONDIR)/$$target              ;\
530                rm -f $(install_prefix)$(GNOME_ICONDIR)/$$target              ;\
531          fi
532
533 install-kde:
534         @src="$(srcdir)/xscreensaver.kss" ;                                   \
535         if [ "$$KDEDIR" != "" ]; then                                         \
536           dir="$(install_prefix)$$KDEDIR/bin" ;                               \
537           dest="$$dir/xscreensaver.kss" ;                                     \
538           echo $(INSTALL_SCRIPT) $$src $$dest ;                               \
539           if $(INSTALL_SCRIPT) $$src $$dest ; then                            \
540             true ;                                                            \
541           else                                                                \
542             e=echo ;                                                          \
543  $$e ""                                                                      ;\
544  $$e "  ####################################################################";\
545  $$e "  Warning: unable to install $$dest"                                   ;\
546             if [ ! -d $(install_prefix)$$KDEDIR ]; then                       \
547  $$e "           $(install_prefix)$$KDEDIR (\$$KDEDIR) does not exist."      ;\
548             elif [ ! -d $(install_prefix)$$KDEDIR/bin ]; then                 \
549  $$e "           $(install_prefix)$$KDEDIR/bin (\$$KDEDIR/bin) does not exist.";\
550             elif [ -f $$dest ]; then                                          \
551  $$e "           That file exists, and is unwritable."                       ;\
552             else                                                              \
553  $$e "           The directory is unwritable."                               ;\
554             fi                                                               ;\
555  $$e "  ####################################################################";\
556  $$e ""                                                                      ;\
557             exit 1 ;                                                          \
558           fi ;                                                                \
559         fi
560
561 uninstall-kde:
562         @if [ "$$KDEDIR" != "" ]; then                                  \
563           dest="$(install_prefix)$$KDEDIR/bin/xscreensaver.kss" ;       \
564           echo rm -f $$dest ;                                           \
565           rm -f $$dest ;                                                \
566         fi
567
568 clean:
569         -rm -f *.o a.out core $(EXES) $(EXES2) $(TEST_EXES) XScreenSaver_ad.h
570
571 distclean: clean
572         -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
573
574 # Adds all current dependencies to Makefile
575 depend: XScreenSaver_ad.h
576         $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
577         $(DEPEND_FLAGS) --                                                  \
578         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
579         $(SAVER_SRCS) $(CMD_SRCS) $(GETIMG_SRCS_1)
580
581 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
582 # close.  This excludes dependencies on files in /usr/include, etc.  It tries
583 # to include only dependencies on files which are themselves a part of this
584 # package.
585 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
586         @echo updating dependencies in `pwd`/Makefile.in... ;               \
587         $(DEPEND) -w 0 -f -                                                 \
588         -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
589         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
590         $(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS) $(GETIMG_SRCS_1)          \
591         $(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS)             \
592         $(TEST_SRCS) |                                                      \
593         (                                                                   \
594           awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
595           sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
596               -e 's@\.\./utils@$$(UTILS_SRC)@g'                             \
597               -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
598               -e 's@$$.*\(XScreenSaver_ad\)@\1@g'                           \
599               -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ;                    \
600           echo ''                                                           \
601         ) > /tmp/distdepend.$$$$ &&                                         \
602         mv Makefile.in Makefile.in.bak &&                                   \
603         mv /tmp/distdepend.$$$$ Makefile.in
604
605 # Updates the version number in the app-defaults file to be in sync with 
606 # the version number in version.h.  This is so people can tell when they
607 # have a version skew between the app-defaults file and the executable.
608 update_ad_version::
609         @S=XScreenSaver.ad.in ;                                             \
610         U=$(UTILS_SRC)/version.h ;                                          \
611         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
612         D=`date '+%d-%b-%Y'` ;                                              \
613         echo -n "Updating version number in $$S to $$V $$D... " ;           \
614         T=/tmp/xs.$$$$ ;                                                    \
615         sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/"         \
616             -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9]*\)/$$D/"     \
617           < $$S > $$T ;                                                     \
618         if cmp -s $$S $$T ; then                                            \
619           echo "unchanged." ;                                               \
620         else                                                                \
621           cat $$T > $$S ;                                                   \
622           echo "done." ;                                                    \
623         fi ;                                                                \
624         rm $$T
625
626 update_man_version::
627         @for S in $(MEN); do                                                \
628         U=$(UTILS_SRC)/version.h ;                                          \
629         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
630         V="`date '+%d-%b-%Y'` ($$V)" ;                                      \
631         echo -n "Updating footer in $$S to \"$$V\"... " ;                   \
632         T=/tmp/xs.$$$$ ;                                                    \
633         sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/"                \
634           < $$S > $$T ;                                                     \
635         if cmp -s $$S $$T ; then                                            \
636           echo "unchanged." ;                                               \
637         else                                                                \
638           cat $$T > $$S ;                                                   \
639           echo "done." ;                                                    \
640         fi ;                                                                \
641         rm $$T ;                                                            \
642         done
643
644 TAGS: tags
645 tags:
646         find $(srcdir) -name '*.[chly]' -print | xargs etags -a
647
648 echo_tarfiles:
649         @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
650         @echo $(TARFILES)
651
652
653 # Rules for noticing when the objects from the utils directory are out of
654 # date with respect to their sources, and going and building them according
655 # to the rules in their own Makefile...
656 #
657 $(UTILS_BIN)/fade.o:            $(UTILS_SRC)/fade.c
658 $(UTILS_BIN)/overlay.o:         $(UTILS_SRC)/overlay.c
659 $(UTILS_BIN)/resources.o:       $(UTILS_SRC)/resources.c
660 $(UTILS_BIN)/usleep.o:          $(UTILS_SRC)/usleep.c
661 $(UTILS_BIN)/visual.o:          $(UTILS_SRC)/visual.c
662 $(UTILS_BIN)/xmu.o:             $(UTILS_SRC)/xmu.c
663 $(UTILS_BIN)/logo.o:            $(UTILS_SRC)/logo.c
664 $(UTILS_BIN)/yarandom.o:        $(UTILS_SRC)/yarandom.c
665 $(UTILS_BIN)/colorbars.o:       $(UTILS_SRC)/colorbars.c
666
667 $(SAVER_UTIL_OBJS):
668         cd $(UTILS_BIN) ; \
669         $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
670
671 # How we build object files in this directory.
672 .c.o:
673         $(CC) -c $(INCLUDES) $(DEFS)  $(CFLAGS) $(X_CFLAGS) $<
674
675 # subprocs is the only one that takes an extra -D option.
676 subprocs.o: subprocs.c
677         $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) \
678           $(srcdir)/subprocs.c
679
680
681 # How we build the default app-defaults file into the program.
682 #
683 XScreenSaver_ad.h: XScreenSaver.ad
684         $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
685
686 screensaver-properties.desktop: screensaver-properties.desktop.in Makefile
687         @echo generating $@... ;                                        \
688         sed "s%[@]bindir[@]%${bindir}%g"                                \
689           < ${srcdir}/screensaver-properties.desktop.in                 \
690           > $@
691
692 # The executables linked in this directory.
693 #
694 xscreensaver: $(SAVER_OBJS)
695         $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
696
697 xscreensaver-command: $(CMD_OBJS)
698         $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
699
700
701 xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
702         cp -p @PREFERRED_DEMO_PROGRAM@ $@
703
704 xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
705         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(MOTIF_OBJS) $(LIBS) $(X_LIBS) \
706         $(MOTIF_LIBS) $(X_PRE_LIBS) -lXt -lX11 $(XDPMS_LIBS) -lXext \
707         $(X_EXTRA_LIBS)
708
709 xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
710         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
711         $(GTK_LIBS) $(X_PRE_LIBS) -lXt -lX11 $(XDPMS_LIBS) -lXext \
712         $(X_EXTRA_LIBS)
713
714 xscreensaver-getimage: $(GETIMG_OBJS)
715         $(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(GETIMG_LIBS) -lm
716
717
718 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
719          subprocs.o setuid.o splash.o prefs.o \
720         $(SAVER_UTIL_OBJS)
721 test-passwd.o: XScreenSaver_ad.h
722
723 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
724         $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
725
726 test-uid: test-uid.o
727         $(CC) $(LDFLAGS) -o $@ test-uid.o
728
729 test-xdpms: test-xdpms.o
730         $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(LIBS) $(X_LIBS) $(XDPMS_LIBS) \
731         $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
732
733 test-grab: test-grab.o
734         $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
735
736 test-apm: test-apm.o
737         $(CC) $(LDFLAGS) -o $@ test-apm.o $(SAVER_LIBS) -lapm
738
739 TEST_FADE_OBJS = test-fade.o $(UTILS_SRC)/fade.o $(DEMO_UTIL_OBJS)
740 test-fade: test-fade.o 
741         $(CC) $(LDFLAGS) -o $@ $(TEST_FADE_OBJS) $(SAVER_LIBS)
742
743
744 xdpyinfo.o: xdpyinfo.c
745         $(CC) -c $(INCLUDES) -DHAVE_GLX $(CFLAGS) $(X_CFLAGS) \
746           $(srcdir)/xdpyinfo.c
747
748 xdpyinfo: xdpyinfo.o
749         $(CC) $(LDFLAGS) -o $@ xdpyinfo.o \
750                 $(LIBS) $(X_LIBS) @GL_LIBS@ \
751                 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) -lm
752
753
754 ##############################################################################
755 #
756 # DO NOT DELETE: updated by make distdepend
757 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
758
759 xscreensaver.o: ../config.h
760 xscreensaver.o: $(srcdir)/xscreensaver.h
761 xscreensaver.o: $(srcdir)/prefs.h
762 xscreensaver.o: $(UTILS_SRC)/version.h
763 xscreensaver.o: $(UTILS_SRC)/yarandom.h
764 xscreensaver.o: $(UTILS_SRC)/resources.h
765 xscreensaver.o: $(UTILS_SRC)/visual.h
766 xscreensaver.o: $(UTILS_SRC)/usleep.h
767 xscreensaver.o: XScreenSaver_ad.h
768 windows.o: ../config.h
769 windows.o: $(srcdir)/xscreensaver.h
770 windows.o: $(srcdir)/prefs.h
771 windows.o: $(UTILS_SRC)/visual.h
772 windows.o: $(UTILS_SRC)/fade.h
773 timers.o: ../config.h
774 timers.o: $(srcdir)/xscreensaver.h
775 timers.o: $(srcdir)/prefs.h
776 subprocs.o: ../config.h
777 subprocs.o: $(srcdir)/xscreensaver.h
778 subprocs.o: $(srcdir)/prefs.h
779 subprocs.o: $(UTILS_SRC)/yarandom.h
780 subprocs.o: $(UTILS_SRC)/visual.h
781 xset.o: ../config.h
782 xset.o: $(srcdir)/xscreensaver.h
783 xset.o: $(srcdir)/prefs.h
784 splash.o: ../config.h
785 splash.o: $(srcdir)/xscreensaver.h
786 splash.o: $(srcdir)/prefs.h
787 splash.o: $(UTILS_SRC)/resources.h
788 setuid.o: ../config.h
789 setuid.o: $(srcdir)/xscreensaver.h
790 setuid.o: $(srcdir)/prefs.h
791 stderr.o: ../config.h
792 stderr.o: $(srcdir)/xscreensaver.h
793 stderr.o: $(srcdir)/prefs.h
794 stderr.o: $(UTILS_SRC)/resources.h
795 stderr.o: $(UTILS_SRC)/visual.h
796 demo-Xm.o: ../config.h
797 demo-Xm.o: $(UTILS_SRC)/version.h
798 demo-Xm.o: $(srcdir)/prefs.h
799 demo-Xm.o: $(UTILS_SRC)/resources.h
800 demo-Xm.o: $(UTILS_SRC)/visual.h
801 demo-Xm.o: $(srcdir)/remote.h
802 demo-Xm.o: $(UTILS_SRC)/usleep.h
803 demo-Xm.o: XScreenSaver_ad.h
804 demo-Xm-widgets.o: ../config.h
805 demo-Gtk.o: ../config.h
806 demo-Gtk.o: $(UTILS_SRC)/version.h
807 demo-Gtk.o: $(srcdir)/prefs.h
808 demo-Gtk.o: $(UTILS_SRC)/resources.h
809 demo-Gtk.o: $(UTILS_SRC)/visual.h
810 demo-Gtk.o: $(srcdir)/remote.h
811 demo-Gtk.o: $(UTILS_SRC)/usleep.h
812 demo-Gtk.o: $(UTILS_SRC)/logo-50.xpm
813 demo-Gtk.o: $(UTILS_SRC)/logo-180.xpm
814 demo-Gtk.o: $(srcdir)/demo-Gtk-widgets.h
815 demo-Gtk.o: XScreenSaver_ad.h
816 demo-Gtk-widgets.o: ../config.h
817 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-stubs.h
818 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-widgets.h
819 xscreensaver-getimage.o: $(UTILS_SRC)/utils.h
820 xscreensaver-getimage.o: ../config.h
821 xscreensaver-getimage.o: $(UTILS_SRC)/yarandom.h
822 xscreensaver-getimage.o: $(UTILS_SRC)/grabscreen.h
823 xscreensaver-getimage.o: $(UTILS_SRC)/resources.h
824 xscreensaver-getimage.o: $(UTILS_SRC)/colorbars.h
825 xscreensaver-getimage.o: $(srcdir)/prefs.h
826 xscreensaver-getimage.o: $(UTILS_SRC)/vroot.h
827 xscreensaver-getimage.o: XScreenSaver_ad.h
828 passwd-pwent.o: ../config.h
829 lock.o: ../config.h
830 lock.o: $(srcdir)/xscreensaver.h
831 lock.o: $(srcdir)/prefs.h
832 lock.o: $(UTILS_SRC)/resources.h
833 passwd.o: ../config.h
834 prefs.o: ../config.h
835 prefs.o: $(srcdir)/prefs.h
836 prefs.o: $(UTILS_SRC)/resources.h
837 dpms.o: ../config.h
838 dpms.o: $(srcdir)/xscreensaver.h
839 dpms.o: $(srcdir)/prefs.h
840 remote.o: ../config.h
841 remote.o: $(srcdir)/remote.h
842 xscreensaver-command.o: ../config.h
843 xscreensaver-command.o: $(srcdir)/remote.h
844 xscreensaver-command.o: $(UTILS_SRC)/version.h
845 test-passwd.o: ../config.h
846 test-passwd.o: $(srcdir)/xscreensaver.h
847 test-passwd.o: $(srcdir)/prefs.h
848 test-passwd.o: $(UTILS_SRC)/resources.h
849 test-passwd.o: $(UTILS_SRC)/version.h
850 test-passwd.o: $(UTILS_SRC)/visual.h
851 test-passwd.o: XScreenSaver_ad.h
852 test-uid.o: ../config.h
853 test-xdpms.o: ../config.h
854 test-grab.o: ../config.h
855 test-apm.o: ../config.h
856 test-fade.o: ../config.h
857 test-fade.o: $(srcdir)/xscreensaver.h
858 test-fade.o: $(srcdir)/prefs.h
859 test-fade.o: $(UTILS_SRC)/fade.h
860