2 # Makefile for man subdirectory
10 top_srcdir = @top_srcdir@
15 exec_prefix = @exec_prefix@
19 datarootdir = @datarootdir@
26 mailspool = @mailspool@
27 sendmailpath = @sendmailpath@
30 INSTALL_DATA = @INSTALL_DATA@
33 SEDMAN = $(SED) -f man.sed $< > $@
36 .SUFFIXES: .man1 .man5 .man7 .man8 \
37 .$(manext1) .$(manext5) .$(manext7) .$(manext8)
51 # man pages to install in $(mandir)/$(manext1)
52 MAN1SRC = ali. anno. burst. comp. dist. flist. flists. folder. folders. \
53 forw. inc. mark. mhbuild. mhl. mhlist. mmh. mmhwrap. \
54 mhmail. mhparam. mhpath. mhshow. mhstore. msgchk. new. fnext. \
55 fprev. unseen. next. packf. pick. prev. prompter. rcvdist. rcvpack. \
56 rcvstore. refile. repl. rmf. rmm. scan. send. sendfiles. \
57 show. slocal. sortm. whatnow.
59 MAN5SRC = mh-alias. mh-format. mh-mail. mh-profile. mh-tailor.
61 MAN7SRC = mmh-intro. mh-chart. mh-draft. mh-sequence.
63 MAN8SRC = spost. ap. dp. fmtdump.
65 MAN1 = $(MAN1SRC:.=.$(manext1))
66 MAN5 = $(MAN5SRC:.=.$(manext5))
67 MAN7 = $(MAN7SRC:.=.$(manext7))
68 MAN8 = $(MAN8SRC:.=.$(manext8))
70 # source for man pages
71 DIST_MAN1 = $(MAN1SRC:.=.man1)
72 DIST_MAN5 = $(MAN5SRC:.=.man5)
73 DIST_MAN7 = $(MAN7SRC:.=.man7)
74 DIST_MAN8 = $(MAN8SRC:.=.man8)
77 AUX = Makefile.in mh-chart-gen.sh
79 # all files in this directory included in the distribution
80 DIST = $(DIST_MAN1) $(DIST_MAN5) $(DIST_MAN7) $(DIST_MAN8) $(AUX)
81 ALLPROGS = $(DIST_MAN1) $(DIST_MAN8)
83 # ========= DEFAULT TARGET ==========
85 all: $(MAN1) $(MAN5) $(MAN7) $(MAN8)
87 mh-chart.man7: $(ALLPROGS)
88 $(srcdir)/mh-chart-gen.sh $(ALLPROGS) >$@
90 $(MAN1) $(MAN5) $(MAN7) $(MAN8): man.sed
92 # create the sed file for building man pages
94 @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
95 @echo 's,%nmhversion%,mmh-$(VERSION),g' >> $@
96 @echo 's,%nmhdate%,$(DATE),g' >> $@
97 @echo 's,%bindir%,$(bindir),g' >> $@
98 @echo 's,%etcdir%,$(etcdir),g' >> $@
99 @echo 's,%libdir%,$(libdir),g' >> $@
100 @echo 's,%mandir%,$(mandir),g' >> $@
101 @echo 's,%mailspool%,$(mailspool),g' >> $@
102 @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
103 @echo 's,%manext1%,$(manext1),g' >> $@
104 @echo 's,%manext5%,$(manext5),g' >> $@
105 @echo 's,%manext7%,$(manext7),g' >> $@
106 @echo 's,%manext8%,$(manext8),g' >> $@
107 @echo '/%components%/r $(top_srcdir)/etc/components' >> $@
108 @echo ' s,%components%,,g' >> $@
109 @echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
110 @echo ' s,%distcomps%,,g' >> $@
111 @echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
112 @echo ' s,%forwcomps%,,g' >> $@
113 @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
114 @echo ' s,%mhl_forward%,,g' >> $@
115 @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
116 @echo ' s,%mhl_format%,,g' >> $@
117 @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
118 @echo ' s,%mhl_reply%,,g' >> $@
120 # ========= INSTALL TARGETS =========
122 install: install-man1 install-man5 install-man7 install-man8
124 # install the man pages in man1
126 mkdir -p $(DESTDIR)$(mandir)/man$(manext1)
127 for file in $(MAN1); do \
128 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
131 # install the man pages in man5
133 mkdir -p $(DESTDIR)$(mandir)/man$(manext5)
134 for file in $(MAN5); do \
135 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
138 # install the man pages in man7
140 mkdir -p $(DESTDIR)$(mandir)/man$(manext7)
141 for file in $(MAN7); do \
142 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext7) ; \
145 # install the man pages in man8
147 mkdir -p $(DESTDIR)$(mandir)/man$(manext8)
148 for file in $(MAN8); do \
149 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext8) ; \
152 # ========= UNINSTALL TARGETS =========
154 uninstall: uninstall-man1 uninstall-man5 uninstall-man7 uninstall-man8
156 # uninstall the man pages in man1
158 for file in $(MAN1); do \
159 rm -f $(DESTDIR)$(mandir)/man$(manext1)/$$file; \
162 # uninstall the man pages in man5
164 for file in $(MAN5); do \
165 rm -f $(DESTDIR)$(mandir)/man$(manext5)/$$file; \
168 # uninstall the man pages in man7
170 for file in $(MAN7); do \
171 rm -f $(DESTDIR)$(mandir)/man$(manext7)/$$file; \
174 # uninstall the man pages in man8
176 for file in $(MAN8); do \
177 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
180 # ========== DEPENDENCIES FOR CLEANUP ==========
186 rm -f $(MAN1) $(MAN5) $(MAN7) $(MAN8)
187 rm -f man.sed mh-chart.man7
194 superclean: realclean
198 # ========== DEPENDENCIES FOR MAINTENANCE ==========
202 Makefile: Makefile.in ../config.status
203 cd .. && ./config.status $(subdir)/$@
205 distdir = ../`cat ../distname`/$(subdir)
207 @echo "Copying distribution files in $(subdir)"
208 @for file in $(DIST); do \
209 cp -p $(srcdir)/$$file $(distdir); \