2 # Makefile for man subdirectory
12 top_srcdir = @top_srcdir@
17 exec_prefix = @exec_prefix@
26 mailspool = @mailspool@
27 sendmailpath = @sendmailpath@
29 default_editor = @editorpath@
30 default_pager = @pagerpath@
33 INSTALL_DATA = @INSTALL_DATA@
36 SEDMAN = $(SED) -f man.sed $< > $@
38 # sed line for editing pop information in man pages
42 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
53 # man pages to install in $(mandir)/$(manext1)
54 MAN1SRC = ali. anno. burst. comp. \
55 dist. flist. flists. folder. folders. \
56 forw. inc. install-mh. mark. mh-chart. \
57 nmh. mhbuild. mhl. mhlist. mhmail. \
58 mhn. mhparam. mhpath. mhshow. \
59 mhstore. msgchk. msh. \
60 new. fnext. fprev. unseen. \
61 next. packf. pick. prev. \
62 prompter. rcvdist. rcvpack. \
63 rcvstore. rcvtty. refile. \
64 repl. rmf. rmm. scan. \
65 send. sendfiles. show. slocal. \
68 MAN5SRC = mh-alias. mh-draft. mh-format. \
69 mh-mail. mh-profile. mh-sequence. \
72 MAN8SRC = ap. conflict. dp. fmtdump. \
75 MAN1 = $(MAN1SRC:.=.$(manext1))
76 MAN5 = $(MAN5SRC:.=.$(manext5))
77 MAN8 = $(MAN8SRC:.=.$(manext8))
79 # Since vmh is not built or distributed, neither should vmh.1 be
82 # source for man pages
83 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
84 DIST_MAN = $(DIST_MANSRC:.=.man)
89 # all files in this directory included in the distribution
90 DIST = $(DIST_MAN) $(AUX)
92 # ========= DEFAULT TARGET ==========
94 all: $(MAN1) $(MAN5) $(MAN8)
96 $(MAN1) $(MAN5) $(MAN8): man.sed
98 # create the sed file for building man pages
100 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
101 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
102 echo 's,%nmhdate%,$(DATE),g' >> $@
103 echo 's,%bindir%,$(bindir),g' >> $@
104 echo 's,%etcdir%,$(etcdir),g' >> $@
105 echo 's,%libdir%,$(libdir),g' >> $@
106 echo 's,%mandir%,$(mandir),g' >> $@
107 echo 's,%mailspool%,$(mailspool),g' >> $@
108 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
109 echo 's,%default_editor%,$(default_editor),g' >> $@
110 echo 's,%default_pager%,$(default_pager),g' >> $@
111 echo 's,%manext1%,$(manext1),g' >> $@
112 echo 's,%manext5%,$(manext5),g' >> $@
113 echo 's,%manext8%,$(manext8),g' >> $@
114 echo '$(POPSED)' >> $@
115 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
116 echo ' s,%components%,,g' >> $@
117 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
118 echo ' s,%distcomps%,,g' >> $@
119 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
120 echo ' s,%forwcomps%,,g' >> $@
121 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
122 echo ' s,%mhl_forward%,,g' >> $@
123 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
124 echo ' s,%mhl_format%,,g' >> $@
125 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
126 echo ' s,%mhl_reply%,,g' >> $@
128 # ========= INSTALL TARGETS =========
130 install: install-man1 install-man5 install-man8
132 # install the man pages in man1
134 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
135 for file in $(MAN1); do \
136 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
139 # install the man pages in man5
141 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
142 for file in $(MAN5); do \
143 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
145 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
146 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
147 mh_profile.$(manext5) ) \
150 # install the man pages in man8
152 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
153 for file in $(MAN8); do \
154 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
157 # ========= UNINSTALL TARGETS =========
159 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
161 # uninstall the man pages in man1
163 for file in $(MAN1); do \
164 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
167 # uninstall the man pages in man5
169 for file in $(MAN5); do \
170 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
173 # uninstall the man pages in man8
175 for file in $(MAN8); do \
176 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
179 # ========== DEPENDENCIES FOR CLEANUP ==========
185 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
192 superclean: realclean
196 # ========== DEPENDENCIES FOR MAINTENANCE ==========
200 Makefile: Makefile.in ../config.status
201 cd .. && ./config.status $(subdir)/$@
203 distdir = ../`cat ../distname`/$(subdir)
205 @echo "Copying distribution files in $(subdir)"
206 @for file in $(DIST); do \
207 cp -p $(srcdir)/$$file $(distdir); \