2 # Makefile for top level of nmh distribution
16 # ========== USER CONFIGURATION SECTION ==========
18 # If `make' is executed in the directory containing this Makefile,
19 # any changes made in this section will override the values of
20 # these parameters in makefiles in any of the subdirectories.
23 exec_prefix = @exec_prefix@
25 # location of standard commands
28 # location of support binaries and scripts
31 # location of nmh configuration and formats files
34 # location of man pages
37 # location of incoming mail
38 mailspool = @mailspool@
40 # location of mail transport agent
41 sendmailpath = @sendmailpath@
44 default_editor = @editorpath@
47 default_pager = @pagerpath@
56 # ========== YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW HERE ==========
58 # flags passed to recursive makes in subdirectories
59 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
60 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
61 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
62 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
63 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
64 default_editor='$(default_editor)' default_pager='$(default_pager)'
67 INSTALL_PROGRAM = @INSTALL_PROGRAM@
68 INSTALL_DATA = @INSTALL_DATA@
72 # all files in this directory included in the distribution
73 DIST = README README.developers INSTALL MACHINES COPYRIGHT VERSION DIFFERENCES \
74 FAQ TODO COMPLETION-ZSH COMPLETION-TCSH MAIL.FILTERING \
75 ChangeLog ChangeLog_MH-3_to_MH-6.6 ChangeLog_MH-6.7.0_to_MH-6.8.4.html \
76 install-sh mkinstalldirs Makefile.in aclocal.m4 acconfig.h config.h.in \
77 configure.in configure stamp-h.in config.sub config.guess
79 # subdirectories in distribution
80 SUBDIRS = h config sbr zotnet mts uip etc man
82 # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
85 all: config.h Makefile all-recursive
88 for subdir in $(SUBDIRS); do \
89 (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
93 for subdir in $(SUBDIRS); do \
94 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
97 # ========== DEPENDENCIES FOR CLEANUP ==========
99 mostlyclean: mostlyclean-recursive mostlyclean-local
100 clean: clean-recursive clean-local
101 distclean: distclean-recursive distclean-local
102 realclean: realclean-recursive realclean-local
103 superclean: superclean-recursive superclean-local
108 clean-local: mostlyclean-local
110 distclean-local: clean-local
111 rm -f Makefile config.h config.status config.log config.cache stamp-h distname
113 realclean-local: distclean-local
115 superclean-local: realclean-local
116 cd $(srcdir) && rm -f config.h.in stamp-h.in configure
118 mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive superclean-recursive:
119 for subdir in $(SUBDIRS); do \
120 target=`echo $@ | sed 's/-recursive//'`; \
121 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
124 # ========== DEPENDENCIES FOR MAINTENANCE ==========
126 Makefile: Makefile.in config.status
127 CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
129 config.status: configure VERSION
130 ./config.status --recheck
132 configure: configure.in aclocal.m4
133 cd $(srcdir) && autoconf
136 stamp-h: config.h.in config.status
137 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
139 config.h.in: stamp-h.in
140 stamp-h.in: configure.in acconfig.h aclocal.m4
141 cd $(srcdir) && autoheader
144 # rebuild all autoconf files
146 cd $(srcdir) && autoheader
147 cd $(srcdir) && autoconf
148 cd $(srcdir) && date > stamp-h.in
150 # name of new nmh distribution tar file
151 tarfile = nmh-$(VERSION).tar.gz
153 # ftp directory location
156 # file containing name of new nmh distribution
158 @echo nmh-$(VERSION) > distname
160 # build nmh distribution
161 distdir = `cat distname`
162 nmhdist: $(DIST) distname
163 @echo "Begin building nmh-$(VERSION) distribution"
166 @chmod 755 $(distdir)
167 @echo "Copying distribution files in main directory"
168 @for file in $(DIST); do \
169 cp -p $(srcdir)/$$file $(distdir); \
171 @for subdir in $(SUBDIRS); do \
172 mkdir $(distdir)/$$subdir; \
173 chmod 755 $(distdir)/$$subdir; \
174 (cd $$subdir && $(MAKE) $@) || exit 1; \
176 chmod -R a+r $(distdir)
177 tar chf - $(distdir) | gzip -c > $(tarfile)
178 rm -rf $(distdir) distname
179 @echo "Done building nmh-$(VERSION) distribution"
181 # release a new nmh distribution into ftp directory
183 rm -f $(ftpdir)/$(tarfile)
184 rm -f $(ftpdir)/nmh.tar.gz
185 mv $(tarfile) $(ftpdir)/$(tarfile)
186 cd $(ftpdir) && ln -s $(tarfile) nmh.tar.gz
187 cd $(ftpdir) && md5sum *.gz > MD5SUM