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. \
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 # source for man pages
72 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
73 DIST_MAN = $(DIST_MANSRC:.=.man)
78 # all files in this directory included in the distribution
79 DIST = $(DIST_MAN) $(AUX)
81 # ========= DEFAULT TARGET ==========
83 all: $(MAN1) $(MAN5) $(MAN8)
85 $(MAN1) $(MAN5) $(MAN8): man.sed
87 # create the sed file for building man pages
89 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
90 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
91 echo 's,%nmhdate%,$(DATE),g' >> $@
92 echo 's,%bindir%,$(bindir),g' >> $@
93 echo 's,%etcdir%,$(etcdir),g' >> $@
94 echo 's,%libdir%,$(libdir),g' >> $@
95 echo 's,%mandir%,$(mandir),g' >> $@
96 echo 's,%mailspool%,$(mailspool),g' >> $@
97 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
98 echo 's,%manext1%,$(manext1),g' >> $@
99 echo 's,%manext5%,$(manext5),g' >> $@
100 echo 's,%manext8%,$(manext8),g' >> $@
101 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
102 echo ' s,%components%,,g' >> $@
103 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
104 echo ' s,%distcomps%,,g' >> $@
105 echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
106 echo ' s,%forwcomps%,,g' >> $@
107 echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
108 echo ' s,%mhl_forward%,,g' >> $@
109 echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
110 echo ' s,%mhl_format%,,g' >> $@
111 echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
112 echo ' s,%mhl_reply%,,g' >> $@
114 # ========= INSTALL TARGETS =========
116 install: install-man1 install-man5 install-man8
118 # install the man pages in man1
120 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext1)
121 for file in $(MAN1); do \
122 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
125 # install the man pages in man5
127 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext5)
128 for file in $(MAN5); do \
129 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
131 if [ ! -f $(DESTDIR)$(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
132 ( cd $(DESTDIR)$(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
133 mh_profile.$(manext5) ) \
136 # install the man pages in man8
138 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man$(manext8)
139 for file in $(MAN8); do \
140 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
143 # ========= UNINSTALL TARGETS =========
145 uninstall: uninstall-man1 uninstall-man5 uninstall-man8
147 # uninstall the man pages in man1
149 for file in $(MAN1); do \
150 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
153 # uninstall the man pages in man5
155 for file in $(MAN5); do \
156 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
159 # uninstall the man pages in man8
161 for file in $(MAN8); do \
162 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
165 # ========== DEPENDENCIES FOR CLEANUP ==========
171 rm -f man.sed *.$(manext1) *.$(manext5) *.$(manext8)
178 superclean: realclean
182 # ========== DEPENDENCIES FOR MAINTENANCE ==========
186 Makefile: Makefile.in ../config.status
187 cd .. && ./config.status $(subdir)/$@
189 distdir = ../`cat ../distname`/$(subdir)
191 @echo "Copying distribution files in $(subdir)"
192 @for file in $(DIST); do \
193 cp -p $(srcdir)/$$file $(distdir); \