2 # Makefile for top level of nmh distribution
14 # ========== USER CONFIGURATION SECTION ==========
16 # If `make' is executed in the directory containing this Makefile,
17 # any changes made in this section will override the values of
18 # these parameters in makefiles in any of the subdirectories.
21 exec_prefix = @exec_prefix@
23 # location of standard commands
26 # location of support binaries and scripts
29 # location of nmh configuration and formats files
32 # location of man pages
35 # location of incoming mail
36 mailspool = @mailspool@
38 # location of mail transport agent
39 sendmailpath = @sendmailpath@
42 default_editor = @editorpath@
45 default_pager = @pagerpath@
49 DEFS = @DEFS@ @OURDEFS@
54 # ========== YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW HERE ==========
56 # flags passed to recursive makes in subdirectories
57 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
58 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
59 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
60 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
61 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)' \
62 default_editor='$(default_editor)' default_pager='$(default_pager)'
65 INSTALL_PROGRAM = @INSTALL_PROGRAM@
66 INSTALL_DATA = @INSTALL_DATA@
70 # all files in this directory included in the distribution
71 DIST = ChangeLog COPYRIGHT DATE INSTALL MACHINES README VERSION \
72 ChangeLog install-sh mkinstalldirs Makefile.in aclocal.m4 \
73 acconfig.h config.h.in configure.in configure stamp-h.in \
74 config.sub config.guess
76 # subdirectories in distribution
77 SUBDIRS = h config sbr mts uip etc man docs
79 # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
82 all: config.h Makefile all-recursive
85 for subdir in $(SUBDIRS); do \
86 (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
90 for subdir in $(SUBDIRS); do \
91 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
95 for subdir in $(SUBDIRS); do \
96 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
99 # ========== DEPENDENCIES FOR CLEANUP ==========
101 mostlyclean: mostlyclean-recursive mostlyclean-local
102 clean: clean-recursive clean-local
103 distclean: distclean-recursive distclean-local
104 realclean: realclean-recursive realclean-local
105 superclean: superclean-recursive superclean-local
110 clean-local: mostlyclean-local
112 distclean-local: clean-local
113 rm -f Makefile config.h config.status config.log config.cache stamp-h distname
115 realclean-local: distclean-local
117 superclean-local: realclean-local
118 cd $(srcdir) && rm -f config.h.in stamp-h.in configure
120 mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive superclean-recursive:
121 for subdir in $(SUBDIRS); do \
122 target=`echo $@ | sed 's/-recursive//'`; \
123 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
126 # ========== DEPENDENCIES FOR MAINTENANCE ==========
129 for subdir in $(SUBDIRS); do \
130 ( cd $$subdir && $(MAKE) $(MAKEDEFS) lint ) || exit 1; \
133 # ========== DEPENDENCIES FOR MAINTENANCE ==========
135 Makefile: Makefile.in config.status
138 config.status: configure VERSION
139 ./config.status --recheck
141 configure: configure.in aclocal.m4
142 cd $(srcdir) && autoconf
145 stamp-h: config.h.in config.status
146 ./config.status config.h stamp
148 config.h.in: stamp-h.in
149 stamp-h.in: configure.in acconfig.h aclocal.m4
150 cd $(srcdir) && autoheader
153 # rebuild all autoconf files
155 cd $(srcdir) && autoheader
156 cd $(srcdir) && autoconf
157 cd $(srcdir) && date > stamp-h.in
159 # name of new nmh distribution tar file
160 tarfile = nmh-$(VERSION).tar.gz
162 # ftp directory location
165 # file containing name of new nmh distribution
167 @echo nmh-$(VERSION) > distname
169 # build nmh distribution
170 distdir = `cat distname`
171 nmhdist: $(DIST) distname
172 @echo "Begin building nmh-$(VERSION) distribution"
175 @chmod 755 $(distdir)
176 @echo "Copying distribution files in main directory"
177 @for file in $(DIST); do \
178 cp -p $(srcdir)/$$file $(distdir); \
180 @for subdir in $(SUBDIRS); do \
181 mkdir $(distdir)/$$subdir; \
182 chmod 755 $(distdir)/$$subdir; \
183 (cd $$subdir && $(MAKE) $@) || exit 1; \
185 chmod -R a+r $(distdir)
186 tar chf - $(distdir) | gzip -c > $(tarfile)
187 rm -rf $(distdir) distname
188 @echo "Done building nmh-$(VERSION) distribution"
190 # release a new nmh distribution into ftp directory
192 rm -f $(ftpdir)/$(tarfile)
193 rm -f $(ftpdir)/nmh.tar.gz
194 mv $(tarfile) $(ftpdir)/$(tarfile)
195 cd $(ftpdir) && ln -s $(tarfile) nmh.tar.gz
196 cd $(ftpdir) && md5sum *.gz > MD5SUM