]> diplodocus.org Git - nmh/blob - etc/Makefile.in
We're not using the .Bu macro anymore.
[nmh] / etc / Makefile.in
1 #
2 # Makefile for etc subdirectory
3 #
4 # $Id$
5 #
6
7 SHELL = /bin/sh
8
9 top_srcdir = @top_srcdir@
10 srcdir = @srcdir@
11 VPATH = @srcdir@
12
13 prefix = @prefix@
14 exec_prefix = @exec_prefix@
15 bindir = @bindir@
16 libdir = @libdir@
17 etcdir = @sysconfdir@
18
19 MTS = @MTS@
20 mailspool = @mailspool@
21 masquerade = @masquerade@
22 smtpservers = @smtpservers@
23
24 INSTALL = @INSTALL@
25 INSTALL_PROGRAM = @INSTALL_PROGRAM@
26 INSTALL_SCRIPT = @INSTALL_SCRIPT@
27 INSTALL_DATA = @INSTALL_DATA@
28
29 # Path to search for programs to handle MIME
30 # content. Used to create mhn.defaults
31 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
32
33 # Program used to search path for various programs to
34 # handle MIME content. Used to create mhn.defaults
35 MHNSEARCHPROG = $(srcdir)/mhn.find.sh
36
37 SED = sed
38
39 .SUFFIXES:
40
41 # static configuration, format, and components files
42 STATIC_FILES = MailAliases components digestcomps distcomps forwcomps \
43 mhl.body mhl.digest mhl.format mhl.forward mhl.headers \
44 mhl.reply rcvdistcomps rcvdistcomps.outbox \
45 replcomps replgroupcomps scan.MMDDYY scan.YYYYMMDD \
46 scan.default scan.mailx scan.nomime scan.size scan.time \
47 scan.timely scan.unseen
48
49 # templates and scripts from which non-static files are generated
50 GENERATED_FILE_SRCS = mhn.defaults.sh mhn.find.sh mts.conf.in sendfiles.in
51
52 # scripts generated using above GENERATED_FILE_SRCs; don't add binaries
53 # to this list, as they'll get installed with INSTALL_SCRIPT and won't
54 # be stripped.
55 GENERATED_BIN_FILES = sendfiles
56
57 # non-scripts generated using above GENERATED_FILE_SRCs
58 GENERATED_ETC_FILES = mhn.defaults mts.conf
59
60 # auxiliary files (included in distribution but not installed)
61 AUX = Makefile.in
62
63 # all non-generated files in this directory are included in the distribution
64 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
65
66 # ========= DEPENDENCIES FOR BUILDING ==========
67
68 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
69
70 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
71 rm -f $@
72 $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
73
74 mts.conf: $(srcdir)/mts.conf.in Makefile
75 rm -f $@
76 $(SED) -e 's,%mts%,$(MTS),' \
77 -e 's,%mailspool%,$(mailspool),' \
78 -e 's,%etcdir%,$(etcdir),' \
79 -e 's,%masquerade%,$(masquerade),' \
80 -e 's,%smtpservers%,$(smtpservers),' < $(srcdir)/mts.conf.in > $@
81
82 sendfiles: $(srcdir)/sendfiles.in Makefile
83 rm -f $@
84 $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
85
86 install: install-bin-files install-etc-files
87
88 install-bin-files:
89 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
90 for script in $(GENERATED_BIN_FILES); do \
91 $(INSTALL_SCRIPT) $$script $(DESTDIR)$(bindir)/$$script; \
92 done
93
94 install-etc-files:
95 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(etcdir)
96 INSTALL_FILES="$(GENERATED_ETC_FILES)"; \
97 for file in $(STATIC_FILES); do \
98 INSTALL_FILES="$$INSTALL_FILES $(srcdir)/$$file"; \
99 done; \
100 for path in $$INSTALL_FILES; do \
101 file=`basename $$path`; \
102 echo "Installing $$file..."; \
103 if [ -f $(DESTDIR)$(etcdir)/$$file ]; then \
104 mv $(DESTDIR)$(etcdir)/$$file $(DESTDIR)$(etcdir)/$$file.prev; \
105 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
106 if diff $(DESTDIR)$(etcdir)/$$file.prev $(DESTDIR)$(etcdir)/$$file; then \
107 rm $(DESTDIR)$(etcdir)/$$file.prev; \
108 else \
109 echo; \
110 echo " Previous version of $$file saved as $$file.prev due\c";\
111 echo " to diffs."; \
112 echo " Please merge any local config changes into the new\c"; \
113 echo " $$file."; \
114 echo; \
115 fi; \
116 else \
117 $(INSTALL_DATA) $$path $(DESTDIR)$(etcdir)/$$file; \
118 fi; \
119 done
120
121 uninstall: uninstall-bin-files uninstall-etc-files
122
123 uninstall-bin-files:
124 for script in $(GENERATED_BIN_FILES); do \
125 rm -f $(DESTDIR)$(bindir)/$$script; \
126 done
127
128 uninstall-etc-files:
129 for file in $(STATIC_FILES) $(GENERATED_ETC_FILES); do \
130 rm -f $(DESTDIR)$(etcdir)/$$file; \
131 done
132
133 # ========== DEPENDENCIES FOR CLEANUP ==========
134
135 mostlyclean:
136 rm -f *~
137
138 clean: mostlyclean
139 rm -f $(GENERATED_ETC_FILES) $(GENERATED_BIN_FILES)
140
141 distclean: clean
142 rm -f Makefile
143
144 realclean: distclean
145
146 superclean: realclean
147
148 # ========== DEPENDENCIES FOR MAINTENANCE ==========
149
150 subdir = etc
151
152 Makefile: Makefile.in ../config.status
153 cd .. && ./config.status $(subdir)/$@
154
155 distdir = ../`cat ../distname`/$(subdir)
156 nmhdist: $(DIST)
157 @echo "Copying distribution files in $(subdir)"
158 @for file in $(DIST); do \
159 cp -p $(srcdir)/$$file $(distdir); \
160 done
161