1 ##--------------------------------------------------------------------------##
3 ## $Id: Makefile,v 1.35 2002/10/01 22:49:46 ehood Exp $
5 ## Administrative makefile for mailing list archives.
6 ##--------------------------------------------------------------------------##
7 ## Copyright (C) 2001-2002 Earl Hood <earl@earlhood.com>
9 ## This program is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
14 ## This program is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ## GNU General Public License for more details.
19 ## You should have received a copy of the GNU General Public License
20 ## along with this program; if not, write to the Free Software
21 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23 ##--------------------------------------------------------------------------##
25 .PHONY
: default editidx rebuild rootidx
dist enable disable readmail \
26 help editidxonly release
clean distclean configure mhonarc-check \
27 doc doc_pod doc_file doc_install
29 INSTALL_PL
= .
/install.pl
30 APPLY_CONFIG
= .
/bin
/apply-config
31 COMPRESS_FILES
= .
/bin
/compress-files
32 COMPRESS_MBOXES
= .
/bin
/compress-mboxes
33 CONFIG_CHECK
= .
/bin
/config-check
34 FILTER_SPOOL
= .
/bin
/filter-spool
35 LOG_CMD
= .
/bin
/logcmd
36 MBOX_MONTH_PACK
= .
/bin
/mbox-month-pack
37 MHA_CHECK
= .
/bin
/mhonarc-check
38 MH_MONTH_PACK
= .
/bin
/mh-month-pack
39 MK_PROCMAILRC
= .
/bin
/mk-procmailrc
40 READ_MAIL
= .
/bin
/read-mail
41 WEB_ARCHIVE
= .
/bin
/web-archive
59 CONFIG_SH
= .
/lib
/config.sh
60 LIST_DEF
= .
/lib
/lists.def
62 NO_ARCHIVE
= .noarchive
63 PROCMAIL_RC
= procmailrc.mharc
76 ##--------------------------------------------------------------------------##
80 procmailrc
: mhonarc-check
84 -$(PERL
) $(WEB_ARCHIVE
) -verbose
-editidx
-nosearch
$(MLISTS
)
85 -@echo
"============================================================="
86 -@echo
"!!! Auto-archive processing is DISABLED !!!"
87 -@echo
"============================================================="
90 -$(PERL
) $(WEB_ARCHIVE
) -verbose
-editidxonly
-nosearch
$(MLISTS
)
91 -@echo
"============================================================="
92 -@echo
"!!! Auto-archive processing is DISABLED !!!"
93 -@echo
"============================================================="
96 -$(PERL
) $(WEB_ARCHIVE
) -verbose
-editrootidx
-nosearch
$(MLISTS
)
97 -@echo
"============================================================="
98 -@echo
"!!! Auto-archive processing is DISABLED !!!"
99 -@echo
"============================================================="
102 -$(PERL
) $(WEB_ARCHIVE
) -verbose
-rebuild
$(MLISTS
)
103 -@echo
"============================================================="
104 -@echo
"!!! Auto-archive processing is DISABLED !!!"
105 -@echo
"============================================================="
108 -$(PERL
) $(WEB_ARCHIVE
) -verbose
-editrootidx
$(MLISTS
)
111 @
$(RM
) -f
$(NO_ARCHIVE
)
112 -@echo
"============================================================="
113 -@echo
"!!! Auto-archive processing is ENABLED !!!"
114 -@echo
"============================================================="
117 @
$(TOUCH
) $(NO_ARCHIVE
)
118 -@echo
"============================================================="
119 -@echo
"!!! Auto-archive processing is DISABLED !!!"
120 -@echo
"============================================================="
123 $(READ_MAIL
) -verbose
-force
126 -@
$(MKDIR
) -p log mbox html
127 @if
[ ! -f
$(CONFIG_SH
) ]; then \
128 $(CP
) $(CONFIG_SH
).
dist $(CONFIG_SH
); \
129 $(CHMOD
) u
+w
$(CONFIG_SH
); \
131 @if
[ ! -f
$(LIST_DEF
) ]; then \
132 $(CP
) $(LIST_DEF
).
dist $(LIST_DEF
); \
133 $(CHMOD
) u
+w
$(LIST_DEF
); \
135 $(APPLY_CONFIG
) -verbose
137 -@echo
"============================================================="
138 -@echo
"* Make sure to rerun 'make configure' when you change"
139 -@echo
"* lib/config.sh or change a .in template file."
140 -@echo
"============================================================="
142 mhonarc-check
: _FORCE
146 -@echo
"Targets available:"
147 -@echo
" (default) Generate $(PROCMAIL_RC) from $(LIST_DEF)."
148 -@echo
" configure: Apply $(CONFIG_SH) settings."
149 -@echo
" disable: Disable automated processing of new messages."
150 -@echo
" editidx: Edit all mhonarc archive pages."
151 -@echo
" editidxonly: Edit only mhonarc archive index pages."
152 -@echo
" editrootidx: Edit only top period index pages."
153 -@echo
" enable: Enable automated processing of new messages."
154 -@echo
" help: This message."
155 -@echo
" readmail: Process mail spool."
156 -@echo
" rebuild: Rebuild archives from raw message data."
157 -@echo
" rootidx: Regenerated top index for archives."
159 -@echo
"NOTE: Targets that modify archives run with debugging enabled."
160 -@echo
"NOTE: 'editidx', 'editidxonly', and 'rebuild' automatically"
161 -@echo
" disable auto-processing. Execute 'enable' target to"
163 -@echo
"CAUTION: The 'clean' target should not have to be invoked."
164 -@echo
" But if done, it removes all .in generated files. The"
165 -@echo
" 'configure' target can be executed to regenerate"
166 -@echo
" file from templates"
167 -@echo
"WARNING: The 'dist' and 'distclean' targets should only be"
168 -@echo
" invoked IF YOU KNOW WHAT YOU ARE DOING!"
171 # Dummy target to force building of other targets
174 ##--------------------------------------------------------------------------##
175 ## The following targets are mainly intended by mharc developers
176 ## and used for creating releases
177 ##--------------------------------------------------------------------------##
179 DIST_BUNDLE
= mharc-
$(_RELEASE_VERSION
).
tar
181 # List of files/dirs to be included in distribtion bundle
182 # NOTE: The leading '.' is important.
195 .
/html
/stylesheet.css
* \
200 # List of files/dirs to explicitly exclude from distribtion bundle
201 # NOTE: The leading '.' is important.
203 .
/etc
/release-mharc \
206 TAR_EXC_FILE
= dist/.dist-exclude
210 release
: syntax_check
dist
214 @
$(MKDIR
) -p
dist/mharc
215 @
$(FIND
) .
-name
'CVS' -print > $(TAR_EXC_FILE
)
216 @
$(FIND
) .
-name
'.*.sw*' -print >> $(TAR_EXC_FILE
)
217 @for i in
$(DIST_EXC_FILES
); do \
218 echo
$$i >> $(TAR_EXC_FILE
); \
223 -f
- $(DIST_FILES
) |
(cd
dist/mharc
; tar xfp
-)
224 @
(cd
dist/mharc
&& $(MAKE
) distclean)
225 @
(cd
dist/mharc
&& $(MAKE
) doc
)
226 @
(cd
dist/mharc
&& $(MAKE
) doc_pod
)
227 @
(cd
dist/mharc
&& echo
"$(_RELEASE_VERSION)" > VERSION
)
228 @
$(MV
) dist/mharc
dist/mharc-
$(_RELEASE_VERSION
)
229 @
(cd
dist && $(TAR
) cvf
$(DIST_BUNDLE
) mharc-
$(_RELEASE_VERSION
))
230 @
(cd
dist && $(GZIP
) $(DIST_BUNDLE
))
233 @for i in
$(PERL_PRGS
); do \
234 echo
"Checking $$i syntax..."; \
238 # doc_pod listed twice to resolve xrefs
239 doc
: doc_pod doc_file doc_install
242 -@mkdir
-p .
/doc
/bin .
/doc
/lib .
/doc
/file
243 @for i in
$(PRGS
); do \
244 echo
"processing $$i..." ; \
245 pod2html
--header
--infile
=$$i \
248 --podpath
='bin:lib' \
249 --outfile
=.
/doc
/bin
/`basename $$i`.html
; \
251 @for i in
`find ./lib/MHArc -name '*.pm' -print`; do \
252 echo
"processing $$i..." ; \
257 --podpath
='bin:lib' \
258 --outfile
=.
/doc
/lib
/MHArc
::`basename $$i`.html
; \
260 @
$(RM
) -f pod2htm
*.x~~
263 $(CP
) -f Makefile .
/doc
/file
/Makefile.txt
264 $(CP
) -f .
/lib
/common.mrc.in.
dist .
/doc
/file
/common.mrc.txt
265 $(CP
) -f .
/lib
/config.sh.
dist .
/doc
/file
/config.sh.txt
266 $(CP
) -f .
/lib
/lists.def.
dist .
/doc
/file
/lists.def.txt
267 $(CP
) -f .
/etc
/apache.conf.in.
dist .
/doc
/file
/apache.conf.txt
268 $(CP
) -f .
/etc
/crontab.in.
dist .
/doc
/file
/crontab.txt
269 $(CP
) -f .
/etc
/.htaccess.in.
dist .
/doc
/file
/htaccess.txt
272 w3m
-dump
-cols
76 .
/doc
/install.html
> INSTALL
275 $(APPLY_CONFIG
) -distclean -verbose
276 $(RM
) -f
$(CONFIG_SH
) $(CONFIG_SH
).cache.pl
$(LIST_DEF
) VERSION INSTALL
277 $(RM
) -rf .
/dist .
/doc
/bin .
/doc
/lib .
/doc
/file
280 $(RM
) -f
$(PROCMAIL_RC
)
281 $(APPLY_CONFIG
) -clean -verbose