http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.32.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         $(INSTALL_PROGRAM) xscreensaver-command \
249           $(install_prefix)$(bindir)/xscreensaver-command
250         $(INSTALL_PROGRAM) xscreensaver-demo \
251           $(install_prefix)$(bindir)/xscreensaver-demo
252         $(INSTALL_PROGRAM) xscreensaver-getimage \
253           $(install_prefix)$(bindir)/xscreensaver-getimage
254
255 install-ad: XScreenSaver.ad
256         @if [ ! -d $(install_prefix)$(AD_DIR) ]; then                         \
257           $(INSTALL_DIRS) $(install_prefix)$(AD_DIR) ;                        \
258          fi
259         @-echo $(INSTALL_DATA) XScreenSaver.ad                                \
260           $(install_prefix)$(AD_DIR)/XScreenSaver ;                           \
261         if $(INSTALL_DATA) XScreenSaver.ad                                    \
262           $(install_prefix)$(AD_DIR)/XScreenSaver ; then                      \
263           true ;                                                              \
264         else                                                                  \
265           e=echo ;                                                            \
266           if [ -f $(install_prefix)$(AD_DIR)/XScreenSaver ]; then             \
267  $$e ""                                                                      ;\
268  $$e "  ####################################################################";\
269  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
270  $$e "           That file exists, and is unwritable.  It is probably from"  ;\
271  $$e "           an older version of xscreensaver, and could cause things"   ;\
272  $$e "           to malfunction.  Please delete it!"                         ;\
273  $$e "  ####################################################################";\
274  $$e ""                                                                      ;\
275             exit 1 ;                                                          \
276           else                                                                \
277  $$e ""                                                                      ;\
278  $$e "  ####################################################################";\
279  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
280  $$e "           The directory is unwritable.  This is probably ok;"         ;\
281  $$e "           xscreensaver should work without that file."                ;\
282  $$e "  ####################################################################";\
283  $$e ""                                                                      ;\
284             exit 0 ;                                                          \
285           fi                                                                  \
286         fi
287
288 install-scripts: $(SCRIPTS) munge-scripts
289         @for program in $(SCRIPTS); do                                  \
290           if [ -r $$program ] ; then                                    \
291             p=$$program ;                                               \
292           else                                                          \
293             p=$(srcdir)/$$program ;                                     \
294           fi ;                                                          \
295           echo $(INSTALL_SCRIPT) $$p                                    \
296             $(install_prefix)$(bindir)/$$program ;                      \
297           $(INSTALL_SCRIPT) $$p                                         \
298             $(install_prefix)$(bindir)/$$program ;                      \
299         done
300
301 munge-scripts: $(SCRIPTS)
302         @tmp=/tmp/mf.$$$$ ;                                             \
303         perl="${PERL}" ;                                                \
304         for program in $(SCRIPTS); do                                   \
305           echo "adjusting location of perl in $$program..." ;           \
306           sed "s@^\(#!\)\(/[^ ]*/perl[^ ]*\)\(.*\)\$$@\1$$perl\3@"      \
307               < $(srcdir)/$$program > $$tmp ;                           \
308           if cmp -s $(srcdir)/$$program $$tmp ; then                    \
309             true ;                                                      \
310           else                                                          \
311             cat $$tmp > ./$$program ;                                   \
312           fi ;                                                          \
313         done
314
315 install-man: $(MEN)
316         @men="$(MEN)" ;                                                 \
317         if [ ! -d $(install_prefix)$(man1dir) ]; then                   \
318           $(INSTALL_DIRS) $(install_prefix)$(man1dir) ;                 \
319          fi ;                                                           \
320         for man in $$men; do                                            \
321           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
322           echo $(INSTALL_DATA) $(srcdir)/$$man                          \
323            $(install_prefix)$(man1dir)/$$instname ;                     \
324           $(INSTALL_DATA) $(srcdir)/$$man                               \
325             $(install_prefix)$(man1dir)/$$instname ;                    \
326         done
327
328 uninstall-program:
329         @for program in $(EXES) $(SCRIPTS); do                          \
330           echo rm -f $(install_prefix)$(bindir)/$$program ;             \
331           rm -f $(install_prefix)$(bindir)/$$program ;                  \
332         done
333
334 uninstall-ad:
335         rm -f $(install_prefix)$(AD_DIR)/XScreenSaver
336
337 uninstall-man:
338         @men="$(MEN)" ;                                                 \
339         for man in $$men; do                                            \
340           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
341           echo rm -f $(install_prefix)$(man1dir)/$$instname ;           \
342           rm -f $(install_prefix)$(man1dir)/$$instname ;                \
343         done
344
345 install-pam:
346         @src="$(srcdir)/xscreensaver.pam" ;                             \
347         dest=`sed -n 's/.*PAM_SERVICE_NAME[     ]*"\([^"]*\)".*$$/\1/p' \
348            < ../config.h` ;                                             \
349         dir="$(install_prefix)$(PAM_DIR)" ;                             \
350         conf="$(PAM_CONF)" ;                                            \
351                                                                         \
352         if [ -d $$dir ] ; then                                          \
353                                                                         \
354           if [ -f $$dir/xdm ]; then                                     \
355             src2=$$dir/xdm ;                                            \
356           elif [ -f $$dir/login ]; then                                 \
357             src2=$$dir/login ;                                          \
358           fi ;                                                          \
359                                                                         \
360           if [ -z "$$src2" ]; then                                      \
361             echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
362             $(INSTALL_DATA) $$src $$dir/$$dest ;                        \
363           else                                                          \
364             src="xscreensaver.pam.$$$$" ;                               \
365             echo "grep '^#%\|^auth' $$src2 > $$src" ;                   \
366                   grep '^#%\|^auth' $$src2 > $$src ;                    \
367             echo $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
368                  $(INSTALL_DATA) $$src $$dir/$$dest ;                   \
369             echo rm -f $$src ;                                          \
370                  rm -f $$src ;                                          \
371           fi ;                                                          \
372                                                                         \
373           if [ ! -f $$dir/$$dest ]; then                                \
374             e=echo ;                                                    \
375  $$e ""                                                                      ;\
376  $$e "  ####################################################################";\
377  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
378  $$e "           Authentication Modules (PAM).  However, we were unable to"  ;\
379  $$e "           install the file $$dir/$$dest.  PAM is unlikely"            ;\
380  $$e "           to work without this file (and old-style password"          ;\
381  $$e "           authentication will be used instead, which may or may not"  ;\
382  $$e "           work.)"                                                     ;\
383  $$e "  ####################################################################";\
384  $$e ""                                                                      ;\
385           fi ;                                                          \
386         elif [ -f $$conf ]; then                                        \
387           if ( grep $$dest $$conf >/dev/null ); then                    \
388            true ;                                                       \
389           else                                                          \
390             e=echo ;                                                    \
391  $$e ""                                                                      ;\
392  $$e "  ####################################################################";\
393  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
394  $$e "           Authentication Modules (PAM).  To complete the installation";\
395  $$e "           of PAM support, you must add the following line to the file";\
396  $$e "           $$conf:"                                                    ;\
397  $$e ""                                                                      ;\
398  $$e    "       $$dest  auth required   /usr/lib/security/pam_unix.so.1"     ;\
399  $$e ""                                                                      ;\
400  $$e "           Be careful: if you mess up that file, you could completely" ;\
401  $$e "           hose your machine (e.g., \`login' and \`su' won't work, and";\
402  $$e "           you'll have to boot single-user to fix it.)"                ;\
403  $$e "  ####################################################################";\
404             echo "";                                                    \
405           fi ;                                                          \
406         fi
407
408 install-gnome:: screensaver-properties.desktop
409         @lost1=""                                                            ;\
410          lost2=""                                                            ;\
411          if [ "$(GNOME_DATADIR)" != "" ]; then                                \
412                                                                               \
413            if [ ! -d "$(install_prefix)$(GNOME_CCDIR)" ]; then                \
414              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)"          ;\
415                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_CCDIR)"          ;\
416            fi                                                                ;\
417                                                                               \
418            echo    $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
419              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
420                                                                               \
421            if      $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
422              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
423              then true                                                       ;\
424            else                                                               \
425              lost1="$(install_prefix)$(GNOME_CCDIR)"                         ;\
426            fi                                                                ;\
427                                                                               \
428            if [ ! -d "$(install_prefix)$(GNOME_PANELDIR)" ]; then             \
429              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)"       ;\
430                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_PANELDIR)"       ;\
431            fi                                                                ;\
432                                                                               \
433            echo $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
434                         $(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
435            if   $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
436        $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
437              then true                                                       ;\
438            else                                                               \
439              lost2="$(install_prefix)$(GNOME_PANELDIR)"                      ;\
440            fi                                                                ;\
441                                                                               \
442            if [ "$$lost1" != "" -o "$$lost2" != "" ]; then                    \
443              e=echo ;                                                         \
444  $$e ""                                                                      ;\
445  $$e "  ####################################################################";\
446  $$e "  Warning: unable to install screensaver-properties.desktop into"      ;\
447                  plurality="this file"                                       ;\
448           if [ "$$lost1" != "" -a "$$lost2" != "" ]; then                     \
449  $$e "           $$lost1/ or into"                                           ;\
450  $$e "           $$lost2/."                                                  ;\
451                  plurality="these files"                                     ;\
452           elif [ "$$lost1" != "" ]; then                                      \
453  $$e "           $$lost1/."                                                  ;\
454           else                                                                \
455  $$e "           $$lost2/."                                                  ;\
456           fi                                                                 ;\
457  $$e "           Without $$plurality," 'the "Screen Saver" section of the'   ;\
458  $$e "           Gnome Control Center (gnomecc) will not work properly."     ;\
459  $$e "  ####################################################################";\
460  $$e ""                                                                      ;\
461              exit 1 ;                                                         \
462            fi                                                                ;\
463          fi
464
465 install-gnome:: screensaver-properties-capplet
466         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
467            if [ ! -d "$(install_prefix)$(GNOME_BINDIR)" ]; then               \
468              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_BINDIR)"         ;\
469                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_BINDIR)"         ;\
470            fi                                                                ;\
471            program=screensaver-properties-capplet                            ;\
472            echo $(INSTALL_SCRIPT) $$program                                   \
473                   $(install_prefix)$(GNOME_BINDIR)/$$program                 ;\
474            if   $(INSTALL_SCRIPT) $$program                                   \
475                   $(install_prefix)$(GNOME_BINDIR)/$$program                 ;\
476              then true                                                       ;\
477            else                                                               \
478              e=echo ;                                                         \
479  $$e ""                                                                      ;\
480  $$e "  ####################################################################";\
481  $$e "  Warning: unable to install $$program into"                           ;\
482  $$e "           $(install_prefix)$(GNOME_BINDIR)/."                         ;\
483  $$e "           Without this file, the Gnome session manager will not"      ;\
484  $$e "           launch xscreensaver properly at login time."                ;\
485  $$e "  ####################################################################";\
486  $$e ""                                                                      ;\
487              exit 1 ;                                                         \
488            fi ;                                                               \
489          fi
490
491 install-gnome:: $(LOGO)
492         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
493            if [ ! -d "$(install_prefix)$(GNOME_ICONDIR)" ]; then              \
494              echo $(INSTALL_DIRS) "$(install_prefix)$(GNOME_ICONDIR)"        ;\
495                   $(INSTALL_DIRS) "$(install_prefix)$(GNOME_ICONDIR)"        ;\
496            fi                                                                ;\
497            target=xscreensaver.xpm                                           ;\
498            echo $(INSTALL_DATA) $(LOGO)                                       \
499                   $(install_prefix)$(GNOME_ICONDIR)/$$target                 ;\
500                 $(INSTALL_DATA) $(LOGO)                                       \
501                   $(install_prefix)$(GNOME_ICONDIR)/$$target                 ;\
502         fi
503
504 uninstall-gnome::
505         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
506           f=screensaver-properties.desktop                                   ;\
507           echo rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
508                rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
509           echo rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
510                rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
511         fi
512
513 uninstall-gnome::
514         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
515           program=screensaver-properties-capplet                             ;\
516           echo rm -f $(install_prefix)$(bindir)/$$program                    ;\
517                rm -f $(install_prefix)$(bindir)/$$program                    ;\
518          fi
519
520 uninstall-gnome::
521         @if [ "$(GNOME_DATADIR)" != "" ]; then                                \
522           target=xscreensaver.xpm                                            ;\
523           echo rm -f $(install_prefix)$(GNOME_ICONDIR)/$$target              ;\
524                rm -f $(install_prefix)$(GNOME_ICONDIR)/$$target              ;\
525          fi
526
527 install-kde:
528         @src="$(srcdir)/xscreensaver.kss" ;                                   \
529         if [ "$$KDEDIR" != "" ]; then                                         \
530           dir="$(install_prefix)$$KDEDIR/bin" ;                               \
531           dest="$$dir/xscreensaver.kss" ;                                     \
532           echo $(INSTALL_SCRIPT) $$src $$dest ;                               \
533           if $(INSTALL_SCRIPT) $$src $$dest ; then                            \
534             true ;                                                            \
535           else                                                                \
536             e=echo ;                                                          \
537  $$e ""                                                                      ;\
538  $$e "  ####################################################################";\
539  $$e "  Warning: unable to install $$dest"                                   ;\
540             if [ ! -d $(install_prefix)$$KDEDIR ]; then                       \
541  $$e "           $(install_prefix)$$KDEDIR (\$$KDEDIR) does not exist."      ;\
542             elif [ ! -d $(install_prefix)$$KDEDIR/bin ]; then                 \
543  $$e "           $(install_prefix)$$KDEDIR/bin (\$$KDEDIR/bin) does not exist.";\
544             elif [ -f $$dest ]; then                                          \
545  $$e "           That file exists, and is unwritable."                       ;\
546             else                                                              \
547  $$e "           The directory is unwritable."                               ;\
548             fi                                                               ;\
549  $$e "  ####################################################################";\
550  $$e ""                                                                      ;\
551             exit 1 ;                                                          \
552           fi ;                                                                \
553         fi
554
555 uninstall-kde:
556         @if [ "$$KDEDIR" != "" ]; then                                  \
557           dest="$(install_prefix)$$KDEDIR/bin/xscreensaver.kss" ;       \
558           echo rm -f $$dest ;                                           \
559           rm -f $$dest ;                                                \
560         fi
561
562 clean:
563         -rm -f *.o a.out core $(EXES) $(EXES2) $(TEST_EXES) XScreenSaver_ad.h
564
565 distclean: clean
566         -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
567
568 # Adds all current dependencies to Makefile
569 depend: XScreenSaver_ad.h
570         $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
571         $(DEPEND_FLAGS) --                                                  \
572         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
573         $(SAVER_SRCS) $(CMD_SRCS) $(GETIMG_SRCS_1)
574
575 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
576 # close.  This excludes dependencies on files in /usr/include, etc.  It tries
577 # to include only dependencies on files which are themselves a part of this
578 # package.
579 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
580         @echo updating dependencies in `pwd`/Makefile.in... ;               \
581         $(DEPEND) -w 0 -f -                                                 \
582         -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
583         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
584         $(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS) $(GETIMG_SRCS_1)          \
585         $(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS)             \
586         $(TEST_SRCS) |                                                      \
587         (                                                                   \
588           awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
589           sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
590               -e 's@\.\./utils@$$(UTILS_SRC)@g'                             \
591               -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
592               -e 's@$$.*\(XScreenSaver_ad\)@\1@g'                           \
593               -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ;                    \
594           echo ''                                                           \
595         ) > /tmp/distdepend.$$$$ &&                                         \
596         mv Makefile.in Makefile.in.bak &&                                   \
597         mv /tmp/distdepend.$$$$ Makefile.in
598
599 # Updates the version number in the app-defaults file to be in sync with 
600 # the version number in version.h.  This is so people can tell when they
601 # have a version skew between the app-defaults file and the executable.
602 update_ad_version::
603         @S=XScreenSaver.ad.in ;                                             \
604         U=$(UTILS_SRC)/version.h ;                                          \
605         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
606         D=`date '+%d-%b-%Y'` ;                                              \
607         echo -n "Updating version number in $$S to $$V $$D... " ;           \
608         T=/tmp/xs.$$$$ ;                                                    \
609         sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/"         \
610             -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9]*\)/$$D/"     \
611           < $$S > $$T ;                                                     \
612         if cmp -s $$S $$T ; then                                            \
613           echo "unchanged." ;                                               \
614         else                                                                \
615           cat $$T > $$S ;                                                   \
616           echo "done." ;                                                    \
617         fi ;                                                                \
618         rm $$T
619
620 update_man_version::
621         @for S in $(MEN); do                                                \
622         U=$(UTILS_SRC)/version.h ;                                          \
623         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
624         V="`date '+%d-%b-%Y'` ($$V)" ;                                      \
625         echo -n "Updating footer in $$S to \"$$V\"... " ;                   \
626         T=/tmp/xs.$$$$ ;                                                    \
627         sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/"                \
628           < $$S > $$T ;                                                     \
629         if cmp -s $$S $$T ; then                                            \
630           echo "unchanged." ;                                               \
631         else                                                                \
632           cat $$T > $$S ;                                                   \
633           echo "done." ;                                                    \
634         fi ;                                                                \
635         rm $$T ;                                                            \
636         done
637
638 TAGS: tags
639 tags:
640         find $(srcdir) -name '*.[chly]' -print | xargs etags -a
641
642 echo_tarfiles:
643         @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
644         @echo $(TARFILES)
645
646
647 # Rules for noticing when the objects from the utils directory are out of
648 # date with respect to their sources, and going and building them according
649 # to the rules in their own Makefile...
650 #
651 $(UTILS_BIN)/fade.o:            $(UTILS_SRC)/fade.c
652 $(UTILS_BIN)/overlay.o:         $(UTILS_SRC)/overlay.c
653 $(UTILS_BIN)/resources.o:       $(UTILS_SRC)/resources.c
654 $(UTILS_BIN)/usleep.o:          $(UTILS_SRC)/usleep.c
655 $(UTILS_BIN)/visual.o:          $(UTILS_SRC)/visual.c
656 $(UTILS_BIN)/xmu.o:             $(UTILS_SRC)/xmu.c
657 $(UTILS_BIN)/logo.o:            $(UTILS_SRC)/logo.c
658 $(UTILS_BIN)/yarandom.o:        $(UTILS_SRC)/yarandom.c
659 $(UTILS_BIN)/colorbars.o:       $(UTILS_SRC)/colorbars.c
660
661 $(SAVER_UTIL_OBJS):
662         cd $(UTILS_BIN) ; \
663         $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
664
665 # How we build object files in this directory.
666 .c.o:
667         $(CC) -c $(INCLUDES) $(DEFS)  $(CFLAGS) $(X_CFLAGS) $<
668
669 # subprocs is the only one that takes an extra -D option.
670 subprocs.o: subprocs.c
671         $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) \
672           $(srcdir)/subprocs.c
673
674
675 # How we build the default app-defaults file into the program.
676 #
677 XScreenSaver_ad.h: XScreenSaver.ad
678         $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
679
680 screensaver-properties.desktop: screensaver-properties.desktop.in Makefile
681         @echo generating $@... ;                                        \
682         sed "s%[@]bindir[@]%${bindir}%g"                                \
683           < ${srcdir}/screensaver-properties.desktop.in                 \
684           > $@
685
686 # The executables linked in this directory.
687 #
688 xscreensaver: $(SAVER_OBJS)
689         $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
690
691 xscreensaver-command: $(CMD_OBJS)
692         $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
693
694
695 xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
696         cp -p @PREFERRED_DEMO_PROGRAM@ $@
697
698 xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
699         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(MOTIF_OBJS) $(LIBS) $(X_LIBS) \
700         $(MOTIF_LIBS) $(X_PRE_LIBS) -lXt -lX11 $(XDPMS_LIBS) -lXext \
701         $(X_EXTRA_LIBS)
702
703 xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
704         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
705         $(GTK_LIBS) $(X_PRE_LIBS) -lXt -lX11 $(XDPMS_LIBS) -lXext \
706         $(X_EXTRA_LIBS)
707
708 xscreensaver-getimage: $(GETIMG_OBJS)
709         $(CC) $(LDFLAGS) -o $@ $(GETIMG_OBJS) $(GETIMG_LIBS) -lm
710
711
712 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
713          subprocs.o setuid.o splash.o prefs.o \
714         $(SAVER_UTIL_OBJS)
715 test-passwd.o: XScreenSaver_ad.h
716
717 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
718         $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
719
720 test-uid: test-uid.o
721         $(CC) $(LDFLAGS) -o $@ test-uid.o
722
723 test-xdpms: test-xdpms.o
724         $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(LIBS) $(X_LIBS) $(XDPMS_LIBS) \
725         $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
726
727 test-grab: test-grab.o
728         $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
729
730 test-apm: test-apm.o
731         $(CC) $(LDFLAGS) -o $@ test-apm.o $(SAVER_LIBS) -lapm
732
733 TEST_FADE_OBJS = test-fade.o $(UTILS_SRC)/fade.o $(DEMO_UTIL_OBJS)
734 test-fade: test-fade.o 
735         $(CC) $(LDFLAGS) -o $@ $(TEST_FADE_OBJS) $(SAVER_LIBS)
736
737
738 xdpyinfo.o: xdpyinfo.c
739         $(CC) -c $(INCLUDES) -DHAVE_GLX $(CFLAGS) $(X_CFLAGS) \
740           $(srcdir)/xdpyinfo.c
741
742 xdpyinfo: xdpyinfo.o
743         $(CC) $(LDFLAGS) -o $@ xdpyinfo.o \
744                 $(LIBS) $(X_LIBS) @GL_LIBS@ \
745                 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) -lm
746
747
748 ##############################################################################
749 #
750 # DO NOT DELETE: updated by make distdepend
751 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
752
753 xscreensaver.o: ../config.h
754 xscreensaver.o: $(srcdir)/xscreensaver.h
755 xscreensaver.o: $(srcdir)/prefs.h
756 xscreensaver.o: XScreenSaver_ad.h
757 windows.o: ../config.h
758 windows.o: $(srcdir)/xscreensaver.h
759 windows.o: $(srcdir)/prefs.h
760 timers.o: ../config.h
761 timers.o: $(srcdir)/xscreensaver.h
762 timers.o: $(srcdir)/prefs.h
763 subprocs.o: ../config.h
764 subprocs.o: $(srcdir)/xscreensaver.h
765 subprocs.o: $(srcdir)/prefs.h
766 xset.o: ../config.h
767 xset.o: $(srcdir)/xscreensaver.h
768 xset.o: $(srcdir)/prefs.h
769 splash.o: ../config.h
770 splash.o: $(srcdir)/xscreensaver.h
771 splash.o: $(srcdir)/prefs.h
772 setuid.o: ../config.h
773 setuid.o: $(srcdir)/xscreensaver.h
774 setuid.o: $(srcdir)/prefs.h
775 stderr.o: ../config.h
776 stderr.o: $(srcdir)/xscreensaver.h
777 stderr.o: $(srcdir)/prefs.h
778 demo-Xm.o: ../config.h
779 demo-Xm.o: $(srcdir)/prefs.h
780 demo-Xm.o: $(srcdir)/remote.h
781 demo-Xm.o: XScreenSaver_ad.h
782 demo-Xm-widgets.o: ../config.h
783 demo-Gtk.o: ../config.h
784 demo-Gtk.o: $(srcdir)/prefs.h
785 demo-Gtk.o: $(srcdir)/remote.h
786 demo-Gtk.o: $(srcdir)/demo-Gtk-widgets.h
787 demo-Gtk.o: XScreenSaver_ad.h
788 demo-Gtk-widgets.o: ../config.h
789 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-stubs.h
790 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-widgets.h
791 xscreensaver-getimage.o: ../config.h
792 xscreensaver-getimage.o: $(srcdir)/prefs.h
793 xscreensaver-getimage.o: XScreenSaver_ad.h
794 passwd-pwent.o: ../config.h
795 lock.o: ../config.h
796 lock.o: $(srcdir)/xscreensaver.h
797 lock.o: $(srcdir)/prefs.h
798 passwd.o: ../config.h
799 prefs.o: ../config.h
800 prefs.o: $(srcdir)/prefs.h
801 dpms.o: ../config.h
802 dpms.o: $(srcdir)/xscreensaver.h
803 dpms.o: $(srcdir)/prefs.h
804 remote.o: ../config.h
805 remote.o: $(srcdir)/remote.h
806 xscreensaver-command.o: ../config.h
807 xscreensaver-command.o: $(srcdir)/remote.h
808 test-passwd.o: ../config.h
809 test-passwd.o: $(srcdir)/xscreensaver.h
810 test-passwd.o: $(srcdir)/prefs.h
811 test-passwd.o: XScreenSaver_ad.h
812 test-uid.o: ../config.h
813 test-xdpms.o: ../config.h
814 test-grab.o: ../config.h
815 test-apm.o: ../config.h
816 test-fade.o: ../config.h
817 test-fade.o: $(srcdir)/xscreensaver.h
818 test-fade.o: $(srcdir)/prefs.h
819