eec41463914380e5a75e8604b56dec2ff9301cd7
[mmh] / 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 mailspool   = @mailspool@
20 masquerade  = @masquerade@
21 smtpservers = @smtpservers@
22
23 INSTALL         = @INSTALL@
24 INSTALL_PROGRAM = @INSTALL_PROGRAM@
25 INSTALL_DATA    = @INSTALL_DATA@
26
27 # Path to search for programs to handle MIME
28 # content.  Used to create mhn.defaults
29 MHNSEARCHPATH = "$(PATH):/usr/demo/SOUND"
30
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
34
35 SED = sed
36
37 .SUFFIXES:
38
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
46
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
49
50 # scripts generated using above GENERATED_FILE_SRCs
51 GENERATED_BIN_FILES = sendfiles
52
53 # non-scripts generated using above GENERATED_FILE_SRCs
54 GENERATED_ETC_FILES = mhn.defaults mts.conf
55
56 # scripts we need to install (in bin)
57 INSTALL_BIN_FILES = $(GENERATED_BIN_FILES)
58
59 # non-scripts we need to install (in etc)
60 INSTALL_ETC_FILES = $(STATIC_FILES) $(GENERATED_ETC_FILES)
61
62 # auxiliary files (included in distribution but not installed)
63 AUX = Makefile.in
64
65 # all non-generated files in this directory are included in the distribution
66 DIST = $(STATIC_FILES) $(GENERATED_FILE_SRCS) $(AUX)
67
68 # ========= DEPENDENCIES FOR BUILDING ==========
69
70 all: $(GENERATED_BIN_FILES) $(GENERATED_ETC_FILES)
71
72 mhn.defaults: $(srcdir)/mhn.defaults.sh $(MHNSEARCHPROG)
73         rm -f $@
74         $(srcdir)/mhn.defaults.sh $(MHNSEARCHPATH) $(MHNSEARCHPROG) > $@
75
76 mts.conf: $(srcdir)/mts.conf.in Makefile
77         rm -f $@
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 > $@
82
83 sendfiles: $(srcdir)/sendfiles.in Makefile
84         rm -f $@
85         $(SED) -e 's,%libdir%,$(libdir),' < $(srcdir)/sendfiles.in > $@
86
87 install: install-bin-files install-etc-files
88
89 install-bin-files:
90         $(top_srcdir)/mkinstalldirs $(bindir)
91         for script in $(INSTALL_BIN_FILES); do \
92           $(INSTALL_PROGRAM) $(srcdir)/$$script $(bindir)/$$script; \
93         done
94
95 install-etc-files:
96         $(top_srcdir)/mkinstalldirs $(etcdir)
97         for file in $(INSTALL_ETC_FILES); do \
98           echo $$file; \
99           if [ -f $(etcdir)/$$file ]; then \
100             mv $(etcdir)/$$file $(etcdir)/$$file.prev; \
101           fi; \
102           $(INSTALL_DATA) $(srcdir)/$$file $(etcdir)/$$file; \
103           if diff $(etcdir)/$$file.prev $(etcdir)/$$file; then \
104             rm $(etcdir)/$$file.prev; \
105           fi; \
106         done
107
108 uninstall: uninstall-bin-files uninstall-etc-files
109
110 uninstall-bin-files:
111         for script in $(INSTALL_BIN_FILES); do \
112           rm -f $(bindir)/$$script; \
113         done
114
115 uninstall-etc-files:
116         for file in $(INSTALL_ETC_FILES); do \
117           rm -f $(etcdir)/$$file; \
118         done
119
120 # ========== DEPENDENCIES FOR CLEANUP ==========
121
122 mostlyclean:
123         rm -f *~
124
125 clean: mostlyclean
126         rm -f $(GENERATED_ETC_FILES)
127
128 distclean: clean
129         rm -f Makefile
130
131 realclean: distclean
132
133 superclean: realclean
134
135 # ========== DEPENDENCIES FOR MAINTENANCE ==========
136
137 subdir = etc
138
139 Makefile: Makefile.in ../config.status
140         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
141  
142 distdir = ../`cat ../distname`/$(subdir)
143 nmhdist: $(DIST)
144         @echo "Copying distribution files in $(subdir)"
145         @for file in $(DIST); do \
146           cp -p $(srcdir)/$$file $(distdir); \
147         done
148