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 = ChangeLog COPYRIGHT DATE INSTALL MACHINES README VERSION \
74 ChangeLog install-sh mkinstalldirs Makefile.in aclocal.m4 \
75 acconfig.h config.h.in configure.in configure stamp-h.in \
76 config.sub config.guess
78 # subdirectories in distribution
79 SUBDIRS = h config sbr mts uip etc man docs
81 # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
84 all: config.h Makefile all-recursive
87 for subdir in $(SUBDIRS); do \
88 (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
92 for subdir in $(SUBDIRS); do \
93 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
96 # ========== DEPENDENCIES FOR CLEANUP ==========
98 mostlyclean: mostlyclean-recursive mostlyclean-local
99 clean: clean-recursive clean-local
100 distclean: distclean-recursive distclean-local
101 realclean: realclean-recursive realclean-local
102 superclean: superclean-recursive superclean-local
107 clean-local: mostlyclean-local
109 distclean-local: clean-local
110 rm -f Makefile config.h config.status config.log config.cache stamp-h distname
112 realclean-local: distclean-local
114 superclean-local: realclean-local
115 cd $(srcdir) && rm -f config.h.in stamp-h.in configure
117 mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive superclean-recursive:
118 for subdir in $(SUBDIRS); do \
119 target=`echo $@ | sed 's/-recursive//'`; \
120 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
123 # ========== DEPENDENCIES FOR MAINTENANCE ==========
126 for subdir in $(SUBDIRS); do \
127 ( cd $$subdir && $(MAKE) $(MAKEDEFS) lint ) || exit 1; \
130 # ========== DEPENDENCIES FOR MAINTENANCE ==========
132 Makefile: Makefile.in config.status
133 CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
135 config.status: configure VERSION
136 ./config.status --recheck
138 configure: configure.in aclocal.m4
139 cd $(srcdir) && autoconf
142 stamp-h: config.h.in config.status
143 CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
145 config.h.in: stamp-h.in
146 stamp-h.in: configure.in acconfig.h aclocal.m4
147 cd $(srcdir) && autoheader
150 # rebuild all autoconf files
152 cd $(srcdir) && autoheader
153 cd $(srcdir) && autoconf
154 cd $(srcdir) && date > stamp-h.in
156 # name of new nmh distribution tar file
157 tarfile = nmh-$(VERSION).tar.gz
159 # ftp directory location
162 # file containing name of new nmh distribution
164 @echo nmh-$(VERSION) > distname
166 # build nmh distribution
167 distdir = `cat distname`
168 nmhdist: $(DIST) distname
169 @echo "Begin building nmh-$(VERSION) distribution"
172 @chmod 755 $(distdir)
173 @echo "Copying distribution files in main directory"
174 @for file in $(DIST); do \
175 cp -p $(srcdir)/$$file $(distdir); \
177 @for subdir in $(SUBDIRS); do \
178 mkdir $(distdir)/$$subdir; \
179 chmod 755 $(distdir)/$$subdir; \
180 (cd $$subdir && $(MAKE) $@) || exit 1; \
182 chmod -R a+r $(distdir)
183 tar chf - $(distdir) | gzip -c > $(tarfile)
184 rm -rf $(distdir) distname
185 @echo "Done building nmh-$(VERSION) distribution"
187 # release a new nmh distribution into ftp directory
189 rm -f $(ftpdir)/$(tarfile)
190 rm -f $(ftpdir)/nmh.tar.gz
191 mv $(tarfile) $(ftpdir)/$(tarfile)
192 cd $(ftpdir) && ln -s $(tarfile) nmh.tar.gz
193 cd $(ftpdir) && md5sum *.gz > MD5SUM