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 # include file for the man pages. It is installed
54 # in the nmh library directory.
57 # input file for header
60 # man pages to install in $(mandir)/$(manext1)
61 MAN1SRC = ali. anno. burst. comp. \
62 dist. flist. flists. folder. folders. \
63 forw. inc. mark. mh-chart. nmh. \
64 mhbuild. mhl. mhlist. mhmail. \
65 mhn. mhparam. mhpath. mhshow. \
66 mhstore. msgchk. msh. \
67 next. packf. pick. prev. \
68 prompter. rcvdist. rcvpack. \
69 rcvstore. rcvtty. refile. \
70 repl. rmf. rmm. scan. \
71 send. sendfiles. show. slocal. \
72 sortm. vmh. whatnow. whom.
74 MAN5SRC = mh-alias. mh-draft. mh-format. \
75 mh-mail. mh-profile. mh-sequence. \
78 MAN8SRC = ap. conflict. dp. fmtdump. \
79 install-mh. mh-mts. post.
81 MAN1 = $(MAN1SRC:.=.$(manext1))
82 MAN5 = $(MAN5SRC:.=.$(manext5))
83 MAN8 = $(MAN8SRC:.=.$(manext8))
85 # source for man pages
86 DIST_MANSRC = $(MAN1SRC) $(MAN5SRC) $(MAN8SRC)
87 DIST_MAN = $(DIST_MANSRC:.=.man)
92 # all files in this directory included in the distribution
93 DIST = $(DIST_HDR) $(DIST_MAN) $(AUX)
95 # ========= DEFAULT TARGET ==========
97 all: tmac.h $(MAN1) $(MAN5) $(MAN8)
99 $(MAN1) $(MAN5) $(MAN8): man.sed
101 tmac.h: man.sed tmac.h.in
102 $(SED) -f man.sed $(srcdir)/tmac.h.in > $@
104 # create the sed file for building man pages
106 echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED. DO NOT EDIT.,g' > $@
107 echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
108 echo 's,%nmhdate%,$(DATE),g' >> $@
109 echo 's,%bindir%,$(bindir),g' >> $@
110 echo 's,%etcdir%,$(etcdir),g' >> $@
111 echo 's,%libdir%,$(libdir),g' >> $@
112 echo 's,%mandir%,$(mandir),g' >> $@
113 echo 's,%mailspool%,$(mailspool),g' >> $@
114 echo 's,%sendmailpath%,$(sendmailpath),g' >> $@
115 echo 's,%default_editor%,$(default_editor),g' >> $@
116 echo 's,%default_pager%,$(default_pager),g' >> $@
117 echo 's,%manext1%,$(manext1),g' >> $@
118 echo 's,%manext5%,$(manext5),g' >> $@
119 echo 's,%manext8%,$(manext8),g' >> $@
120 echo '$(POPSED)' >> $@
121 echo '/%components%/r $(top_srcdir)/etc/components' >> $@
122 echo ' s,%components%,,g' >> $@
123 echo '/%distcomps%/r $(top_srcdir)/etc/distcomps' >> $@
124 echo ' s,%distcomps%,,g' >> $@
126 # ========= INSTALL TARGETS =========
128 install: install-hdr install-man1 install-man5 install-man8
130 # install the include file for man pages
132 $(top_srcdir)/mkinstalldirs $(etcdir)
133 $(INSTALL_DATA) tmac.h $(etcdir)/tmac.h
135 # install the man pages in man1
137 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext1)
138 for file in $(MAN1); do \
139 $(INSTALL_DATA) $$file $(mandir)/man$(manext1) ; \
142 # install the man pages in man5
144 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext5)
145 for file in $(MAN5); do \
146 $(INSTALL_DATA) $$file $(mandir)/man$(manext5) ; \
148 if [ ! -f $(mandir)/man$(manext5)/mh_profile.$(manext5) ] ; then \
149 ( cd $(mandir)/man$(manext5) ; ln mh-profile.$(manext5) \
150 mh_profile.$(manext5) ) \
153 # install the man pages in man8
155 $(top_srcdir)/mkinstalldirs $(mandir)/man$(manext8)
156 for file in $(MAN8); do \
157 $(INSTALL_DATA) $$file $(mandir)/man$(manext8) ; \
160 # ========= UNINSTALL TARGETS =========
162 uninstall: uninstall-hdr uninstall-man1 uninstall-man5 uninstall-man8
164 # uninstall the include file for man pages
166 rm -f $(etcdir)/tmac.h
168 # uninstall the man pages in man1
170 for file in $(MAN1); do \
171 rm -f $(mandir)/man$(manext1)/$$file; \
174 # uninstall the man pages in man5
176 for file in $(MAN5); do \
177 rm -f $(mandir)/man$(manext5)/$$file; \
180 # uninstall the man pages in man8
182 for file in $(MAN8); do \
183 rm -f $(mandir)/man$(manext8)/$$file; \
186 # ========== DEPENDENCIES FOR CLEANUP ==========
192 rm -f man.sed tmac.h *.$(manext1) *.$(manext5) *.$(manext8)
199 superclean: realclean
203 # ========== DEPENDENCIES FOR MAINTENANCE ==========
207 Makefile: Makefile.in ../config.status
208 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
210 distdir = ../`cat ../distname`/$(subdir)
212 @echo "Copying distribution files in $(subdir)"
213 @for file in $(DIST); do \
214 cp -p $(srcdir)/$$file $(distdir); \