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
105 rm -rf autom4te.cache
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
135 config.status: configure VERSION
136 ./config.status --recheck
138 configure: configure.ac aclocal.m4
139 cd $(srcdir) && autoconf
142 stamp-h: config.h.in config.status
143 ./config.status config.h stamp
145 config.h.in: stamp-h.in
146 stamp-h.in: configure.ac 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 mmh distribution tar file
157 tarfile = mmh-$(VERSION).tar.gz
159 # ftp directory location
162 # file containing name of new mmh distribution
164 @echo mmh-$(VERSION) > distname
166 # build mmh distribution
167 distdir = `cat distname`
168 mmhdist: $(DIST) distname
169 @echo "Begin building mmh-$(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 mmh-$(VERSION) distribution"
187 # release a new mmh distribution into ftp directory
188 mmhrelease: $(tarfile)
189 rm -f $(ftpdir)/$(tarfile)
190 rm -f $(ftpdir)/mmh.tar.gz
191 mv $(tarfile) $(ftpdir)/$(tarfile)
192 cd $(ftpdir) && ln -s $(tarfile) mmh.tar.gz
193 cd $(ftpdir) && md5sum *.gz > MD5SUM