2 # Makefile for man subdirectory
10 top_srcdir = @top_srcdir@
15 exec_prefix = @exec_prefix@
18 datarootdir = @datarootdir@
25 mailspool = @mailspool@
26 sendmailpath = @sendmailpath@
28 default_editor = @editorpath@
29 default_pager = @pagerpath@
32 INSTALL_DATA = @INSTALL_DATA@
35 SEDMAN = $(SED) -f man.sed $< > $@
37 # sed line for editing pop information in man pages
41 .SUFFIXES: .man .$(manext1) .$(manext5) .$(manext8)
52 # man pages to install in $(mandir)/$(manext1)
53 MAN1SRC = ali. anno. burst. comp. \
54 dist. flist. flists. folder. folders. \
55 forw. inc. install-mh. mark. mh-chart. \
56 nmh. mhbuild. mhl. mhlist. mhmail. \
57 mhn. mhparam. mhpath. mhshow. \
58 mhstore. msgchk. msh. \
59 new. fnext. fprev. unseen. \
60 next. packf. pick. prev. \
61 prompter. rcvdist. rcvpack. \
62 rcvstore. rcvtty. refile. \
63 repl. rmf. rmm. scan. \
64 send. sendfiles. show. slocal. \
67 MAN5SRC = mh-alias. mh-draft. mh-format. \
68 mh-mail. mh-profile. mh-sequence. \
71 MAN8SRC = ap. conflict. dp. fmtdump. \
74 MAN1 = $(MAN1SRC:.=.$(manext1))
75 MAN5 = $(MAN5SRC:.=.$(manext5))
76 MAN8 = $(MAN8SRC:.=.$(manext8))
78 # source for man pages
79 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
80 DIST_MAN = $(DIST_MANSRC:.=.man)
85 # all files in this directory included in the distribution
86 DIST = $(DIST_MAN) $(AUX)
88 # ========= DEFAULT TARGET ==========
90 all: $(MAN1) $(MAN5) $(MAN8)
92 $(MAN1) $(MAN5) $(MAN8): man.sed
94 # create the sed file for building man pages
96 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
97 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
98 echo 's,%nmhdate%,$(DATE),g' >> $@
99 echo 's,%bindir%,$(bindir),g' >> $@
100 echo 's,%etcdir%,$(etcdir),g' >> $@
101 echo 's,%libdir%,$(libdir),g' >> $@
102 echo 's,%mandir%,$(mandir),g' >> $@
103 echo 's,%mailspool%,$(mailspool),g' >> $@
104 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
105 echo 's,%default_editor%,$(default_editor),g' >> $@
106 echo 's,%default_pager%,$(default_pager),g' >> $@
107 echo 's,%manext1%,$(manext1),g' >> $@
108 echo 's,%manext5%,$(manext5),g' >> $@
109 echo 's,%manext8%,$(manext8),g' >> $@
110 echo '$(POPSED)' >> $@
111 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
112 echo ' s,%components%,,g' >> $@
113 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
114 echo ' s,%distcomps%,,g' >> $@
115 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
116 echo ' s,%forwcomps%,,g' >> $@
117 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
118 echo ' s,%mhl_forward%,,g' >> $@
119 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
120 echo ' s,%mhl_format%,,g' >> $@
121 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
122 echo ' s,%mhl_reply%,,g' >> $@
124 # ========= INSTALL TARGETS =========
126 install: install-man1 install-man5 install-man8
128 # install the man pages in man1
130 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
131 for file in $(MAN1); do \
132 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
135 # install the man pages in man5
137 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
138 for file in $(MAN5); do \
139 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
141 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
142 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
143 mh_profile.$(manext5) ) \
146 # install the man pages in man8
148 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
149 for file in $(MAN8); do \
150 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
153 # ========= UNINSTALL TARGETS =========
155 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
157 # uninstall the man pages in man1
159 for file in $(MAN1); do \
160 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
163 # uninstall the man pages in man5
165 for file in $(MAN5); do \
166 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
169 # uninstall the man pages in man8
171 for file in $(MAN8); do \
172 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
175 # ========== DEPENDENCIES FOR CLEANUP ==========
181 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
188 superclean: realclean
192 # ========== DEPENDENCIES FOR MAINTENANCE ==========
196 Makefile: Makefile.in ../config.status
197 cd .. && ./config.status $(subdir)/$@
199 distdir = ../`cat ../distname`/$(subdir)
201 @echo "Copying distribution files in $(subdir)"
202 @for file in $(DIST); do \
203 cp -p $(srcdir)/$$file $(distdir); \