1 # driver/Makefile.in --- xscreensaver, Copyright (c) 1997 Jamie Zawinski.
2 # the `../configure' script generates `driver/Makefile' from this file.
13 exec_prefix = @exec_prefix@
16 man1dir = $(mandir)/man1
23 DEFS2 = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
27 DEPEND_FLAGS = @DEPEND_FLAGS@
28 DEPEND_DEFINES = @DEPEND_DEFINES@
32 SUID_FLAGS = -o root -m 4755
33 INSTALL_PROGRAM = @INSTALL_PROGRAM@
34 INSTALL_SETUID = @INSTALL_SETUID@
35 INSTALL_DATA = @INSTALL_DATA@
36 INSTALL_DIRS = @INSTALL_DIRS@
40 X_PRE_LIBS = @X_PRE_LIBS@
41 X_EXTRA_LIBS = @X_EXTRA_LIBS@
45 # X_LIBS would more properly be called X_LDFLAGS (it contains the -L args.)
46 # X_PRE_LIBS contains extra libraries you have to link against on some systems,
47 # and that must come before -lX11. (e.g., -lSM and -lICE.)
48 # X_EXTRA_LIBS contains extra libraries needed by X that aren't a part of X.
49 # (e.g., -lsocket, -lnsl, etc.)
51 # I think (but am not totally sure) that LIBS is also really "LDFLAGS".
53 # SAVER_LIBS is the link line for "xscreensaver", and
54 # CMD_LIBS is the link line for "xscreensaver-command".
57 AD_DIR = @APPDEFAULTS@
59 UTILS_SRC = $(srcdir)/../utils
62 INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
64 MOTIF_SRCS = dialogs-Xm.c
65 MOTIF_OBJS = dialogs-Xm.o
67 ATHENA_SRCS = dialogs-Xaw.c
68 ATHENA_OBJS = dialogs-Xaw.o
70 PWENT_SRCS = passwd-pwent.c
71 PWENT_OBJS = passwd-pwent.o
73 KERBEROS_SRCS = passwd-kerberos.c
74 KERBEROS_OBJS = passwd-kerberos.o
76 PAM_SRCS = passwd-pam.c
77 PAM_OBJS = passwd-pam.o
79 LOCK_SRCS_1 = lock.c passwd.c
80 LOCK_OBJS_1 = lock.o passwd.o
82 TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c
84 TOOLKIT_SRCS = @TOOLKIT_SRCS@
85 TOOLKIT_OBJS = @TOOLKIT_OBJS@
86 TOOLKIT_LIBS = @TOOLKIT_LIBS@
88 PASSWD_SRCS = @PASSWD_SRCS@
89 PASSWD_OBJS = @PASSWD_OBJS@
90 PASSWD_LIBS = @PASSWD_LIBS@
92 LOCK_SRCS = @LOCK_SRCS@
93 LOCK_OBJS = @LOCK_OBJS@
95 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
97 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
100 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
101 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/spline.c \
102 $(UTILS_SRC)/yarandom.c \
104 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
105 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/spline.o \
106 $(UTILS_BIN)/yarandom.o \
109 SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
110 xset.c splash.c setuid.c stderr.c
111 SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
112 xset.o splash.o setuid.o stderr.o
114 SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
115 $(SAVER_UTIL_SRCS) @XMU_SRCS@
116 SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
117 $(SAVER_UTIL_OBJS) @XMU_OBJS@
119 CMD_SRCS = remote.c xscreensaver-command.c
120 CMD_OBJS = remote.o xscreensaver-command.o
122 DEMO_SRCS_1 = demo.c prefs.c
123 DEMO_OBJS_1 = demo.o prefs.o
125 DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
126 $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
127 DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
128 $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
130 SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
131 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
134 CMD_LIBS = $(LIBS) $(X_LIBS) \
135 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
137 DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
138 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
140 EXES = xscreensaver xscreensaver-command xscreensaver-demo
142 HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
143 MEN = xscreensaver.man xscreensaver-demo.man \
144 xscreensaver-command.man
145 EXTRAS = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
147 VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
148 vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
149 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
151 TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
152 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
153 $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \
154 $(HDRS) $(TEST_SRCS) $(MEN)
159 install: install-program install-ad install-man @INSTALL_PAM@
160 uninstall: uninstall-program uninstall-ad uninstall-man
163 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
164 INSTALL_SETUID='$(INSTALL_SETUID) -s' \
167 install-program: $(EXES)
168 @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
169 @inst="$(INSTALL_PROGRAM)" ; \
170 if [ @NEED_SETUID@ = yes ]; then \
172 if [ "$$me" = root ]; then \
173 inst="$(INSTALL_SETUID)" ; \
177 $$e " Warning: xscreensaver has been compiled with support for shadow" ;\
178 $$e " passwords. If your system actually uses shadow passwords," ;\
179 $$e " then xscreensaver must be installed as a setuid root" ;\
180 $$e " program in order for locking to work. To do this, you" ;\
181 $$e " must run 'make install' as 'root', not as '$$me'." ;\
183 $$e " For now, xscreensaver will be installed non-setuid, which" ;\
184 $$e " means that locking might not work. (Try it and see.)" ;\
188 echo $$inst xscreensaver $(bindir)/xscreensaver ; \
189 $$inst xscreensaver $(bindir)/xscreensaver
190 $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
191 $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
193 install-ad: XScreenSaver.ad
194 @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
195 $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver
199 if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
200 for man in $$men; do \
201 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
202 echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
203 $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
207 @for program in $(EXES); do \
208 echo rm -f $(bindir)/$$program ; \
209 rm -f $(bindir)/$$program ; \
213 rm -f $(AD_DIR)/XScreenSaver
217 for man in $$men; do \
218 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
219 echo rm -f $(man1dir)/$$instname ; \
220 rm -f $(man1dir)/$$instname ; \
224 @src="$(srcdir)/xscreensaver.pam" ; \
225 dest=`sed -n 's/.*PAM_SERVICE_NAME[ ]*"\([^"]*\)".*$$/\1/p' \
228 conf=/etc/pam.conf ; \
230 if [ -d $$dir ] ; then \
231 echo $(INSTALL_DATA) $$src $$dir/$$dest ; \
232 $(INSTALL_DATA) $$src $$dir/$$dest ; \
233 if [ ! -f $$dir/$$dest ]; then \
236 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
237 $$e " Authentication Modules (PAM). However, we were unable to" ;\
238 $$e " install the file $$dir/$$dest. PAM is unlikely to work" ;\
239 $$e " without this file (and old-style password authentication" ;\
240 $$e " will be used instead, which may or may not work.)" ;\
243 elif [ -f $$conf ]; then \
244 if ( grep $$dest $$conf >/dev/null ); then \
249 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
250 $$e " Authentication Modules (PAM). To complete the installation";\
251 $$e " of PAM support, you must add this to the file $$conf:" ;\
253 cat $$src | grep -v '#%' | sed "s/^/ $$dest /" ; \
260 -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
263 -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
265 # Adds all current dependencies to Makefile
266 depend: XScreenSaver_ad.h
267 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
269 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
270 $(SAVER_SRCS) $(CMD_SRCS)
272 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
273 # close. This excludes dependencies on files in /usr/include, etc. It tries
274 # to include only dependencies on files which are themselves a part of this
276 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
277 @echo updating dependencies in `pwd`/Makefile.in... ; \
278 $(DEPEND) -w 0 -f - \
279 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
280 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
281 $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
282 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
284 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
285 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
286 -e 's@\.\./utils@$$(UTILS_SRC)@g' \
287 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
288 -e 's@$$.*\(XScreenSaver_ad\)@\1@g' \
289 -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ; \
291 ) > /tmp/distdepend.$$$$ && \
292 mv Makefile.in Makefile.in.bak && \
293 mv /tmp/distdepend.$$$$ Makefile.in
295 # Updates the version number in the app-defaults file to be in sync with
296 # the version number in version.h. This is so people can tell when they
297 # have a version skew between the app-defaults file and the executable.
299 @S=XScreenSaver.ad.in ; \
300 U=$(UTILS_SRC)/version.h ; \
301 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
302 D=`date '+%d-%b-%y'` ; \
303 echo -n "Updating version number in $$S to $$V $$D... " ; \
305 sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/" \
306 -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9]\)/$$D/" \
308 if cmp -s $$S $$T ; then \
309 echo "unchanged." ; \
317 @for S in $(MEN); do \
318 U=$(UTILS_SRC)/version.h ; \
319 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
320 V="`date '+%d-%b-%y'` ($$V)" ; \
321 echo -n "Updating footer in $$S to \"$$V\"... " ; \
323 sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/" \
325 if cmp -s $$S $$T ; then \
326 echo "unchanged." ; \
336 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
339 @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
343 # Rules for noticing when the objects from the utils directory are out of
344 # date with respect to their sources, and going and building them according
345 # to the rules in their own Makefile...
347 $(UTILS_BIN)/fade.o: $(UTILS_SRC)/fade.c
348 $(UTILS_BIN)/overlay.o: $(UTILS_SRC)/overlay.c
349 $(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
350 $(UTILS_BIN)/usleep.o: $(UTILS_SRC)/usleep.c
351 $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c
352 $(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
353 $(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
354 $(UTILS_BIN)/spline.o: $(UTILS_SRC)/spline.c
355 $(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
359 $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
361 # How we build object files in this directory.
363 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
365 # subprocs is the only one that takes an extra -D option.
366 subprocs.o: subprocs.c
367 $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
370 # How we build the default app-defaults file into the program.
372 XScreenSaver_ad.h: XScreenSaver.ad
373 $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
375 # The executables linked in this directory.
377 xscreensaver: $(SAVER_OBJS)
378 $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
380 xscreensaver-command: $(CMD_OBJS)
381 $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
383 xscreensaver-demo: $(DEMO_OBJS)
384 $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
388 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
389 subprocs.o setuid.o splash.o prefs.o \
391 test-passwd.o: XScreenSaver_ad.h
393 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
394 $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
397 $(CC) $(LDFLAGS) -o $@ test-uid.o
399 test-xdpms: test-xdpms.o
400 $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
403 # This kludge is so that I can build/test the Athena version of the
404 # xscreensaver-demo program without having to re-run configure.
405 # Normally it builds it with Motif if possible; this lets me build
408 xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
409 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
410 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
411 $(LIBS) $(X_LIBS) -lXaw \
412 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
413 xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
414 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
415 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
416 $(LIBS) $(X_LIBS) -lXaw3d \
417 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
418 demo-Xaw.o: demo.c XScreenSaver_ad.h
419 $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
420 $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
424 ##############################################################################
426 # DO NOT DELETE: updated by make distdepend
427 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
429 xscreensaver.o: ../config.h
430 xscreensaver.o: $(srcdir)/xscreensaver.h
431 xscreensaver.o: $(srcdir)/prefs.h
432 xscreensaver.o: $(UTILS_SRC)/version.h
433 xscreensaver.o: $(UTILS_SRC)/yarandom.h
434 xscreensaver.o: $(UTILS_SRC)/resources.h
435 xscreensaver.o: $(UTILS_SRC)/visual.h
436 xscreensaver.o: $(UTILS_SRC)/usleep.h
437 xscreensaver.o: XScreenSaver_ad.h
438 windows.o: ../config.h
439 windows.o: $(srcdir)/xscreensaver.h
440 windows.o: $(srcdir)/prefs.h
441 windows.o: $(UTILS_SRC)/visual.h
442 windows.o: $(UTILS_SRC)/fade.h
443 timers.o: ../config.h
444 timers.o: $(srcdir)/xscreensaver.h
445 timers.o: $(srcdir)/prefs.h
446 subprocs.o: ../config.h
447 subprocs.o: $(srcdir)/xscreensaver.h
448 subprocs.o: $(srcdir)/prefs.h
449 subprocs.o: $(UTILS_SRC)/yarandom.h
451 xset.o: $(srcdir)/xscreensaver.h
452 xset.o: $(srcdir)/prefs.h
453 splash.o: ../config.h
454 splash.o: $(srcdir)/xscreensaver.h
455 splash.o: $(srcdir)/prefs.h
456 splash.o: $(UTILS_SRC)/resources.h
457 setuid.o: ../config.h
458 setuid.o: $(srcdir)/xscreensaver.h
459 setuid.o: $(srcdir)/prefs.h
460 stderr.o: ../config.h
461 stderr.o: $(srcdir)/xscreensaver.h
462 stderr.o: $(srcdir)/prefs.h
463 stderr.o: $(UTILS_SRC)/resources.h
464 stderr.o: $(UTILS_SRC)/visual.h
465 dialogs-Xm.o: ../config.h
466 dialogs-Xm.o: $(UTILS_SRC)/visual.h
467 dialogs-Xaw.o: ../config.h
468 dialogs-Xaw.o: $(UTILS_SRC)/visual.h
469 passwd-pwent.o: ../config.h
471 lock.o: $(srcdir)/xscreensaver.h
472 lock.o: $(srcdir)/prefs.h
473 lock.o: $(UTILS_SRC)/resources.h
474 passwd.o: ../config.h
476 demo.o: $(UTILS_SRC)/version.h
477 demo.o: $(srcdir)/prefs.h
478 demo.o: $(UTILS_SRC)/resources.h
479 demo.o: $(UTILS_SRC)/visual.h
480 demo.o: $(srcdir)/remote.h
481 demo.o: $(UTILS_SRC)/usleep.h
482 demo.o: XScreenSaver_ad.h
484 prefs.o: $(srcdir)/prefs.h
485 prefs.o: $(UTILS_SRC)/resources.h
486 remote.o: ../config.h
487 remote.o: $(srcdir)/remote.h
488 xscreensaver-command.o: ../config.h
489 xscreensaver-command.o: $(srcdir)/remote.h
490 xscreensaver-command.o: $(UTILS_SRC)/version.h
491 test-passwd.o: ../config.h
492 test-passwd.o: $(srcdir)/xscreensaver.h
493 test-passwd.o: $(srcdir)/prefs.h
494 test-passwd.o: $(UTILS_SRC)/resources.h
495 test-passwd.o: $(UTILS_SRC)/version.h
496 test-passwd.o: $(UTILS_SRC)/visual.h
497 test-passwd.o: XScreenSaver_ad.h
498 test-uid.o: ../config.h
499 test-xdpms.o: ../config.h