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 PAM_CONF = /etc/pam.conf
61 UTILS_SRC = $(srcdir)/../utils
64 INCLUDES = -I. -I$(srcdir) -I$(UTILS_SRC) -I.. @INCLUDES@
66 MOTIF_SRCS = dialogs-Xm.c
67 MOTIF_OBJS = dialogs-Xm.o
69 ATHENA_SRCS = dialogs-Xaw.c
70 ATHENA_OBJS = dialogs-Xaw.o
72 PWENT_SRCS = passwd-pwent.c
73 PWENT_OBJS = passwd-pwent.o
75 KERBEROS_SRCS = passwd-kerberos.c
76 KERBEROS_OBJS = passwd-kerberos.o
78 PAM_SRCS = passwd-pam.c
79 PAM_OBJS = passwd-pam.o
81 LOCK_SRCS_1 = lock.c passwd.c
82 LOCK_OBJS_1 = lock.o passwd.o
84 TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c
86 TOOLKIT_SRCS = @TOOLKIT_SRCS@
87 TOOLKIT_OBJS = @TOOLKIT_OBJS@
88 TOOLKIT_LIBS = @TOOLKIT_LIBS@
90 PASSWD_SRCS = @PASSWD_SRCS@
91 PASSWD_OBJS = @PASSWD_OBJS@
92 PASSWD_LIBS = @PASSWD_LIBS@
94 LOCK_SRCS = @LOCK_SRCS@
95 LOCK_OBJS = @LOCK_OBJS@
97 DEMO_UTIL_SRCS = $(UTILS_SRC)/resources.c $(UTILS_SRC)/usleep.c \
99 DEMO_UTIL_OBJS = $(UTILS_BIN)/resources.o $(UTILS_BIN)/usleep.o \
100 $(UTILS_BIN)/visual.o
102 SAVER_UTIL_SRCS = $(UTILS_SRC)/fade.c $(UTILS_SRC)/overlay.c \
103 $(UTILS_SRC)/xroger.c $(UTILS_SRC)/spline.c \
104 $(UTILS_SRC)/yarandom.c \
106 SAVER_UTIL_OBJS = $(UTILS_BIN)/fade.o $(UTILS_BIN)/overlay.o \
107 $(UTILS_BIN)/xroger.o $(UTILS_BIN)/spline.o \
108 $(UTILS_BIN)/yarandom.o \
111 SAVER_SRCS_1 = xscreensaver.c windows.c timers.c subprocs.c \
112 xset.c splash.c setuid.c stderr.c
113 SAVER_OBJS_1 = xscreensaver.o windows.o timers.o subprocs.o \
114 xset.o splash.o setuid.o stderr.o
116 SAVER_SRCS = $(SAVER_SRCS_1) prefs.c $(LOCK_SRCS) \
117 $(SAVER_UTIL_SRCS) @XMU_SRCS@
118 SAVER_OBJS = $(SAVER_OBJS_1) prefs.o $(LOCK_OBJS) \
119 $(SAVER_UTIL_OBJS) @XMU_OBJS@
121 CMD_SRCS = remote.c xscreensaver-command.c
122 CMD_OBJS = remote.o xscreensaver-command.o
124 DEMO_SRCS_1 = demo.c prefs.c
125 DEMO_OBJS_1 = demo.o prefs.o
127 DEMO_SRCS = $(DEMO_SRCS_1) remote.c \
128 $(TOOLKIT_SRCS) $(DEMO_UTIL_SRCS)
129 DEMO_OBJS = $(DEMO_OBJS_1) remote.o \
130 $(TOOLKIT_OBJS) $(DEMO_UTIL_OBJS)
132 SAVER_LIBS = $(LIBS) $(X_LIBS) @SAVER_LIBS@ \
133 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS) \
136 CMD_LIBS = $(LIBS) $(X_LIBS) \
137 $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
139 DEMO_LIBS = $(LIBS) $(X_LIBS) $(TOOLKIT_LIBS) \
140 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
142 EXES = xscreensaver xscreensaver-command xscreensaver-demo
144 HDRS = XScreenSaver_ad.h xscreensaver.h prefs.h remote.h
145 MEN = xscreensaver.man xscreensaver-demo.man \
146 xscreensaver-command.man
147 EXTRAS = README Makefile.in XScreenSaver.ad.in xscreensaver.pam \
149 VMSFILES = compile_axp.com compile_decc.com link_axp.com link_decc.com \
150 vms-getpwnam.c vms-pwd.h vms-hpwd.c vms-validate.c \
151 vms_axp.opt vms_axp_12.opt vms_decc.opt vms_decc_12.opt
153 TARFILES = $(EXTRAS) $(VMSFILES) $(SAVER_SRCS_1) \
154 $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) $(KERBEROS_SRCS) \
155 $(PAM_SRCS) $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) \
156 $(HDRS) $(TEST_SRCS) $(MEN)
161 install: install-program install-ad install-man @INSTALL_PAM@
162 uninstall: uninstall-program uninstall-ad uninstall-man
165 $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
166 INSTALL_SETUID='$(INSTALL_SETUID) -s' \
169 install-program: $(EXES)
170 @if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi
171 @inst="$(INSTALL_PROGRAM)" ; \
172 if [ @NEED_SETUID@ = yes ]; then \
174 if [ "$$me" = root ]; then \
175 inst="$(INSTALL_SETUID)" ; \
179 $$e " Warning: xscreensaver has been compiled with support for shadow" ;\
180 $$e " passwords. If your system actually uses shadow passwords," ;\
181 $$e " then xscreensaver must be installed as a setuid root" ;\
182 $$e " program in order for locking to work. To do this, you" ;\
183 $$e " must run 'make install' as 'root', not as '$$me'." ;\
185 $$e " For now, xscreensaver will be installed non-setuid, which" ;\
186 $$e " means that locking might not work. (Try it and see.)" ;\
190 echo $$inst xscreensaver $(bindir)/xscreensaver ; \
191 $$inst xscreensaver $(bindir)/xscreensaver
192 $(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
193 $(INSTALL_PROGRAM) xscreensaver-demo $(bindir)/xscreensaver-demo
195 install-ad: XScreenSaver.ad
196 @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi
197 $(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver
201 if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
202 for man in $$men; do \
203 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
204 echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
205 $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
209 @for program in $(EXES); do \
210 echo rm -f $(bindir)/$$program ; \
211 rm -f $(bindir)/$$program ; \
215 rm -f $(AD_DIR)/XScreenSaver
219 for man in $$men; do \
220 instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
221 echo rm -f $(man1dir)/$$instname ; \
222 rm -f $(man1dir)/$$instname ; \
226 @src="$(srcdir)/xscreensaver.pam" ; \
227 dest=`sed -n 's/.*PAM_SERVICE_NAME[ ]*"\([^"]*\)".*$$/\1/p' \
230 conf="$(PAM_CONF)" ; \
232 if [ -d $$dir ] ; then \
233 echo $(INSTALL_DATA) $$src $$dir/$$dest ; \
234 $(INSTALL_DATA) $$src $$dir/$$dest ; \
235 if [ ! -f $$dir/$$dest ]; then \
238 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
239 $$e " Authentication Modules (PAM). However, we were unable to" ;\
240 $$e " install the file $$dir/$$dest. PAM is unlikely to work" ;\
241 $$e " without this file (and old-style password authentication" ;\
242 $$e " will be used instead, which may or may not work.)" ;\
245 elif [ -f $$conf ]; then \
246 if ( grep $$dest $$conf >/dev/null ); then \
251 $$e " Warning: xscreensaver has been compiled with support for Pluggable" ;\
252 $$e " Authentication Modules (PAM). To complete the installation";\
253 $$e " of PAM support, you must add this to the file $$conf:" ;\
255 cat $$src | grep -v '#%' | sed "s/^/ $$dest /" ; \
262 -rm -f *.o a.out core $(EXES) XScreenSaver_ad.h
265 -rm -f Makefile XScreenSaver.ad TAGS *~ "#"*
267 # Adds all current dependencies to Makefile
268 depend: XScreenSaver_ad.h
269 $(DEPEND) -s '# DO NOT DELETE: updated by make depend' \
271 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
272 $(SAVER_SRCS) $(CMD_SRCS)
274 # Adds some dependencies to Makefile.in -- not totally accurate, but pretty
275 # close. This excludes dependencies on files in /usr/include, etc. It tries
276 # to include only dependencies on files which are themselves a part of this
278 distdepend: update_ad_version update_man_version XScreenSaver_ad.h
279 @echo updating dependencies in `pwd`/Makefile.in... ; \
280 $(DEPEND) -w 0 -f - \
281 -s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
282 $(INCLUDES) $(DEFS) $(DEPEND_DEFINES) $(CFLAGS) $(X_CFLAGS) -- \
283 $(SAVER_SRCS_1) $(MOTIF_SRCS) $(ATHENA_SRCS) $(PWENT_SRCS) \
284 $(LOCK_SRCS_1) $(DEMO_SRCS_1) $(CMD_SRCS) $(TEST_SRCS) | \
286 awk '/^# .*Makefile.in ---/,/^# DO .*distdepend/' < Makefile.in ; \
287 sed -e 's@ \./@ @g;s@ /[^ ]*@@g;/^.*:$$/d' \
288 -e 's@\.\./utils@$$(UTILS_SRC)@g' \
289 -e 's@ \([^$$]\)@ $$(srcdir)/\1@g' \
290 -e 's@$$.*\(XScreenSaver_ad\)@\1@g' \
291 -e 's@ $$(srcdir)/\(.*config\.h\)@ \1@g' ; \
293 ) > /tmp/distdepend.$$$$ && \
294 mv Makefile.in Makefile.in.bak && \
295 mv /tmp/distdepend.$$$$ Makefile.in
297 # Updates the version number in the app-defaults file to be in sync with
298 # the version number in version.h. This is so people can tell when they
299 # have a version skew between the app-defaults file and the executable.
301 @S=XScreenSaver.ad.in ; \
302 U=$(UTILS_SRC)/version.h ; \
303 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
304 D=`date '+%d-%b-%y'` ; \
305 echo -n "Updating version number in $$S to $$V $$D... " ; \
307 sed -e "s/\(.*version \)[0-9][0-9]*\.[0-9]*\(.*\)/\1$$V\2/" \
308 -e "s/\([0-9][0-9]-[A-Z][a-z][a-z]-[0-9][0-9]\)/$$D/" \
310 if cmp -s $$S $$T ; then \
311 echo "unchanged." ; \
319 @for S in $(MEN); do \
320 U=$(UTILS_SRC)/version.h ; \
321 V=`sed -n 's/.*\([0-9][0-9]*\.[0-9]*\).*/\1/p' < $$U` ; \
322 V="`date '+%d-%b-%y'` ($$V)" ; \
323 echo -n "Updating footer in $$S to \"$$V\"... " ; \
325 sed "s/^\(\.TH[^\"]*\)\"[^\"]*\"\(.*\)/\1\"$$V\"\2/" \
327 if cmp -s $$S $$T ; then \
328 echo "unchanged." ; \
338 find $(srcdir) -name '*.[chly]' -print | xargs etags -a
341 @$(MAKE) XScreenSaver_ad.h 2>&1 >&- /dev/null
345 # Rules for noticing when the objects from the utils directory are out of
346 # date with respect to their sources, and going and building them according
347 # to the rules in their own Makefile...
349 $(UTILS_BIN)/fade.o: $(UTILS_SRC)/fade.c
350 $(UTILS_BIN)/overlay.o: $(UTILS_SRC)/overlay.c
351 $(UTILS_BIN)/resources.o: $(UTILS_SRC)/resources.c
352 $(UTILS_BIN)/usleep.o: $(UTILS_SRC)/usleep.c
353 $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c
354 $(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
355 $(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
356 $(UTILS_BIN)/spline.o: $(UTILS_SRC)/spline.c
357 $(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
361 $(MAKE) $(@F) CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
363 # How we build object files in this directory.
365 $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
367 # subprocs is the only one that takes an extra -D option.
368 subprocs.o: subprocs.c
369 $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
372 # How we build the default app-defaults file into the program.
374 XScreenSaver_ad.h: XScreenSaver.ad
375 $(SHELL) $(UTILS_SRC)/ad2c XScreenSaver.ad > XScreenSaver_ad.h
377 # The executables linked in this directory.
379 xscreensaver: $(SAVER_OBJS)
380 $(CC) $(LDFLAGS) -o $@ $(SAVER_OBJS) $(SAVER_LIBS)
382 xscreensaver-command: $(CMD_OBJS)
383 $(CC) $(LDFLAGS) -o $@ $(CMD_OBJS) $(CMD_LIBS)
385 xscreensaver-demo: $(DEMO_OBJS)
386 $(CC) $(LDFLAGS) -o $@ $(DEMO_OBJS) $(DEMO_LIBS)
390 TEST_PASSWD_OBJS = test-passwd.o $(LOCK_OBJS_1) $(PASSWD_OBJS) \
391 subprocs.o setuid.o splash.o prefs.o \
393 test-passwd.o: XScreenSaver_ad.h
395 test-passwd: $(TEST_PASSWD_OBJS) XScreenSaver_ad.h
396 $(CC) $(LDFLAGS) -o $@ $(TEST_PASSWD_OBJS) $(SAVER_LIBS)
399 $(CC) $(LDFLAGS) -o $@ test-uid.o
401 test-xdpms: test-xdpms.o
402 $(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
405 # This kludge is so that I can build/test the Athena version of the
406 # xscreensaver-demo program without having to re-run configure.
407 # Normally it builds it with Motif if possible; this lets me build
410 xscreensaver-demo-Xaw: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
411 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
412 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
413 $(LIBS) $(X_LIBS) -lXaw \
414 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
415 xscreensaver-demo-Xaw3d: $(ATHENA_OBJS) demo-Xaw.o $(DEMO_OBJS)
416 $(CC) $(LDFLAGS) -o $@ demo-Xaw.o prefs.o remote.o \
417 $(ATHENA_OBJS) $(DEMO_UTIL_OBJS) \
418 $(LIBS) $(X_LIBS) -lXaw3d \
419 $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
420 demo-Xaw.o: demo.c XScreenSaver_ad.h
421 $(CC) -o $@ -c -DHAVE_ATHENA_KLUDGE \
422 $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
426 ##############################################################################
428 # DO NOT DELETE: updated by make distdepend
429 # $(srcdir)/DO $(srcdir)/NOT $(srcdir)/DELETE: $(srcdir)/updated $(srcdir)/by $(srcdir)/make $(srcdir)/distdepend
431 xscreensaver.o: ../config.h
432 xscreensaver.o: $(srcdir)/xscreensaver.h
433 xscreensaver.o: $(srcdir)/prefs.h
434 xscreensaver.o: $(UTILS_SRC)/version.h
435 xscreensaver.o: $(UTILS_SRC)/yarandom.h
436 xscreensaver.o: $(UTILS_SRC)/resources.h
437 xscreensaver.o: $(UTILS_SRC)/visual.h
438 xscreensaver.o: $(UTILS_SRC)/usleep.h
439 xscreensaver.o: XScreenSaver_ad.h
440 windows.o: ../config.h
441 windows.o: $(srcdir)/xscreensaver.h
442 windows.o: $(srcdir)/prefs.h
443 windows.o: $(UTILS_SRC)/visual.h
444 windows.o: $(UTILS_SRC)/fade.h
445 timers.o: ../config.h
446 timers.o: $(srcdir)/xscreensaver.h
447 timers.o: $(srcdir)/prefs.h
448 subprocs.o: ../config.h
449 subprocs.o: $(srcdir)/xscreensaver.h
450 subprocs.o: $(srcdir)/prefs.h
451 subprocs.o: $(UTILS_SRC)/yarandom.h
453 xset.o: $(srcdir)/xscreensaver.h
454 xset.o: $(srcdir)/prefs.h
455 splash.o: ../config.h
456 splash.o: $(srcdir)/xscreensaver.h
457 splash.o: $(srcdir)/prefs.h
458 splash.o: $(UTILS_SRC)/resources.h
459 setuid.o: ../config.h
460 setuid.o: $(srcdir)/xscreensaver.h
461 setuid.o: $(srcdir)/prefs.h
462 stderr.o: ../config.h
463 stderr.o: $(srcdir)/xscreensaver.h
464 stderr.o: $(srcdir)/prefs.h
465 stderr.o: $(UTILS_SRC)/resources.h
466 stderr.o: $(UTILS_SRC)/visual.h
467 dialogs-Xm.o: ../config.h
468 dialogs-Xm.o: $(UTILS_SRC)/visual.h
469 dialogs-Xaw.o: ../config.h
470 dialogs-Xaw.o: $(UTILS_SRC)/visual.h
471 passwd-pwent.o: ../config.h
473 lock.o: $(srcdir)/xscreensaver.h
474 lock.o: $(srcdir)/prefs.h
475 lock.o: $(UTILS_SRC)/resources.h
476 passwd.o: ../config.h
478 demo.o: $(UTILS_SRC)/version.h
479 demo.o: $(srcdir)/prefs.h
480 demo.o: $(UTILS_SRC)/resources.h
481 demo.o: $(UTILS_SRC)/visual.h
482 demo.o: $(srcdir)/remote.h
483 demo.o: $(UTILS_SRC)/usleep.h
484 demo.o: XScreenSaver_ad.h
486 prefs.o: $(srcdir)/prefs.h
487 prefs.o: $(UTILS_SRC)/resources.h
488 remote.o: ../config.h
489 remote.o: $(srcdir)/remote.h
490 xscreensaver-command.o: ../config.h
491 xscreensaver-command.o: $(srcdir)/remote.h
492 xscreensaver-command.o: $(UTILS_SRC)/version.h
493 test-passwd.o: ../config.h
494 test-passwd.o: $(srcdir)/xscreensaver.h
495 test-passwd.o: $(srcdir)/prefs.h
496 test-passwd.o: $(UTILS_SRC)/resources.h
497 test-passwd.o: $(UTILS_SRC)/version.h
498 test-passwd.o: $(UTILS_SRC)/visual.h
499 test-passwd.o: XScreenSaver_ad.h
500 test-uid.o: ../config.h
501 test-xdpms.o: ../config.h