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 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 # Since vmh is not built or distributed, neither should vmh.1 be
81 # source for man pages
82 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
83 DIST_MAN = $(DIST_MANSRC:.=.man)
88 # all files in this directory included in the distribution
89 DIST = $(DIST_MAN) $(AUX)
91 # ========= DEFAULT TARGET ==========
93 all: $(MAN1) $(MAN5) $(MAN8)
95 $(MAN1) $(MAN5) $(MAN8): man.sed
97 # create the sed file for building man pages
99 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
100 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
101 echo 's,%nmhdate%,$(DATE),g' >> $@
102 echo 's,%bindir%,$(bindir),g' >> $@
103 echo 's,%etcdir%,$(etcdir),g' >> $@
104 echo 's,%libdir%,$(libdir),g' >> $@
105 echo 's,%mandir%,$(mandir),g' >> $@
106 echo 's,%mailspool%,$(mailspool),g' >> $@
107 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
108 echo 's,%default_editor%,$(default_editor),g' >> $@
109 echo 's,%default_pager%,$(default_pager),g' >> $@
110 echo 's,%manext1%,$(manext1),g' >> $@
111 echo 's,%manext5%,$(manext5),g' >> $@
112 echo 's,%manext8%,$(manext8),g' >> $@
113 echo '$(POPSED)' >> $@
114 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
115 echo ' s,%components%,,g' >> $@
116 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
117 echo ' s,%distcomps%,,g' >> $@
118 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
119 echo ' s,%forwcomps%,,g' >> $@
120 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
121 echo ' s,%mhl_forward%,,g' >> $@
122 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
123 echo ' s,%mhl_format%,,g' >> $@
124 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
125 echo ' s,%mhl_reply%,,g' >> $@
127 # ========= INSTALL TARGETS =========
129 install: install-man1 install-man5 install-man8
131 # install the man pages in man1
133 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext1)
134 for file in $(MAN1); do \
135 $(INSTALL_DATA) $$file $(mandir)/man$(manext1) ; \
138 # install the man pages in man5
140 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext5)
141 for file in $(MAN5); do \
142 $(INSTALL_DATA) $$file $(mandir)/man$(manext5) ; \
144 if [ ! -f $(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
145 ( cd $(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
146 mh_profile.$(manext5) ) \
149 # install the man pages in man8
151 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext8)
152 for file in $(MAN8); do \
153 $(INSTALL_DATA) $$file $(mandir)/man$(manext8) ; \
156 # ========= UNINSTALL TARGETS =========
158 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
160 # uninstall the man pages in man1
162 for file in $(MAN1); do \
163 rm -f $(mandir)/man$(manext1)/$$file; \
166 # uninstall the man pages in man5
168 for file in $(MAN5); do \
169 rm -f $(mandir)/man$(manext5)/$$file; \
172 # uninstall the man pages in man8
174 for file in $(MAN8); do \
175 rm -f $(mandir)/man$(manext8)/$$file; \
178 # ========== DEPENDENCIES FOR CLEANUP ==========
184 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
191 superclean: realclean
195 # ========== DEPENDENCIES FOR MAINTENANCE ==========
199 Makefile: Makefile.in ../config.status
200 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
202 distdir = ../`cat ../distname`/$(subdir)
204 @echo "Copying distribution files in $(subdir)"
205 @for file in $(DIST); do \
206 cp -p $(srcdir)/$$file $(distdir); \