2 # Makefile for man subdirectory
10 top_srcdir = @top_srcdir@
15 exec_prefix = @exec_prefix@
24 mailspool = @mailspool@
25 sendmailpath = @sendmailpath@
28 INSTALL_DATA = @INSTALL_DATA@
31 SEDMAN = $(SED) -f man.sed $< > $@
34 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
45 # man pages to install in $(mandir)/$(manext1)
46 MAN1SRC = ali. anno. burst. comp. \
47 dist. flist. flists. folder. folders. \
48 forw. inc. install-mh. mark. mh-chart. \
49 nmh. mhbuild. mhl. mhlist. mhmail. \
50 mhn. mhparam. mhpath. mhshow. \
51 mhstore. msgchk. msh. \
52 new. fnext. fprev. unseen. \
53 next. packf. pick. prev. \
54 prompter. rcvdist. rcvpack. \
55 rcvstore. rcvtty. refile. \
56 repl. rmf. rmm. scan. \
57 send. sendfiles. show. slocal. \
60 MAN5SRC = mh-alias. mh-draft. mh-format. \
61 mh-mail. mh-profile. mh-sequence. \
64 MAN8SRC = ap. conflict. dp. fmtdump. \
67 MAN1 = $(MAN1SRC:.=.$(manext1))
68 MAN5 = $(MAN5SRC:.=.$(manext5))
69 MAN8 = $(MAN8SRC:.=.$(manext8))
71 # Since vmh is not built or distributed, neither should vmh.1 be
74 # source for man pages
75 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
76 DIST_MAN = $(DIST_MANSRC:.=.man)
81 # all files in this directory included in the distribution
82 DIST = $(DIST_MAN) $(AUX)
84 # ========= DEFAULT TARGET ==========
86 all: $(MAN1) $(MAN5) $(MAN8)
88 $(MAN1) $(MAN5) $(MAN8): man.sed
90 # create the sed file for building man pages
92 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
93 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
94 echo 's,%nmhdate%,$(DATE),g' >> $@
95 echo 's,%bindir%,$(bindir),g' >> $@
96 echo 's,%etcdir%,$(etcdir),g' >> $@
97 echo 's,%libdir%,$(libdir),g' >> $@
98 echo 's,%mandir%,$(mandir),g' >> $@
99 echo 's,%mailspool%,$(mailspool),g' >> $@
100 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
101 echo 's,%manext1%,$(manext1),g' >> $@
102 echo 's,%manext5%,$(manext5),g' >> $@
103 echo 's,%manext8%,$(manext8),g' >> $@
104 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
105 echo ' s,%components%,,g' >> $@
106 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
107 echo ' s,%distcomps%,,g' >> $@
108 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
109 echo ' s,%forwcomps%,,g' >> $@
110 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
111 echo ' s,%mhl_forward%,,g' >> $@
112 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
113 echo ' s,%mhl_format%,,g' >> $@
114 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
115 echo ' s,%mhl_reply%,,g' >> $@
117 # ========= INSTALL TARGETS =========
119 install: install-man1 install-man5 install-man8
121 # install the man pages in man1
123 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
124 for file in $(MAN1); do \
125 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
128 # install the man pages in man5
130 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
131 for file in $(MAN5); do \
132 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
134 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
135 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
136 mh_profile.$(manext5) ) \
139 # install the man pages in man8
141 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
142 for file in $(MAN8); do \
143 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
146 # ========= UNINSTALL TARGETS =========
148 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
150 # uninstall the man pages in man1
152 for file in $(MAN1); do \
153 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
156 # uninstall the man pages in man5
158 for file in $(MAN5); do \
159 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
162 # uninstall the man pages in man8
164 for file in $(MAN8); do \
165 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
168 # ========== DEPENDENCIES FOR CLEANUP ==========
174 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
181 superclean: realclean
185 # ========== DEPENDENCIES FOR MAINTENANCE ==========
189 Makefile: Makefile.in ../config.status
190 cd .. && ./config.status $(subdir)/$@
192 distdir = ../`cat ../distname`/$(subdir)
194 @echo "Copying distribution files in $(subdir)"
195 @for file in $(DIST); do \
196 cp -p $(srcdir)/$$file $(distdir); \