2 # Makefile for etc subdirectory
9 top_srcdir = @top_srcdir@
14 exec_prefix = @exec_prefix@
20 mailspool = @mailspool@
21 masquerade = @masquerade@
22 smtpservers = @smtpservers@
25 INSTALL_PROGRAM = @INSTALL_PROGRAM@
26 INSTALL_DATA = @INSTALL_DATA@
28 # Path to search for programs to handle MIME
29 # content. Used to create mhn.defaults
30 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
32 # Program used to search path for various programs to
33 # handle MIME content. Used to create mhn.defaults
34 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
40 # static configuration, format, and components files
41 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
42 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
43 mhl.reply rcvdistcomps rcvdistcomps.outbox \
44 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
45 scan.default scan.mailx scan.nomime scan.size scan.time \
46 scan.timely scan.unseen
48 # templates and scripts from which non-static files are generated
49 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
51 # scripts generated using above GENERATED_FILE_SRCs
52 GENERATED_BIN_FILES = sendfiles
54 # non-scripts generated using above GENERATED_FILE_SRCs
55 GENERATED_ETC_FILES = mhn.defaults mts.conf
57 # scripts we need to install (in bin)
58 INSTALL_BIN_FILES = $(GENERATED_BIN_FILES)
60 # non-scripts we need to install (in etc)
61 INSTALL_ETC_FILES = $(STATIC_FILES) $(GENERATED_ETC_FILES)
63 # auxiliary files (included in distribution but not installed)
66 # all non-generated files in this directory are included in the distribution
67 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
69 # ========= DEPENDENCIES FOR BUILDING ==========
71 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
73 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
75 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
77 mts.conf: $(srcdir)/mts.conf.in Makefile
79 $(SED) -e 's,%mts%,$(MTS),' \
80 -e 's,%mailspool%,$(mailspool),' \
81 -e 's,%etcdir%,$(etcdir),' \
82 -e 's,%masquerade%,$(masquerade),' \
83 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
85 sendfiles: $(srcdir)/sendfiles.in Makefile
87 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
89 install: install-bin-files install-etc-files
92 $(top_srcdir)/mkinstalldirs $(bindir)
93 for script in $(INSTALL_BIN_FILES); do \
94 $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
98 $(top_srcdir)/mkinstalldirs $(etcdir)
99 for file in $(INSTALL_ETC_FILES); do \
101 if [ -f $(etcdir)/$$file ]; then \
102 mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
104 $(INSTALL_DATA) $(srcdir)/$$file $(etcdir)/$$file; \
105 if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
106 rm $(etcdir)/$$file.prev; \
110 uninstall: uninstall-bin-files uninstall-etc-files
113 for script in $(INSTALL_BIN_FILES); do \
114 rm -f $(bindir)/$$script; \
118 for file in $(INSTALL_ETC_FILES); do \
119 rm -f $(etcdir)/$$file; \
122 # ========== DEPENDENCIES FOR CLEANUP ==========
128 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
135 superclean: realclean
137 # ========== DEPENDENCIES FOR MAINTENANCE ==========
141 Makefile: Makefile.in ../config.status
142 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
144 distdir = ../`cat ../distname`/$(subdir)
146 @echo "Copying distribution files in $(subdir)"
147 @for file in $(DIST); do \
148 cp -p $(srcdir)/$$file $(distdir); \