2 # Makefile for man subdirectory
9 top_srcdir = @top_srcdir@
13 VERSION = `$(top_srcdir)/version.sh $(top_srcdir)`
16 exec_prefix = @exec_prefix@
20 datarootdir = @datarootdir@
27 mailspool = @mailspool@
28 sendmailpath = @sendmailpath@
31 INSTALL_DATA = @INSTALL_DATA@
34 SEDMAN = $(SED) -f man.sed $< > $@
37 .SUFFIXES: .man1 .man5 .man7 .man8 \
38 .$(manext1) .$(manext5) .$(manext7) .$(manext8)
52 # man pages to install in $(mandir)/$(manext1)
53 MAN1SRC = ali. anno. burst. comp. dist. flist. flists. folder. folders. \
54 forw. inc. mark. mhbuild. mhl. mhlist. mhsign. mhpgp. mmh. mmhwrap. \
55 mhmail. mhparam. mhpath. mhstore. new. fnext. \
56 fprev. unseen. next. packf. pick. prev. prompter. rcvdist. rcvpack. \
57 rcvstore. refile. repl. rmf. rmm. scan. send. sendfiles. \
58 show. slocal. sortm. whatnow. whom. whatnow2.
60 MAN5SRC = mh-alias. mh-format. mh-mail. mh-profile.
62 MAN7SRC = mmh-intro. mh-chart. mh-draft. mh-sequence.
64 MAN8SRC = spost. ap. dp. fmtdump.
66 MAN1 = $(MAN1SRC:.=.$(manext1))
67 MAN5 = $(MAN5SRC:.=.$(manext5))
68 MAN7 = $(MAN7SRC:.=.$(manext7))
69 MAN8 = $(MAN8SRC:.=.$(manext8))
71 ALLPROGS = $(MAN1) $(MAN8)
73 # ========= DEFAULT TARGET ==========
75 all: $(MAN1) $(MAN5) $(MAN7) $(MAN8)
77 mh-chart.man7: $(ALLPROGS)
78 $(srcdir)/mh-chart-gen.sh $(ALLPROGS) >$@
81 $(srcdir)/gettitles.sh $(srcdir) 1 >titles1.temp
82 $(srcdir)/gettitles.sh $(srcdir) 5 >titles5.temp
83 $(srcdir)/gettitles.sh $(srcdir) 7 >titles7.temp
84 $(srcdir)/gettitles.sh $(srcdir) 8 >titles8.temp
86 $(MAN1) $(MAN5) $(MAN7) $(MAN8): man.sed
88 # create the sed file for building man pages
89 man.sed: Makefile titles
90 @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
91 @echo 's,%nmhversion%,'$(VERSION)',g' >> $@
92 @echo 's,%nmhdate%,$(DATE),g' >> $@
93 @echo 's,%bindir%,$(bindir),g' >> $@
94 @echo 's,%etcdir%,$(etcdir),g' >> $@
95 @echo 's,%libdir%,$(libdir),g' >> $@
96 @echo 's,%mandir%,$(mandir),g' >> $@
97 @echo 's,%mailspool%,$(mailspool),g' >> $@
98 @echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
99 @echo 's,%manext1%,$(manext1),g' >> $@
100 @echo 's,%manext5%,$(manext5),g' >> $@
101 @echo 's,%manext7%,$(manext7),g' >> $@
102 @echo 's,%manext8%,$(manext8),g' >> $@
103 @echo '/%components%/r $(top_srcdir)/etc/components' >> $@
104 @echo ' s,%components%,,g' >> $@
105 @echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
106 @echo ' s,%distcomps%,,g' >> $@
107 @echo '/%forwcomps%/r $(top_srcdir)/etc/forwcomps' >> $@
108 @echo ' s,%forwcomps%,,g' >> $@
109 @echo '/%mhl_forward%/r $(top_srcdir)/etc/mhl.forward' >> $@
110 @echo ' s,%mhl_forward%,,g' >> $@
111 @echo '/%mhl_format%/r $(top_srcdir)/etc/mhl.format' >> $@
112 @echo ' s,%mhl_format%,,g' >> $@
113 @echo '/%mhl_reply%/r $(top_srcdir)/etc/mhl.reply' >> $@
114 @echo ' s,%mhl_reply%,,g' >> $@
115 @echo '/^%titles1%$$/r titles1.temp' >> $@
116 @echo '/^%titles5%$$/r titles5.temp' >> $@
117 @echo '/^%titles7%$$/r titles7.temp' >> $@
118 @echo '/^%titles8%$$/r titles8.temp' >> $@
119 @echo '/^%titles[0-9]%$$/d' >> $@
121 # ========= INSTALL TARGETS =========
123 install: install-man1 install-man5 install-man7 install-man8
125 # install the man pages in man1
127 mkdir -p $(DESTDIR)$(mandir)/man$(manext1)
128 for file in $(MAN1); do \
129 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext1) ; \
132 # install the man pages in man5
134 mkdir -p $(DESTDIR)$(mandir)/man$(manext5)
135 for file in $(MAN5); do \
136 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext5) ; \
139 # install the man pages in man7
141 mkdir -p $(DESTDIR)$(mandir)/man$(manext7)
142 for file in $(MAN7); do \
143 $(INSTALL_DATA) $$file $(DESTDIR)$(mandir)/man$(manext7) ; \
146 # install the man pages in man8
148 mkdir -p $(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-man7 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 man7
171 for file in $(MAN7); do \
172 rm -f $(DESTDIR)$(mandir)/man$(manext7)/$$file; \
175 # uninstall the man pages in man8
177 for file in $(MAN8); do \
178 rm -f $(DESTDIR)$(mandir)/man$(manext8)/$$file; \
181 # ========== DEPENDENCIES FOR CLEANUP ==========
187 rm -f $(MAN1) $(MAN5) $(MAN7) $(MAN8)
188 rm -f man.sed mh-chart.man7
189 rm -f titles[0-9].temp
196 superclean: realclean
200 # ========== DEPENDENCIES FOR MAINTENANCE ==========
204 Makefile: Makefile.in ../config.status
205 cd .. && ./config.status $(subdir)/$@