2 # Makefile for etc subdirectory
9 top_srcdir = @top_srcdir@
14 exec_prefix = @exec_prefix@
19 mailspool = @mailspool@
20 masquerade = @masquerade@
21 smtpservers = @smtpservers@
24 INSTALL_PROGRAM = @INSTALL_PROGRAM@
25 INSTALL_DATA = @INSTALL_DATA@
27 # Path to search for programs to handle MIME
28 # content. Used to create mhn.defaults
29 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
31 # Program used to search path for various programs to
32 # handle MIME content. Used to create mhn.defaults
33 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
39 # static configuration, format, and components files
40 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
41 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
42 mhl.reply rcvdistcomps rcvdistcomps.outbox \
43 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
44 scan.default scan.mailx scan.nomime scan.size scan.time \
45 scan.timely scan.unseen
47 # templates and scripts from which non-static files are generated
48 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
50 # scripts generated using above GENERATED_FILE_SRCs
51 GENERATED_BIN_FILES = sendfiles
53 # non-scripts generated using above GENERATED_FILE_SRCs
54 GENERATED_ETC_FILES = mhn.defaults mts.conf
56 # scripts we need to install (in bin)
57 INSTALL_BIN_FILES = $(GENERATED_BIN_FILES)
59 # non-scripts we need to install (in etc)
60 INSTALL_ETC_FILES = $(STATIC_FILES) $(GENERATED_ETC_FILES)
62 # auxiliary files (included in distribution but not installed)
65 # all non-generated files in this directory are included in the distribution
66 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
68 # ========= DEPENDENCIES FOR BUILDING ==========
70 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
72 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
74 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
76 mts.conf: $(srcdir)/mts.conf.in Makefile
78 $(SED) -e 's,%mailspool%,$(mailspool),' \
79 -e 's,%etcdir%,$(etcdir),' \
80 -e 's,%masquerade%,$(masquerade),' \
81 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
83 sendfiles: $(srcdir)/sendfiles.in Makefile
85 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
87 install: install-bin-files install-etc-files
90 $(top_srcdir)/mkinstalldirs $(bindir)
91 for script in $(INSTALL_BIN_FILES); do \
92 $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
96 $(top_srcdir)/mkinstalldirs $(etcdir)
97 for file in $(INSTALL_ETC_FILES); do \
99 if [ -f $(etcdir)/$$file ]; then \
100 mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
102 $(INSTALL_DATA) $(srcdir)/$$file $(etcdir)/$$file; \
103 if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
104 rm $(etcdir)/$$file.prev; \
108 uninstall: uninstall-bin-files uninstall-etc-files
111 for script in $(INSTALL_BIN_FILES); do \
112 rm -f $(bindir)/$$script; \
116 for file in $(INSTALL_ETC_FILES); do \
117 rm -f $(etcdir)/$$file; \
120 # ========== DEPENDENCIES FOR CLEANUP ==========
126 rm -f $(GENERATED_ETC_FILES)
133 superclean: realclean
135 # ========== DEPENDENCIES FOR MAINTENANCE ==========
139 Makefile: Makefile.in ../config.status
140 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
142 distdir = ../`cat ../distname`/$(subdir)
144 @echo "Copying distribution files in $(subdir)"
145 @for file in $(DIST); do \
146 cp -p $(srcdir)/$$file $(distdir); \