2 # Makefile for etc subdirectory
7 top_srcdir = @top_srcdir@
12 exec_prefix = @exec_prefix@
18 mailspool = @mailspool@
19 masquerade = @masquerade@
22 INSTALL_PROGRAM = @INSTALL_PROGRAM@
23 INSTALL_SCRIPT = @INSTALL_SCRIPT@
24 INSTALL_DATA = @INSTALL_DATA@
26 # Path to search for programs to handle MIME
27 # content. Used to create mhn.defaults
28 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
30 # Program used to search path for various programs to
31 # handle MIME content. Used to create mhn.defaults
32 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
38 # static configuration, format, and components files
39 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
40 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
41 mhl.reply rcvdistcomps rcvdistcomps.outbox \
42 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
43 scan.default scan.mailx scan.nomime scan.size scan.time \
44 scan.timely scan.unseen
46 # templates and scripts from which non-static files are generated
47 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
49 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
50 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
52 GENERATED_BIN_FILES = sendfiles
54 # non-scripts generated using above GENERATED_FILE_SRCs
55 GENERATED_ETC_FILES = mhn.defaults mts.conf
57 # auxiliary files (included in distribution but not installed)
60 # all non-generated files in this directory are included in the distribution
61 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
63 # ========= DEPENDENCIES FOR BUILDING ==========
65 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
67 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
69 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
71 mts.conf: $(srcdir)/mts.conf.in Makefile
73 $(SED) -e 's,%mts%,$(MTS),' \
74 -e 's,%mailspool%,$(mailspool),' \
75 -e 's,%etcdir%,$(etcdir),' \
76 -e 's,%masquerade%,$(masquerade),' < $(srcdir)/mts.conf.in > $@
78 sendfiles: $(srcdir)/sendfiles.in Makefile
80 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
82 install: install-bin-files install-etc-files
85 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
86 for script in $(GENERATED_BIN_FILES); do \
87 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
91 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
92 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
93 for file in $(STATIC_FILES); do \
94 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
96 for path in $$INSTALL_FILES; do \
97 file=`basename $$path`; \
98 echo "Installing $$file..."; \
99 if [ -f "$(DESTDIR)$(etcdir)/$$file" ]; then \
100 if cmp -s "$$path" "$(DESTDIR)$(etcdir)/$$file"; then \
101 echo "$(DESTDIR)$(etcdir)/$$file unchanged, skipped"; \
103 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
104 echo "INFO: $(DESTDIR)$(etcdir)/$$file installed with .dist extension"; \
107 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
111 uninstall: uninstall-bin-files uninstall-etc-files
114 for script in $(GENERATED_BIN_FILES); do \
115 rm -f $(DESTDIR)$(bindir)/$$script; \
119 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
120 rm -f $(DESTDIR)$(etcdir)/$$file; \
123 # ========== DEPENDENCIES FOR CLEANUP ==========
129 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
136 superclean: realclean
138 # ========== DEPENDENCIES FOR MAINTENANCE ==========
142 Makefile: Makefile.in ../config.status
143 cd .. && ./config.status $(subdir)/$@
145 distdir = ../`cat ../distname`/$(subdir)
147 @echo "Copying distribution files in $(subdir)"
148 @for file in $(DIST); do \
149 cp -p $(srcdir)/$$file $(distdir); \