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 $< > $@
37 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
48 # man pages to install in $(mandir)/$(manext1)
49 MAN1SRC = ali. anno. burst. comp. \
50 dist. flist. flists. folder. folders. \
51 forw. inc. install-mh. mark. mh-chart. \
52 nmh. mhbuild. mhl. mhlist. mhmail. \
53 mhn. mhparam. mhpath. mhshow. \
54 mhstore. msgchk. msh. \
55 new. fnext. fprev. unseen. \
56 next. packf. pick. prev. \
57 prompter. rcvdist. rcvpack. \
58 rcvstore. rcvtty. refile. \
59 repl. rmf. rmm. scan. \
60 send. sendfiles. show. slocal. \
63 MAN5SRC = mh-alias. mh-draft. mh-format. \
64 mh-mail. mh-profile. mh-sequence. \
67 MAN8SRC = ap. conflict. dp. fmtdump. \
70 MAN1 = $(MAN1SRC:.=.$(manext1))
71 MAN5 = $(MAN5SRC:.=.$(manext5))
72 MAN8 = $(MAN8SRC:.=.$(manext8))
74 # Since vmh is not built or distributed, neither should vmh.1 be
77 # source for man pages
78 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
79 DIST_MAN = $(DIST_MANSRC:.=.man)
84 # all files in this directory included in the distribution
85 DIST = $(DIST_MAN) $(AUX)
87 # ========= DEFAULT TARGET ==========
89 all: $(MAN1) $(MAN5) $(MAN8)
91 $(MAN1) $(MAN5) $(MAN8): man.sed
93 # create the sed file for building man pages
95 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
96 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
97 echo 's,%nmhdate%,$(DATE),g' >> $@
98 echo 's,%bindir%,$(bindir),g' >> $@
99 echo 's,%etcdir%,$(etcdir),g' >> $@
100 echo 's,%libdir%,$(libdir),g' >> $@
101 echo 's,%mandir%,$(mandir),g' >> $@
102 echo 's,%mailspool%,$(mailspool),g' >> $@
103 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
104 echo 's,%default_editor%,$(default_editor),g' >> $@
105 echo 's,%default_pager%,$(default_pager),g' >> $@
106 echo 's,%manext1%,$(manext1),g' >> $@
107 echo 's,%manext5%,$(manext5),g' >> $@
108 echo 's,%manext8%,$(manext8),g' >> $@
109 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
110 echo ' s,%components%,,g' >> $@
111 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
112 echo ' s,%distcomps%,,g' >> $@
113 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
114 echo ' s,%forwcomps%,,g' >> $@
115 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
116 echo ' s,%mhl_forward%,,g' >> $@
117 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
118 echo ' s,%mhl_format%,,g' >> $@
119 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
120 echo ' s,%mhl_reply%,,g' >> $@
122 # ========= INSTALL TARGETS =========
124 install: install-man1 install-man5 install-man8
126 # install the man pages in man1
128 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
129 for file in $(MAN1); do \
130 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
133 # install the man pages in man5
135 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
136 for file in $(MAN5); do \
137 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
139 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
140 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
141 mh_profile.$(manext5) ) \
144 # install the man pages in man8
146 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
147 for file in $(MAN8); do \
148 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
151 # ========= UNINSTALL TARGETS =========
153 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
155 # uninstall the man pages in man1
157 for file in $(MAN1); do \
158 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
161 # uninstall the man pages in man5
163 for file in $(MAN5); do \
164 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
167 # uninstall the man pages in man8
169 for file in $(MAN8); do \
170 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
173 # ========== DEPENDENCIES FOR CLEANUP ==========
179 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
186 superclean: realclean
190 # ========== DEPENDENCIES FOR MAINTENANCE ==========
194 Makefile: Makefile.in ../config.status
195 cd .. && ./config.status $(subdir)/$@
197 distdir = ../`cat ../distname`/$(subdir)
199 @echo "Copying distribution files in $(subdir)"
200 @for file in $(DIST); do \
201 cp -p $(srcdir)/$$file $(distdir); \