2 # Makefile for man subdirectory
10 top_srcdir = @top_srcdir@
15 exec_prefix = @exec_prefix@
24 mailspool = @mailspool@
25 sendmailpath = @sendmailpath@
27 default_editor = @editorpath@
28 default_pager = @pagerpath@
31 INSTALL_DATA = @INSTALL_DATA@
34 SEDMAN = $(SED) -f man.sed $< > $@
36 # sed line for editing pop information in man pages
40 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
51 # man pages to install in $(mandir)/$(manext1)
52 MAN1SRC = ali. anno. burst. comp. \
53 dist. flist. flists. folder. folders. \
54 forw. inc. install-mh. mark. mh-chart. \
55 nmh. mhbuild. mhl. mhlist. mhmail. \
56 mhn. mhparam. mhpath. mhshow. \
57 mhstore. msgchk. msh. \
58 new. fnext. fprev. unseen. \
59 next. packf. pick. prev. \
60 prompter. rcvdist. rcvpack. \
61 rcvstore. rcvtty. refile. \
62 repl. rmf. rmm. scan. \
63 send. sendfiles. show. slocal. \
66 MAN5SRC = mh-alias. mh-draft. mh-format. \
67 mh-mail. mh-profile. mh-sequence. \
70 MAN8SRC = ap. conflict. dp. fmtdump. \
73 MAN1 = $(MAN1SRC:.=.$(manext1))
74 MAN5 = $(MAN5SRC:.=.$(manext5))
75 MAN8 = $(MAN8SRC:.=.$(manext8))
77 # Since vmh is not built or distributed, neither should vmh.1 be
80 # source for man pages
81 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
82 DIST_MAN = $(DIST_MANSRC:.=.man)
87 # all files in this directory included in the distribution
88 DIST = $(DIST_MAN) $(AUX)
90 # ========= DEFAULT TARGET ==========
92 all: $(MAN1) $(MAN5) $(MAN8)
94 $(MAN1) $(MAN5) $(MAN8): man.sed
96 # create the sed file for building man pages
98 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
99 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
100 echo 's,%nmhdate%,$(DATE),g' >> $@
101 echo 's,%bindir%,$(bindir),g' >> $@
102 echo 's,%etcdir%,$(etcdir),g' >> $@
103 echo 's,%libdir%,$(libdir),g' >> $@
104 echo 's,%mandir%,$(mandir),g' >> $@
105 echo 's,%mailspool%,$(mailspool),g' >> $@
106 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
107 echo 's,%default_editor%,$(default_editor),g' >> $@
108 echo 's,%default_pager%,$(default_pager),g' >> $@
109 echo 's,%manext1%,$(manext1),g' >> $@
110 echo 's,%manext5%,$(manext5),g' >> $@
111 echo 's,%manext8%,$(manext8),g' >> $@
112 echo '$(POPSED)' >> $@
113 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
114 echo ' s,%components%,,g' >> $@
115 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
116 echo ' s,%distcomps%,,g' >> $@
117 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
118 echo ' s,%forwcomps%,,g' >> $@
119 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
120 echo ' s,%mhl_forward%,,g' >> $@
121 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
122 echo ' s,%mhl_format%,,g' >> $@
123 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
124 echo ' s,%mhl_reply%,,g' >> $@
126 # ========= INSTALL TARGETS =========
128 install: install-man1 install-man5 install-man8
130 # install the man pages in man1
132 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
133 for file in $(MAN1); do \
134 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
137 # install the man pages in man5
139 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
140 for file in $(MAN5); do \
141 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
143 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
144 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
145 mh_profile.$(manext5) ) \
148 # install the man pages in man8
150 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
151 for file in $(MAN8); do \
152 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
155 # ========= UNINSTALL TARGETS =========
157 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
159 # uninstall the man pages in man1
161 for file in $(MAN1); do \
162 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
165 # uninstall the man pages in man5
167 for file in $(MAN5); do \
168 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
171 # uninstall the man pages in man8
173 for file in $(MAN8); do \
174 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
177 # ========== DEPENDENCIES FOR CLEANUP ==========
183 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
190 superclean: realclean
194 # ========== DEPENDENCIES FOR MAINTENANCE ==========
198 Makefile: Makefile.in ../config.status
199 cd .. && ./config.status $(subdir)/$@
201 distdir = ../`cat ../distname`/$(subdir)
203 @echo "Copying distribution files in $(subdir)"
204 @for file in $(DIST); do \
205 cp -p $(srcdir)/$$file $(distdir); \