http://ftp.x.org/contrib/applications/xscreensaver-3.25.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
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         $(INSTALL_PROGRAM) xscreensaver-command \
214           $(install_prefix)$(bindir)/xscreensaver-command
215         $(INSTALL_PROGRAM) xscreensaver-demo \
216           $(install_prefix)$(bindir)/xscreensaver-demo
217
218 install-ad: XScreenSaver.ad
219         @if [ ! -d $(install_prefix)$(AD_DIR) ]; then                         \
220           $(INSTALL_DIRS) $(install_prefix)$(AD_DIR) ;                        \
221          fi
222         @-echo $(INSTALL_DATA) XScreenSaver.ad                                \
223           $(install_prefix)$(AD_DIR)/XScreenSaver ;                           \
224         if $(INSTALL_DATA) XScreenSaver.ad                                    \
225           $(install_prefix)$(AD_DIR)/XScreenSaver ; then                      \
226           true ;                                                              \
227         else                                                                  \
228           e=echo ;                                                            \
229           if [ -f $(install_prefix)$(AD_DIR)/XScreenSaver ]; then             \
230  $$e ""                                                                      ;\
231  $$e "  ####################################################################";\
232  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
233  $$e "           That file exists, and is unwritable.  It is probably from"  ;\
234  $$e "           an older version of xscreensaver, and could cause things"   ;\
235  $$e "           to malfunction.  Please delete it!"                         ;\
236  $$e "  ####################################################################";\
237  $$e ""                                                                      ;\
238             exit 1 ;                                                          \
239           else                                                                \
240  $$e ""                                                                      ;\
241  $$e "  ####################################################################";\
242  $$e "  Warning: unable to install $(install_prefix)$(AD_DIR)/XScreenSaver"  ;\
243  $$e "           The directory is unwritable.  This is probably ok;"         ;\
244  $$e "           xscreensaver should work without that file."                ;\
245  $$e "  ####################################################################";\
246  $$e ""                                                                      ;\
247             exit 0 ;                                                          \
248           fi                                                                  \
249         fi
250
251 install-man: $(MEN)
252         @men="$(MEN)" ;                                                 \
253         if [ ! -d $(install_prefix)$(man1dir) ]; then                   \
254           $(INSTALL_DIRS) $(install_prefix)$(man1dir) ;                 \
255          fi ;                                                           \
256         for man in $$men; do                                            \
257           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
258           echo $(INSTALL_DATA) $(srcdir)/$$man                          \
259            $(install_prefix)$(man1dir)/$$instname ;                     \
260           $(INSTALL_DATA) $(srcdir)/$$man                               \
261             $(install_prefix)$(man1dir)/$$instname ;                    \
262         done
263
264 uninstall-program:
265         @for program in $(EXES); do                                     \
266           echo rm -f $(install_prefix)$(bindir)/$$program ;             \
267           rm -f $(install_prefix)$(bindir)/$$program ;                  \
268         done
269
270 uninstall-ad:
271         rm -f $(install_prefix)$(AD_DIR)/XScreenSaver
272
273 uninstall-man:
274         @men="$(MEN)" ;                                                 \
275         for man in $$men; do                                            \
276           instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ;     \
277           echo rm -f $(install_prefix)$(man1dir)/$$instname ;           \
278           rm -f $(install_prefix)$(man1dir)/$$instname ;                \
279         done
280
281 install-pam:
282         @src="$(srcdir)/xscreensaver.pam" ;                             \
283         dest=`sed -n 's/.*PAM_SERVICE_NAME[     ]*"\([^"]*\)".*$$/\1/p' \
284            < ../config.h` ;                                             \
285         dir="$(install_prefix)$(PAM_DIR)" ;                             \
286         conf="$(PAM_CONF)" ;                                            \
287                                                                         \
288         if [ -d $$dir ] ; then                                          \
289           echo $(INSTALL_DATA) $$src $$dir/$$dest ;                     \
290           $(INSTALL_DATA) $$src $$dir/$$dest ;                          \
291           if [ ! -f $$dir/$$dest ]; then                                \
292             e=echo ;                                                    \
293  $$e ""                                                                      ;\
294  $$e "  ####################################################################";\
295  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
296  $$e "           Authentication Modules (PAM).  However, we were unable to"  ;\
297  $$e "           install the file $$dir/$$dest.  PAM is unlikely"            ;\
298  $$e "           to work without this file (and old-style password"          ;\
299  $$e "           authentication will be used instead, which may or may not"  ;\
300  $$e "           work.)"                                                     ;\
301  $$e "  ####################################################################";\
302  $$e ""                                                                      ;\
303           fi ;                                                          \
304         elif [ -f $$conf ]; then                                        \
305           if ( grep $$dest $$conf >/dev/null ); then                    \
306            true ;                                                       \
307           else                                                          \
308             e=echo ;                                                    \
309  $$e ""                                                                      ;\
310  $$e "  ####################################################################";\
311  $$e "  Warning: xscreensaver has been compiled with support for Pluggable"  ;\
312  $$e "           Authentication Modules (PAM).  To complete the installation";\
313  $$e "           of PAM support, you must add the following line to the file";\
314  $$e "           $$conf:"                                                    ;\
315  $$e ""                                                                      ;\
316  $$e    "       $$dest  auth required   /usr/lib/security/pam_unix.so.1"     ;\
317  $$e ""                                                                      ;\
318  $$e "           Be careful: if you mess up that file, you could completely" ;\
319  $$e "           hose your machine (e.g., \`login' and \`su' won't work, and";\
320  $$e "           you'll have to boot single-user to fix it.)"                ;\
321  $$e "  ####################################################################";\
322             echo "";                                                    \
323           fi ;                                                          \
324         fi
325
326 install-gnome: screensaver-properties.desktop
327         @lost1=""                                                            ;\
328          lost2=""                                                            ;\
329          if [ "$(install_prefix)$(GNOME_DATADIR)" != "" ]; then               \
330            echo    $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
331              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
332            if      $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop   \
333              $(install_prefix)$(GNOME_CCDIR)/screensaver-properties.desktop  ;\
334              then true                                                       ;\
335            else                                                               \
336              lost1="$(install_prefix)$(GNOME_CCDIR)"                         ;\
337            fi                                                                ;\
338            echo $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
339                         $(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
340            if   $(INSTALL_DATA) $(srcdir)/screensaver-properties.desktop      \
341        $(install_prefix)$(GNOME_PANELDIR)/screensaver-properties.desktop     ;\
342              then true                                                       ;\
343            else                                                               \
344              lost2="$(install_prefix)$(GNOME_PANELDIR)"                      ;\
345            fi                                                                ;\
346            if [ "$$lost1" != "" -o "$$lost2" != "" ]; then                    \
347              e=echo ;                                                         \
348  $$e ""                                                                      ;\
349  $$e "  ####################################################################";\
350  $$e "  Warning: unable to install screensaver-properties.desktop into"      ;\
351                  plurality="this file"                                       ;\
352           if [ "$$lost1" != "" -a "$$lost2" != "" ]; then                     \
353  $$e "           $$lost1/ or into"                                           ;\
354  $$e "           $$lost2/."                                                  ;\
355                  plurality="these files"                                     ;\
356           elif [ "$$lost1" != "" ]; then                                      \
357  $$e "           $$lost1/."                                                  ;\
358           else                                                                \
359  $$e "           $$lost2/."                                                  ;\
360           fi                                                                 ;\
361  $$e "           Without $$plurality," 'the "Screen Saver" section of the'   ;\
362  $$e "           Gnome Control Center (gnomecc) will not work properly."     ;\
363  $$e "  ####################################################################";\
364  $$e ""                                                                      ;\
365              exit 1 ;                                                         \
366            fi                                                                ;\
367          fi
368
369 uninstall-gnome:
370         @if [ "$(install_prefix)$(GNOME_DATADIR)" != "" ]; then               \
371           f=screensaver-properties.desktop                                   ;\
372           echo rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
373                rm -f $(install_prefix)$(GNOME_CCDIR)/$$f                     ;\
374           echo rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
375                rm -f $(install_prefix)$(GNOME_PANELDIR)/$$f                  ;\
376         fi
377
378 install-kde:
379         @src="$(srcdir)/xscreensaver.kss" ;                                   \
380         if [ "$$KDEDIR" != "" ]; then                                         \
381           dir="$(install_prefix)$$KDEDIR/bin" ;                               \
382           dest="$$dir/xscreensaver.kss" ;                                     \
383           echo $(INSTALL_SCRIPT) $$src $$dest ;                               \
384           if $(INSTALL_SCRIPT) $$src $$dest ; then                            \
385             true ;                                                            \
386           else                                                                \
387             e=echo ;                                                          \
388  $$e ""                                                                      ;\
389  $$e "  ####################################################################";\
390  $$e "  Warning: unable to install $$dest"                                   ;\
391             if [ ! -d $(install_prefix)$$KDEDIR ]; then                       \
392  $$e "           $(install_prefix)$$KDEDIR (\$$KDEDIR) does not exist."      ;\
393             elif [ ! -d $(install_prefix)$$KDEDIR/bin ]; then                 \
394  $$e "           $(install_prefix)$$KDEDIR/bin (\$$KDEDIR/bin) does not exist.";\
395             elif [ -f $$dest ]; then                                          \
396  $$e "           That file exists, and is unwritable."                       ;\
397             else                                                              \
398  $$e "           The directory is unwritable."                               ;\
399             fi                                                               ;\
400  $$e "  ####################################################################";\
401  $$e ""                                                                      ;\
402             exit 1 ;                                                          \
403           fi ;                                                                \
404         fi
405
406 uninstall-kde:
407         @if [ "$$KDEDIR" != "" ]; then                                  \
408           dest="$(install_prefix)$$KDEDIR/bin/xscreensaver.kss" ;       \
409           echo rm -f $$dest ;                                           \
410           rm -f $$dest ;                                                \
411         fi
412
413 clean:
414         -rm -f *.o a.out core $(EXES) $(EXES2) XScreenSaver_ad.h
415
416 distclean: clean
417         -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
418
419 # Adds all current dependencies to Makefile
420 depend: XScreenSaver_ad.h
421         $(DEPEND) -s '# DO NOT DELETE: updated by make depend'              \
422         $(DEPEND_FLAGS) --                                                  \
423         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
424         $(SAVER_SRCS) $(CMD_SRCS)
425
426 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
427 # close.  This excludes dependencies on files in /usr/include, etc.  It tries
428 # to include only dependencies on files which are themselves a part of this
429 # package.
430 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
431         @echo updating dependencies in `pwd`/Makefile.in... ;               \
432         $(DEPEND) -w 0 -f -                                                 \
433         -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
434         $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) --      \
435         $(SAVER_SRCS_1) $(MOTIF_SRCS) $(GTK_SRCS)                           \
436         $(PWENT_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS)             \
437         $(TEST_SRCS) |                                                      \
438         (                                                                   \
439           awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
440           sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d'                        \
441               -e 's@\.\./utils@$$(UTILS_SRC)@g'                             \
442               -e 's@ \([^$$]\)@ $$(srcdir)/\1@g'                            \
443               -e 's@$$.*\(XScreenSaver_ad\)@\1@g'                           \
444               -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ;                    \
445           echo ''                                                           \
446         ) > /tmp/distdepend.$$$$ &&                                         \
447         mv Makefile.in Makefile.in.bak &&                                   \
448         mv /tmp/distdepend.$$$$ Makefile.in
449
450 # Updates the version number in the app-defaults file to be in sync with 
451 # the version number in version.h.  This is so people can tell when they
452 # have a version skew between the app-defaults file and the executable.
453 update_ad_version::
454         @S=XScreenSaver.ad.in ;                                             \
455         U=$(UTILS_SRC)/version.h ;                                          \
456         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
457         D=`date '+%d-%b-%Y'` ;                                              \
458         echo -n "Updating version number in $$S to $$V $$D... " ;           \
459         T=/tmp/xs.$$$$ ;                                                    \
460         sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/"         \
461             -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9]*\)/$$D/"     \
462           < $$S > $$T ;                                                     \
463         if cmp -s $$S $$T ; then                                            \
464           echo "unchanged." ;                                               \
465         else                                                                \
466           cat $$T > $$S ;                                                   \
467           echo "done." ;                                                    \
468         fi ;                                                                \
469         rm $$T
470
471 update_man_version::
472         @for S in $(MEN); do                                                \
473         U=$(UTILS_SRC)/version.h ;                                          \
474         V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ;             \
475         V="`date '+%d-%b-%Y'` ($$V)" ;                                      \
476         echo -n "Updating footer in $$S to \"$$V\"... " ;                   \
477         T=/tmp/xs.$$$$ ;                                                    \
478         sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/"                \
479           < $$S > $$T ;                                                     \
480         if cmp -s $$S $$T ; then                                            \
481           echo "unchanged." ;                                               \
482         else                                                                \
483           cat $$T > $$S ;                                                   \
484           echo "done." ;                                                    \
485         fi ;                                                                \
486         rm $$T ;                                                            \
487         done
488
489 TAGS: tags
490 tags:
491         find $(srcdir) -name '*.[chly]' -print | xargs etags -a
492
493 echo_tarfiles:
494         @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
495         @echo $(TARFILES)
496
497
498 # Rules for noticing when the objects from the utils directory are out of
499 # date with respect to their sources, and going and building them according
500 # to the rules in their own Makefile...
501 #
502 $(UTILS_BIN)/fade.o:            $(UTILS_SRC)/fade.c
503 $(UTILS_BIN)/overlay.o:         $(UTILS_SRC)/overlay.c
504 $(UTILS_BIN)/resources.o:       $(UTILS_SRC)/resources.c
505 $(UTILS_BIN)/usleep.o:          $(UTILS_SRC)/usleep.c
506 $(UTILS_BIN)/visual.o:          $(UTILS_SRC)/visual.c
507 $(UTILS_BIN)/xmu.o:             $(UTILS_SRC)/xmu.c
508 $(UTILS_BIN)/xroger.o:          $(UTILS_SRC)/xroger.c
509 $(UTILS_BIN)/spline.o:          $(UTILS_SRC)/spline.c
510 $(UTILS_BIN)/yarandom.o:        $(UTILS_SRC)/yarandom.c
511
512 $(SAVER_UTIL_OBJS):
513         cd $(UTILS_BIN) ; \
514         $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
515
516 # How we build object files in this directory.
517 .c.o:
518         $(CC) -c $(INCLUDES) $(DEFS)  $(CFLAGS) $(X_CFLAGS) $<
519
520 # subprocs is the only one that takes an extra -D option.
521 subprocs.o: subprocs.c
522         $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) \
523           $(srcdir)/subprocs.c
524
525
526 # How we build the default app-defaults file into the program.
527 #
528 XScreenSaver_ad.h: XScreenSaver.ad
529         $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
530
531 screensaver-properties.desktop: screensaver-properties.desktop.in Makefile
532         @echo generating $@... ;                                        \
533         sed "s%[@]bindir[@]%${bindir}%g"                                \
534           < ${srcdir}/screensaver-properties.desktop.in                 \
535           > $@
536
537 # The executables linked in this directory.
538 #
539 xscreensaver: $(SAVER_OBJS)
540         $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
541
542 xscreensaver-command: $(CMD_OBJS)
543         $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
544
545
546 xscreensaver-demo: @PREFERRED_DEMO_PROGRAM@
547         cp -p @PREFERRED_DEMO_PROGRAM@ $@
548
549 xscreensaver-demo-Xm: $(DEMO_OBJS) $(MOTIF_OBJS)
550         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(MOTIF_OBJS) $(LIBS) $(X_LIBS) \
551         $(MOTIF_LIBS) $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
552
553 xscreensaver-demo-Gtk: $(DEMO_OBJS) $(GTK_OBJS)
554         $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(GTK_OBJS) $(LIBS) $(X_LIBS) \
555         $(GTK_LIBS) $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
556
557
558
559 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
560          subprocs.o setuid.o splash.o prefs.o \
561         $(SAVER_UTIL_OBJS)
562 test-passwd.o: XScreenSaver_ad.h
563
564 tests:: test-passwd
565 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
566         $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
567
568 tests:: test-uid
569 test-uid: test-uid.o
570         $(CC) $(LDFLAGS) -o $@ test-uid.o
571
572 tests:: test-xdpms
573 test-xdpms: test-xdpms.o
574         $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
575
576 tests:: test-grab
577 test-grab: test-grab.o
578         $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
579
580 tests:: test-apm
581 test-apm: test-apm.o
582         $(CC) $(LDFLAGS) -o $@ test-apm.o $(SAVER_LIBS) -lapm
583
584
585 xdpyinfo.o: xdpyinfo.c
586         $(CC) -c $(INCLUDES) -DHAVE_GLX $(CFLAGS) $(X_CFLAGS) \
587           $(srcdir)/xdpyinfo.c
588
589 xdpyinfo: xdpyinfo.o
590         $(CC) $(LDFLAGS) -o $@ xdpyinfo.o \
591                 $(LIBS) $(X_LIBS) @GL_LIBS@ \
592                 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS) -lm
593
594
595 ##############################################################################
596 #
597 # DO NOT DELETE: updated by make distdepend
598 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
599
600 xscreensaver.o: ../config.h
601 xscreensaver.o: $(srcdir)/xscreensaver.h
602 xscreensaver.o: $(srcdir)/prefs.h
603 xscreensaver.o: $(UTILS_SRC)/version.h
604 xscreensaver.o: $(UTILS_SRC)/yarandom.h
605 xscreensaver.o: $(UTILS_SRC)/resources.h
606 xscreensaver.o: $(UTILS_SRC)/visual.h
607 xscreensaver.o: $(UTILS_SRC)/usleep.h
608 xscreensaver.o: XScreenSaver_ad.h
609 windows.o: ../config.h
610 windows.o: $(srcdir)/xscreensaver.h
611 windows.o: $(srcdir)/prefs.h
612 windows.o: $(UTILS_SRC)/visual.h
613 windows.o: $(UTILS_SRC)/fade.h
614 timers.o: ../config.h
615 timers.o: $(srcdir)/xscreensaver.h
616 timers.o: $(srcdir)/prefs.h
617 subprocs.o: ../config.h
618 subprocs.o: $(srcdir)/xscreensaver.h
619 subprocs.o: $(srcdir)/prefs.h
620 subprocs.o: $(UTILS_SRC)/yarandom.h
621 xset.o: ../config.h
622 xset.o: $(srcdir)/xscreensaver.h
623 xset.o: $(srcdir)/prefs.h
624 splash.o: ../config.h
625 splash.o: $(srcdir)/xscreensaver.h
626 splash.o: $(srcdir)/prefs.h
627 splash.o: $(UTILS_SRC)/resources.h
628 setuid.o: ../config.h
629 setuid.o: $(srcdir)/xscreensaver.h
630 setuid.o: $(srcdir)/prefs.h
631 stderr.o: ../config.h
632 stderr.o: $(srcdir)/xscreensaver.h
633 stderr.o: $(srcdir)/prefs.h
634 stderr.o: $(UTILS_SRC)/resources.h
635 stderr.o: $(UTILS_SRC)/visual.h
636 demo-Xm.o: ../config.h
637 demo-Xm.o: $(UTILS_SRC)/version.h
638 demo-Xm.o: $(srcdir)/prefs.h
639 demo-Xm.o: $(UTILS_SRC)/resources.h
640 demo-Xm.o: $(UTILS_SRC)/visual.h
641 demo-Xm.o: $(srcdir)/remote.h
642 demo-Xm.o: $(UTILS_SRC)/usleep.h
643 demo-Xm.o: XScreenSaver_ad.h
644 demo-Xm-widgets.o: ../config.h
645 demo-Gtk.o: ../config.h
646 demo-Gtk.o: $(UTILS_SRC)/version.h
647 demo-Gtk.o: $(srcdir)/prefs.h
648 demo-Gtk.o: $(UTILS_SRC)/resources.h
649 demo-Gtk.o: $(UTILS_SRC)/visual.h
650 demo-Gtk.o: $(srcdir)/remote.h
651 demo-Gtk.o: $(UTILS_SRC)/usleep.h
652 demo-Gtk.o: $(srcdir)/demo-Gtk-widgets.h
653 demo-Gtk.o: XScreenSaver_ad.h
654 demo-Gtk-widgets.o: ../config.h
655 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-stubs.h
656 demo-Gtk-widgets.o: $(srcdir)/demo-Gtk-widgets.h
657 passwd-pwent.o: ../config.h
658 lock.o: ../config.h
659 lock.o: $(srcdir)/xscreensaver.h
660 lock.o: $(srcdir)/prefs.h
661 lock.o: $(UTILS_SRC)/resources.h
662 passwd.o: ../config.h
663 prefs.o: ../config.h
664 prefs.o: $(srcdir)/prefs.h
665 prefs.o: $(UTILS_SRC)/resources.h
666 remote.o: ../config.h
667 remote.o: $(srcdir)/remote.h
668 xscreensaver-command.o: ../config.h
669 xscreensaver-command.o: $(srcdir)/remote.h
670 xscreensaver-command.o: $(UTILS_SRC)/version.h
671 test-passwd.o: ../config.h
672 test-passwd.o: $(srcdir)/xscreensaver.h
673 test-passwd.o: $(srcdir)/prefs.h
674 test-passwd.o: $(UTILS_SRC)/resources.h
675 test-passwd.o: $(UTILS_SRC)/version.h
676 test-passwd.o: $(UTILS_SRC)/visual.h
677 test-passwd.o: XScreenSaver_ad.h
678 test-uid.o: ../config.h
679 test-xdpms.o: ../config.h
680 test-grab.o: ../config.h
681 test-apm.o: ../config.h
682