pick implement rfc2047
[mmh] / Makefile.in
1 #
2 # Makefile for top level of mmh distribution
3 #
4
5 SHELL = /bin/sh
6 @SET_MAKE@
7
8 srcdir = @srcdir@
9 VPATH  = @srcdir@
10
11 # mmh version
12 VERSION    = `sed q $(srcdir)/VERSION`
13
14 # ========== USER CONFIGURATION SECTION ==========
15 #
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.
19
20 prefix      = @prefix@
21 exec_prefix = @exec_prefix@
22
23 # location of standard commands
24 bindir      = @bindir@
25
26 # location of support binaries and scripts
27 libdir      = @libdir@
28
29 # location of mmh configuration and formats files
30 etcdir      = @sysconfdir@
31
32 # location of ...
33 datarootdir = @datarootdir@
34
35 # location of man pages
36 mandir      = @mandir@
37
38 # location of incoming mail
39 mailspool   = @mailspool@
40
41 # location of mail transport agent
42 sendmailpath = @sendmailpath@
43
44 CC       = @CC@
45 CPPFLAGS = @CPPFLAGS@
46 DEFS     = @DEFS@ @OURDEFS@
47 CFLAGS   = @CFLAGS@
48 LDFLAGS  = @LDFLAGS@
49 LIBS     = @LIBS@
50
51 # ========== YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW HERE ==========
52
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)'
59
60 INSTALL         = @INSTALL@
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA    = @INSTALL_DATA@
63
64 .SUFFIXES:
65
66 # distribute all files that are under version control ...
67 # ... plus (for convenience):
68 DISTINCLUDE = config.h.in configure stamp-h.in sbr/dtimep.c ChangeLog
69 # ... minus (git stuff):
70 DISTEXCLUDE = .git .gitignore
71
72 # Subdirectories with own Makefiles
73 SUBDIRS = h config sbr uip etc man
74
75 # ========== DEPENDENCIES FOR BUILDING AND INSTALLING ==========
76
77 # default target
78 all: config.h Makefile all-recursive
79
80 all-recursive:
81         for subdir in $(SUBDIRS); do \
82           (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
83         done
84
85 install: all
86         for subdir in $(SUBDIRS); do \
87           (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
88         done
89
90 uninstall:
91         for subdir in $(SUBDIRS); do \
92           (cd $$subdir && $(MAKE) $(MAKEDEFS) $@) || exit 1; \
93         done
94
95 # ========== DEPENDENCIES FOR CLEANUP ==========
96
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
102
103 mostlyclean-local:
104         rm -f *~
105         rm -rf autom4te.cache
106
107 clean-local: mostlyclean-local
108
109 distclean-local: clean-local
110         rm -f Makefile config.h config.status config.log config.cache stamp-h distname ChangeLog
111
112 realclean-local: distclean-local
113
114 superclean-local: realclean-local
115         cd $(srcdir) && rm -f config.h.in stamp-h.in configure
116
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; \
121         done
122
123 # ========== DEPENDENCIES FOR MAINTENANCE ==========
124
125 lint:
126         for subdir in $(SUBDIRS); do \
127           ( cd $$subdir && $(MAKE) $(MAKEDEFS) lint ) || exit 1; \
128         done
129
130 # ========== DEPENDENCIES FOR MAINTENANCE ==========
131
132 Makefile: Makefile.in config.status
133         ./config.status $@
134
135 config.status: configure VERSION
136         ./config.status --recheck
137
138 configure: configure.ac
139         cd $(srcdir) && autoconf
140
141 config.h: stamp-h
142 stamp-h: config.h.in config.status
143         ./config.status config.h stamp
144
145 config.h.in: stamp-h.in
146 stamp-h.in: configure.ac
147         cd $(srcdir) && autoheader
148         date > $@
149
150 # rebuild all autoconf files
151 reset:
152         cd $(srcdir) && autoheader
153         cd $(srcdir) && autoconf
154         cd $(srcdir) && date > stamp-h.in
155
156 # name of new mmh distribution tar file
157 tarfile = mmh-$(VERSION).tar.gz
158
159 # file containing name of new mmh distribution
160 distname:
161         @echo mmh-$(VERSION) > distname
162
163 # pre-generate this file so users don't need lex(1)
164 sbr/dtimep.c:
165         @cd $(srcdir)/sbr && $(MAKE) dtimep.c
166
167 ChangeLog:
168         @git whatchanged --format=fuller > $@
169
170 # build mmh distribution
171 distdir = `cat distname`
172 mmhdist: $(DISTINCLUDE) distname
173         @echo "Begin building mmh-$(VERSION) distribution"
174         @rm -rf $(distdir)
175         @echo "Copying files to distribution directory"
176         @git clone $(srcdir) $(distdir)
177         @chmod 755 $(distdir)
178         @for file in $(DISTINCLUDE); do \
179           cp -p $(srcdir)/$$file $(distdir)/$$file; \
180           touch $(distdir)/$$file; \
181         done
182         @for file in $(DISTEXCLUDE); do \
183           rm -rf $(distdir)/$$file; \
184         done
185         @chmod -R a+r $(distdir)
186         tar chf - $(distdir) | gzip -c > $(tarfile)
187         @rm -rf $(distdir) distname
188         @echo "Done building mmh-$(VERSION) distribution"