prompter-sendfiles
[mmh] / man / Makefile.in
1 #
2 # Makefile for man subdirectory
3 #
4 # $Id$
5 #
6
7 VERSION = @VERSION@
8 DATE = @DATE@
9
10 SHELL = /bin/sh
11
12 top_srcdir = @top_srcdir@
13 srcdir     = @srcdir@
14 VPATH      = @srcdir@
15
16 prefix      = @prefix@
17 exec_prefix = @exec_prefix@
18 bindir      = @bindir@
19 libdir      = @libdir@
20 etcdir      = @sysconfdir@
21 mandir      = @mandir@
22 manext1     = 1
23 manext5     = 5
24 manext8     = 8
25
26 mailspool    = @mailspool@
27 sendmailpath = @sendmailpath@
28
29 default_editor = @editorpath@
30 default_pager = @pagerpath@
31
32 INSTALL      = @INSTALL@
33 INSTALL_DATA = @INSTALL_DATA@
34
35 SED = sed
36 SEDMAN = $(SED) -f man.sed $< > $@
37
38 # sed line for editing pop information in man pages
39 POPSED = @POPSED@
40
41 .SUFFIXES:
42 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
43
44 .man.$(manext1):
45         $(SEDMAN)
46
47 .man.$(manext5):
48         $(SEDMAN)
49
50 .man.$(manext8):
51         $(SEDMAN)
52
53 # include file for the man pages.  It is installed
54 # in the nmh library directory.
55 HDR = tmac.h
56
57 # input file for header
58 DIST_HDR = tmac.h.in
59
60 # man pages to install in $(mandir)/$(manext1)
61 MAN1SRC = ali. anno. burst. comp.               \
62        dist. flist. flists. folder. folders.    \
63        forw. inc. mark. mh-chart. nmh.          \
64        mhbuild. mhl. mhlist. mhmail.            \
65        mhn. mhparam. mhpath. mhshow.            \
66        mhstore. msgchk. msh.                    \
67        next. packf. pick. prev.                 \
68        prompter. rcvdist. rcvpack.              \
69        rcvstore. rcvtty. refile.                \
70        repl. rmf. rmm. scan.                    \
71        send. sendfiles. show. slocal.           \
72        sortm. vmh. whatnow. whom.
73
74 MAN5SRC = mh-alias. mh-draft. mh-format.        \
75        mh-mail. mh-profile. mh-sequence.        \
76        mh-tailor. mts.conf.
77
78 MAN8SRC = ap. conflict. dp. fmtdump.            \
79        install-mh. mh-mts. post.
80
81 MAN1 := $(MAN1SRC:.=.$(manext1))
82 MAN5 := $(MAN5SRC:.=.$(manext5))
83 MAN8 := $(MAN8SRC:.=.$(manext8))
84
85 # source for man pages
86 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
87 DIST_MAN = $(DIST_MANSRC:.=.man)
88
89 # auxiliary files
90 AUX = Makefile.in
91
92 # all files in this directory included in the distribution
93 DIST = $(DIST_HDR) $(DIST_MAN) $(AUX)
94
95 # ========= DEFAULT TARGET ==========
96
97 all: tmac.h $(MAN1) $(MAN5) $(MAN8)
98
99 $(MAN1) $(MAN5) $(MAN8): man.sed
100
101 tmac.h: man.sed tmac.h.in
102         $(SED) -f man.sed $(srcdir)/tmac.h.in > $@
103
104 # create the sed file for building man pages
105 man.sed: Makefile
106         echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED.  DO NOT EDIT.,g' > $@
107         echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
108         echo 's,%nmhdate%,$(DATE),g' >> $@
109         echo 's,%bindir%,$(bindir),g' >> $@
110         echo 's,%etcdir%,$(etcdir),g' >> $@
111         echo 's,%libdir%,$(libdir),g' >> $@
112         echo 's,%mandir%,$(mandir),g' >> $@
113         echo 's,%mailspool%,$(mailspool),g' >> $@
114         echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
115         echo 's,%default_editor%,$(default_editor),g' >> $@
116         echo 's,%default_pager%,$(default_pager),g' >> $@
117         echo 's,%manext1%,$(manext1),g' >> $@
118         echo 's,%manext5%,$(manext5),g' >> $@
119         echo 's,%manext8%,$(manext8),g' >> $@
120         echo '$(POPSED)' >> $@
121         echo '/%components%/r $(top_srcdir)/etc/components' >> $@
122         echo ' s,%components%,,g' >> $@
123         echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
124         echo ' s,%distcomps%,,g' >> $@
125         echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
126         echo ' s,%forwcomps%,,g' >> $@
127         echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
128         echo ' s,%mhl_forward%,,g' >> $@
129         echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
130         echo ' s,%mhl_format%,,g' >> $@
131         echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
132         echo ' s,%mhl_reply%,,g' >> $@
133
134 # ========= INSTALL TARGETS =========
135
136 install: install-hdr install-man1 install-man5 install-man8
137
138 # install the include file for man pages
139 install-hdr:
140         $(top_srcdir)/mkinstalldirs $(etcdir)
141         $(INSTALL_DATA) tmac.h $(etcdir)/tmac.h
142
143 # install the man pages in man1
144 install-man1:
145         $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext1)
146         for file in $(MAN1); do \
147           $(INSTALL_DATA) $$file $(mandir)/man$(manext1) ; \
148         done
149
150 # install the man pages in man5
151 install-man5:
152         $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext5)
153         for file in $(MAN5); do \
154           $(INSTALL_DATA) $$file $(mandir)/man$(manext5) ; \
155         done
156         if [ ! -f $(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
157           ( cd $(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
158             mh_profile.$(manext5) ) \
159         fi
160
161 # install the man pages in man8
162 install-man8:
163         $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext8)
164         for file in $(MAN8); do \
165           $(INSTALL_DATA) $$file $(mandir)/man$(manext8) ; \
166         done
167
168 # ========= UNINSTALL TARGETS =========
169
170 uninstall: uninstall-hdr uninstall-man1 uninstall-man5 uninstall-man8
171
172 # uninstall the include file for man pages
173 uninstall-hdr:
174         rm -f $(etcdir)/tmac.h
175
176 # uninstall the man pages in man1
177 uninstall-man1:
178         for file in $(MAN1); do \
179           rm -f $(mandir)/man$(manext1)/$$file; \
180         done
181
182 # uninstall the man pages in man5
183 uninstall-man5:
184         for file in $(MAN5); do \
185           rm -f $(mandir)/man$(manext5)/$$file; \
186         done
187
188 # uninstall the man pages in man8
189 uninstall-man8:
190         for file in $(MAN8); do \
191           rm -f $(mandir)/man$(manext8)/$$file; \
192         done
193
194 # ========== DEPENDENCIES FOR CLEANUP ==========
195
196 mostlyclean:
197         rm -f *~
198
199 clean: mostlyclean
200         rm -f man.sed tmac.h *.$(manext1) *.$(manext5) *.$(manext8)
201
202 distclean: clean
203         rm -f Makefile
204
205 realclean: distclean
206
207 superclean: realclean
208
209 lint:
210
211 # ========== DEPENDENCIES FOR MAINTENANCE ==========
212
213 subdir = man
214
215 Makefile: Makefile.in ../config.status
216         cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
217  
218 distdir = ../`cat ../distname`/$(subdir)
219 nmhdist: $(DIST)
220         @echo "Copying distribution files in $(subdir)"
221         @for file in $(DIST); do \
222           cp -p $(srcdir)/$$file $(distdir); \
223         done
224