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