2 # Makefile for etc subdirectory
7 top_srcdir = @top_srcdir@
12 exec_prefix = @exec_prefix@
17 mailspool = @mailspool@
20 INSTALL_PROGRAM = @INSTALL_PROGRAM@
21 INSTALL_SCRIPT = @INSTALL_SCRIPT@
22 INSTALL_DATA = @INSTALL_DATA@
24 # Path to search for programs to handle MIME
25 # content. Used to create mhn.defaults
26 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
28 # Program used to search path for various programs to
29 # handle MIME content. Used to create mhn.defaults
30 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
36 # static configuration, format, and components files
37 STATIC_FILES = components digestcomps distcomps forwcomps \
38 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
39 mhl.reply rcvdistcomps rcvdistcomps.outbox \
40 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
41 scan.nmh scan.mailx scan.nomime scan.size scan.time \
42 scan.timely scan.unseen
44 # templates and scripts from which non-static files are generated
45 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh sendfiles.in
47 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
48 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
50 GENERATED_BIN_FILES = sendfiles
52 # non-scripts generated using above GENERATED_FILE_SRCs
53 GENERATED_ETC_FILES = mhn.defaults
55 # auxiliary files (included in distribution but not installed)
58 # all non-generated files in this directory are included in the distribution
59 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
61 # ========= DEPENDENCIES FOR BUILDING ==========
63 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
65 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
67 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
69 sendfiles: $(srcdir)/sendfiles.in Makefile
71 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
73 install: install-bin-files install-etc-files
76 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
77 for script in $(GENERATED_BIN_FILES); do \
78 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
82 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
83 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
84 for file in $(STATIC_FILES); do \
85 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
87 for path in $$INSTALL_FILES; do \
88 file=`basename $$path`; \
89 if [ -f "$(DESTDIR)$(etcdir)/$$file" ]; then \
90 if cmp -s "$$path" "$(DESTDIR)$(etcdir)/$$file" ; then \
93 $(INSTALL_DATA) "$$path" "$(DESTDIR)$(etcdir)/$$file.dist"; \
94 echo "$(DESTDIR)$(etcdir)/$$file has local modifications; installing with .dist suffix"; \
97 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
101 uninstall: uninstall-bin-files uninstall-etc-files
104 for script in $(GENERATED_BIN_FILES); do \
105 rm -f $(DESTDIR)$(bindir)/$$script; \
109 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
110 rm -f $(DESTDIR)$(etcdir)/$$file; \
113 # ========== DEPENDENCIES FOR CLEANUP ==========
119 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
126 superclean: realclean
128 # ========== DEPENDENCIES FOR MAINTENANCE ==========
132 Makefile: Makefile.in ../config.status
133 cd .. && ./config.status $(subdir)/$@
135 distdir = ../`cat ../distname`/$(subdir)
137 @echo "Copying distribution files in $(subdir)"
138 @for file in $(DIST); do \
139 cp -p $(srcdir)/$$file $(distdir); \