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