2 # Makefile for top level of mmh 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 mmh configuration and formats files
33 datarootdir = @datarootdir@
35 # location of man pages
38 # location of incoming mail
39 mailspool = @mailspool@
41 # location of mail transport agent
42 sendmailpath = @sendmailpath@
46 DEFS = @DEFS@ @OURDEFS@
51 # ========== YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW HERE ==========
53 # flags passed to recursive makes in subdirectories
54 MAKEDEFS = CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' \
55 CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' LIBS='$(LIBS)' \
56 prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \
57 etcdir='$(etcdir)' libdir='$(libdir)' mandir='$(mandir)' \
58 mailspool='$(mailspool)' sendmailpath='$(sendmailpath)'
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA = @INSTALL_DATA@
66 # all files in this directory included in the distribution
67 DIST = COPYRIGHT DATE INSTALL README VERSION \
68 autogen.sh install-sh Makefile.in aclocal.m4 \
69 acconfig.h config.h.in configure.ac configure stamp-h.in \
70 config.sub config.guess
72 # subdirectories in distribution
73 SUBDIRS = h config sbr uip etc man docs
75 # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
78 all: config.h Makefile all-recursive
81 for subdir in $(SUBDIRS); do \
82 (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
86 for subdir in $(SUBDIRS); do \
87 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
91 for subdir in $(SUBDIRS); do \
92 (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
95 # ========== DEPENDENCIES FOR CLEANUP ==========
97 mostlyclean: mostlyclean-recursive mostlyclean-local
98 clean: clean-recursive clean-local
99 distclean: distclean-recursive distclean-local
100 realclean: realclean-recursive realclean-local
101 superclean: superclean-recursive superclean-local
106 clean-local: mostlyclean-local
108 distclean-local: clean-local
109 rm -f Makefile config.h config.status config.log config.cache stamp-h distname
111 realclean-local: distclean-local
113 superclean-local: realclean-local
114 cd $(srcdir) && rm -f config.h.in stamp-h.in configure
116 mostlyclean-recursive clean-recursive distclean-recursive realclean-recursive superclean-recursive:
117 for subdir in $(SUBDIRS); do \
118 target=`echo $@ | sed 's/-recursive//'`; \
119 (cd $$subdir && $(MAKE) $(MAKEDEFS) $$target) || exit 1; \
122 # ========== DEPENDENCIES FOR MAINTENANCE ==========
125 for subdir in $(SUBDIRS); do \
126 ( cd $$subdir && $(MAKE) $(MAKEDEFS) lint ) || exit 1; \
129 # ========== DEPENDENCIES FOR MAINTENANCE ==========
131 Makefile: Makefile.in config.status
134 config.status: configure VERSION
135 ./config.status --recheck
137 configure: configure.ac aclocal.m4
138 cd $(srcdir) && autoconf
141 stamp-h: config.h.in config.status
142 ./config.status config.h stamp
144 config.h.in: stamp-h.in
145 stamp-h.in: configure.ac acconfig.h aclocal.m4
146 cd $(srcdir) && autoheader
149 # rebuild all autoconf files
151 cd $(srcdir) && autoheader
152 cd $(srcdir) && autoconf
153 cd $(srcdir) && date > stamp-h.in
155 # name of new mmh distribution tar file
156 tarfile = mmh-$(VERSION).tar.gz
158 # ftp directory location
161 # file containing name of new mmh distribution
163 @echo mmh-$(VERSION) > distname
165 # build mmh distribution
166 distdir = `cat distname`
167 mmhdist: $(DIST) distname
168 @echo "Begin building mmh-$(VERSION) distribution"
171 @chmod 755 $(distdir)
172 @echo "Copying distribution files in main directory"
173 @for file in $(DIST); do \
174 cp -p $(srcdir)/$$file $(distdir); \
176 @for subdir in $(SUBDIRS); do \
177 mkdir $(distdir)/$$subdir; \
178 chmod 755 $(distdir)/$$subdir; \
179 (cd $$subdir && $(MAKE) $@) || exit 1; \
181 chmod -R a+r $(distdir)
182 tar chf - $(distdir) | gzip -c > $(tarfile)
183 rm -rf $(distdir) distname
184 @echo "Done building mmh-$(VERSION) distribution"
186 # release a new mmh distribution into ftp directory
187 mmhrelease: $(tarfile)
188 rm -f $(ftpdir)/$(tarfile)
189 rm -f $(ftpdir)/mmh.tar.gz
190 mv $(tarfile) $(ftpdir)/$(tarfile)
191 cd $(ftpdir) && ln -s $(tarfile) mmh.tar.gz
192 cd $(ftpdir) && md5sum *.gz > MD5SUM