1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
|
# Makefile for MH-E.
# Copyright (C) 2003, 2004, 2005, 2006 Bill Wohler
# This file is part of MH-E.
# MH-E is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# MH-E is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with MH-E; see the file COPYING. If not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# Note: most changes to this file should also be mirrored in the Makefiles in
# $(TOP)/doc and $(TOP)/contrib.
#
TOP = ..
CVSROOT = cvs.savannah.gnu.org:/cvsroot/emacs
CVSLOGIN = anoncvs
# Developers can use "ext".
CVSMETHOD = pserver
# Program to install files
INSTALL = install -m 644
# MH-E source.
MH_E_SRC = \
emacs/lisp/mh-e/mh-alias.el \
emacs/lisp/mh-e/mh-buffers.el \
emacs/lisp/mh-e/mh-comp.el \
emacs/lisp/mh-e/mh-e.el \
emacs/lisp/mh-e/mh-folder.el \
emacs/lisp/mh-e/mh-funcs.el \
emacs/lisp/mh-e/mh-identity.el \
emacs/lisp/mh-e/mh-inc.el \
emacs/lisp/mh-e/mh-junk.el \
emacs/lisp/mh-e/mh-letter.el \
emacs/lisp/mh-e/mh-limit.el \
emacs/lisp/mh-e/mh-mime.el \
emacs/lisp/mh-e/mh-print.el \
emacs/lisp/mh-e/mh-scan.el \
emacs/lisp/mh-e/mh-search.el \
emacs/lisp/mh-e/mh-seq.el \
emacs/lisp/mh-e/mh-show.el \
emacs/lisp/mh-e/mh-speed.el \
emacs/lisp/mh-e/mh-thread.el \
emacs/lisp/mh-e/mh-tool-bar.el \
emacs/lisp/mh-e/mh-utils.el \
emacs/lisp/mh-e/mh-xface.el
MH_E_OBJ = $(MH_E_SRC:.el=.elc)
MH_E_SRC_NONCOMPILED = \
emacs/lisp/mh-e/mh-acros.el \
emacs/lisp/mh-e/mh-compat.el \
emacs/lisp/mh-e/mh-gnus.el
MH_E_XEMACS_SRC = mh-xemacs.el
MH_E_XEMACS_OBJ = $(MH_E_XEMACS_SRC:.el=.elc)
# Automatically generated files.
MH_E_LOADDEFS = emacs/lisp/mh-e/mh-loaddefs.el
MH_E_LOADDEFS_SRC = $(MH_E_SRC)
MH_E_AUTOLOADS = emacs/lisp/mh-e/mh-autoloads.el
MH_E_CUSTOM_LOAD = emacs/lisp/mh-e/mh-cus-load.el
MH_E_AUTOGEN = \
$(MH_E_AUTOLOADS) \
$(MH_E_CUSTOM_LOAD) \
$(MH_E_LOADDEFS)
# Emacs images needed by MH-E.
# These names are duplicated in mh-xemacs.el and mh-tool-bar.el.
MH_E_IMG = \
emacs/etc/images/attach.pbm \
emacs/etc/images/attach.xpm \
emacs/etc/images/contact.pbm \
emacs/etc/images/contact.xpm \
emacs/etc/images/copy.pbm \
emacs/etc/images/copy.xpm \
emacs/etc/images/cut.pbm \
emacs/etc/images/cut.xpm \
emacs/etc/images/data-save.pbm \
emacs/etc/images/data-save.xpm \
emacs/etc/images/delete.pbm \
emacs/etc/images/delete.xpm \
emacs/etc/images/help.pbm \
emacs/etc/images/help.xpm \
emacs/etc/images/left-arrow.pbm \
emacs/etc/images/left-arrow.xpm \
emacs/etc/images/mail/compose.pbm \
emacs/etc/images/mail/compose.xpm \
emacs/etc/images/mail/flag-for-followup.pbm \
emacs/etc/images/mail/flag-for-followup.xpm \
emacs/etc/images/mail/inbox.pbm \
emacs/etc/images/mail/inbox.xpm \
emacs/etc/images/mail/move.pbm \
emacs/etc/images/mail/move.xpm \
emacs/etc/images/mail/repack.pbm \
emacs/etc/images/mail/repack.xpm \
emacs/etc/images/mail/reply-all.pbm \
emacs/etc/images/mail/reply-all.xpm \
emacs/etc/images/mail/reply-from.pbm \
emacs/etc/images/mail/reply-from.xpm \
emacs/etc/images/mail/reply-to.pbm \
emacs/etc/images/mail/reply-to.xpm \
emacs/etc/images/mail/reply.pbm \
emacs/etc/images/mail/reply.xpm \
emacs/etc/images/mail/send.pbm \
emacs/etc/images/mail/send.xpm \
emacs/etc/images/mh-logo.xpm \
emacs/etc/images/next-page.pbm \
emacs/etc/images/next-page.xpm \
emacs/etc/images/open.pbm \
emacs/etc/images/open.xpm \
emacs/etc/images/paste.pbm \
emacs/etc/images/paste.xpm \
emacs/etc/images/preferences.pbm \
emacs/etc/images/preferences.xpm \
emacs/etc/images/refresh.pbm \
emacs/etc/images/refresh.xpm \
emacs/etc/images/right-arrow.pbm \
emacs/etc/images/right-arrow.xpm \
emacs/etc/images/search.pbm \
emacs/etc/images/search.xpm \
emacs/etc/images/save.pbm \
emacs/etc/images/save.xpm \
emacs/etc/images/show.pbm \
emacs/etc/images/show.xpm \
emacs/etc/images/spell.pbm \
emacs/etc/images/spell.xpm \
emacs/etc/images/undo.pbm \
emacs/etc/images/undo.xpm \
emacs/etc/images/zoom-out.pbm \
emacs/etc/images/zoom-out.xpm
# Other MH-E files.
MH_E_ETC = \
COPYING \
ChangeLog \
ChangeLog.1 \
Makefile \
README \
emacs/etc/MH-E-NEWS \
emacs/lisp/mh-e/ChangeLog \
emacs/lisp/mh-e/ChangeLog.1
# MH-E maintainer files.
MH_E_MAINT = \
.cvsignore \
emacs/lisp/mh-e/.cvsignore \
mh-unit.el \
release-utils
# MH-E files for distribution.
MH_E_DIST_NOAUTOGEN = \
$(MH_E_SRC) \
$(MH_E_SRC_NONCOMPILED) \
$(MH_E_XEMACS_SRC) \
$(MH_E_IMG) \
$(MH_E_ETC)
# MH-E files for distribution, including automatically generated files.
MH_E_DIST = \
$(MH_E_DIST_NOAUTOGEN) \
$(MH_E_AUTOGEN)
# All MH-E files, excluding automatically generated files.
MH_E_ALL = \
$(MH_E_DIST_NOAUTOGEN) \
$(MH_E_MAINT)
# Compiling variables.
EMACS = emacs
# emacs/lisp/mh-e only needed by custom-deps on Emacs 21.
EMACS_OPTIONS = --batch --no-site-file --multibyte \
--eval "(setq load-path (cons \".\" (cons \"emacs/lisp/mh-e\" load-path)))"
EMACS_LOADDEFS_COOKIE = \
--eval "(setq generate-autoload-cookie \";;;\#\#\#mh-autoload\")"
# autoload-package-name needed by XEmacs; harmless on GNU Emacs.
EMACS_EXPORT_MH_LOADDEFS = \
--eval "(setq generated-autoload-file (expand-file-name \"$(MH_E_LOADDEFS)\"))" \
--eval "(setq make-backup-files nil)" \
--eval "(setq autoload-package-name \"mh-loaddefs\")"
EMACS_EXPORT_MH_AUTOLOADS = \
--eval "(setq generated-autoload-file (expand-file-name \"$(MH_E_AUTOLOADS)\"))" \
--eval "(setq make-backup-files nil)" \
--eval "(setq autoload-package-name \"mh\")"
COMPILE_COMMAND = $(EMACS) $(EMACS_OPTIONS)
# XEmacs variables.
XEMACS = false
XEMACS_OPTIONS = --batch --vanilla \
--eval "(setq load-path (cons (expand-file-name \"emacs/lisp/mh-e\") load-path))" \
--eval "(setq load-path (cons \".\" load-path))"
# Since sed did not support the -i (--inplace) option at the time of
# the initial Emacs 21 release, use a temporary file instead of sed -i
# as long as we support Emacs 21. Solaris 9 sed also had problems
# using an expression to insert multiple lines starting at line 2 of
# the file, so we may end up keeping an intermediate temporary file as
# a workaround for longer than just support of the Emacs 21 release.
MH_E_TMP = /tmp/mh-e$$$$
# Default target. Works for both Emacs and XEmacs.
all: emacs
case $(EMACS) in \
*xemacs*) \
$(MAKE) EMACS='$(EMACS)' \
EMACS_OPTIONS='$(XEMACS_OPTIONS)' \
XEMACS=: \
xemacs ;;\
*) \
$(MAKE) EMACS='$(EMACS)' \
Emacs ;;\
esac
# Check out emacs directory if necessary.
emacs:
cvs -d :$(CVSMETHOD):$(CVSLOGIN)@$(CVSROOT) co emacs/lisp/mh-e
cvs -d :$(CVSMETHOD):$(CVSLOGIN)@$(CVSROOT) co -l emacs/etc/MH-E-NEWS \
emacs/etc/NEWS emacs/etc/ChangeLog \
emacs/etc/images emacs/etc/images/mail
emacs-devel:
cvs -d $(USER)@$(CVSROOT) co emacs
# The .PHONY targets are always considered to be out-of-date.
# This rule needs to be after the ``all'' rule for compatibility
# with old versions of make.
.PHONY: all clean compile Emacs emacs-devel
# Ensure clean compile which is advised since old .elc files can
# interfere with the compilation process.
Emacs: clean loaddefs compile autoloads custom-deps
# Remove everything we make.
clean::
rm -rf $(MH_E_OBJ) $(MH_E_AUTOGEN)
# Compile MH-E. See $EMACS_HOME/lisp/Makefile for commentary.
compile: $(MH_E_SRC)
$(COMPILE_COMMAND) -f batch-byte-compile $?
# Automatically extract internal autoloads.
MH_E_LOADDEFS_HEADER =\
";;; mh-loaddefs.el --- automatically extracted internal autoloads for MH-E\
\n;;\
\n;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.\
\n;; Author: Bill Wohler <wohler@newt.com>\
\n;; Keywords: mail\
\n;;; Commentary:\
\n;;; Change Log:\
\n;;; Code:\n\n"
MH_E_LOADDEFS_FOOTER =\
"\f\
\n(provide 'mh-loaddefs)\
\n;; Local Variables:\
\n;; version-control: never\
\n;; no-byte-compile: t\
\n;; no-update-autoloads: t\
\n;; End:\
\n;;; mh-loaddefs.el ends here\n"
.PHONY: loaddefs
loaddefs: $(MH_E_LOADDEFS)
$(MH_E_LOADDEFS): $(MH_E_LOADDEFS_SRC)
# For XEmacs, the autoload file must not be present.
if $(XEMACS); then :; else \
printf $(MH_E_LOADDEFS_HEADER) > $@; \
fi
$(COMPILE_COMMAND) \
-l autoload \
$(EMACS_LOADDEFS_COOKIE) \
$(EMACS_EXPORT_MH_LOADDEFS) \
-f batch-update-autoloads emacs/lisp/mh-e
# Prepend the header in case of XEmacs.
if $(XEMACS); then \
(printf $(MH_E_LOADDEFS_HEADER); cat $@) > $(MH_E_TMP); \
mv $(MH_E_TMP) $@; \
fi; \
printf $(MH_E_LOADDEFS_FOOTER) >> $@
# Automatically extract external autoloads.
MH_E_AUTOLOADS_HEADER =\
";;; mh-autoloads.el --- automatically extracted external autoloads for MH-E\
\n\
\n;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.\
\n;; Author: Bill Wohler <wohler@newt.com>\
\n;; Keywords: mail\
\n;;; Commentary:\
\n\
\n;; If you installed MH-E separately from Emacs, you can set up its entry\
\n;; points using the following in your .emacs file:\
\n\
\n;; (require 'mh-autoloads)\
\n\
\n;;; Change Log:\
\n;;; Code:\n\n"
MH_E_AUTOLOADS_FOOTER =\
"\f\
\n(provide 'mh-autoloads)\
\n;; Local Variables:\
\n;; version-control: never\
\n;; no-byte-compile: t\
\n;; no-update-autoloads: t\
\n;; End:\
\n;;; mh-autoloads.el ends here\n"
.PHONY: autoloads
autoloads: $(MH_E_AUTOLOADS)
$(MH_E_AUTOLOADS): $(MH_E_SRC)
# In GNU Emacs, the autoloads must be present; in XEmacs, it must not.
if $(XEMACS); then :; else \
printf $(MH_E_AUTOLOADS_HEADER) > $@; \
fi
$(COMPILE_COMMAND) \
-l autoload \
$(EMACS_EXPORT_MH_AUTOLOADS) \
-f batch-update-autoloads emacs/lisp/mh-e
# Prepend the header in case of XEmacs.
if $(XEMACS); then \
(printf $(MH_E_AUTOLOADS_HEADER); cat $@) > $(MH_E_TMP); \
mv $(MH_E_TMP) $@; \
fi; \
printf $(MH_E_AUTOLOADS_FOOTER) >> $@
# Automatically extract custom autoloads.
# Emacs 22 has generated-custom-dependencies-file, but Emacs 21 hard-codes
# the output file to cus-load.el. XEmacs has cusload-base-file which is set to
# custom-load.el.
MH_E_CUSTOM_LOAD_HEADER =\
"\
\n;; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.\
\n;; Author: Bill Wohler <wohler@newt.com>\
\n;; Keywords: mail\
\n;;; Commentary:\
\n\
\n;; If you installed MH-E separately from Emacs, you can set up its custom\
\n;; dependencies using the following in your .emacs file:\
\n\
\n;; (require 'mh-cus-load)\
\n\
\n;;; Change Log:\n\n"
MH_E_CUSTOM_LOAD_FOOTER =\
"\f\
\n(provide 'mh-cus-load)\
\n;; Local Variables:\
\n;; version-control: never\
\n;; no-byte-compile: t\
\n;; no-update-autoloads: t\
\n;; End:\n"
.PHONY: custom-deps
custom-deps: $(MH_E_CUSTOM_LOAD)
$(MH_E_CUSTOM_LOAD): $(MH_E_SRC)
if $(XEMACS); then \
$(COMPILE_COMMAND) \
-l cus-dep -l emacs/lisp/mh-e/mh-e \
-f Custom-make-dependencies emacs/lisp/mh-e; \
(sed -e "s/custom-load/mh-cus-load/" \
emacs/lisp/mh-e/custom-load.el; \
printf $(MH_E_CUSTOM_LOAD_FOOTER)) > $(MH_E_TMP); \
rm -f emacs/lisp/mh-e/custom-load.el; \
else \
$(COMPILE_COMMAND) \
-l cus-dep -l emacs/lisp/mh-e/mh-e \
-f custom-make-dependencies emacs/lisp/mh-e; \
sed -e "s/cus-load/mh-cus-load/" cus-load.el > $(MH_E_TMP); \
rm -f cus-load.el; \
fi; \
(sed -e 2,\$$d $(MH_E_TMP); \
printf $(MH_E_CUSTOM_LOAD_HEADER); \
sed -e 1d $(MH_E_TMP)) > $@; \
rm -f $(MH_E_TMP)
# XEmacs targets.
.PHONY: xemacs compile-xemacs
xemacs: clean loaddefs compile-xemacs autoloads custom-deps
clean::
rm -rf $(MH_E_XEMACS_OBJ)
compile-xemacs: $(MH_E_SRC) $(MH_E_XEMACS_SRC)
$(COMPILE_COMMAND) -l bytecomp -f batch-byte-compile $?
#
# The following targets are only of interest to maintainers.
#
.PHONY: install-maint tag dist
# Installs MH-E outside of the source directory to provide a stable
# environment while developing. Two variables are used:
#
# INSTALL_LISP_DIR - installation directory for compiled .elc and
# non-compiled .el files
# INSTALL_IMG_DIR - installation directory for images
#
install-maint:
@if [ -z "$(INSTALL_LISP_DIR)" -o ! -d "$(INSTALL_LISP_DIR)" ]; then \
echo "Set INSTALL_LISP_DIR to an existing directory where" \
"lisp files should be installed."; \
else \
$(INSTALL) -c $(MH_E_SRC_NONCOMPILED) $(MH_E_OBJ) \
$(MH_E_AUTOGEN) $(INSTALL_LISP_DIR); \
for file in $(MH_E_XEMACS_OBJ); do \
if [ -f $$file ]; then \
$(INSTALL) -c $$file $(INSTALL_LISP_DIR); \
fi \
done; \
fi
@if [ -z "$(INSTALL_IMG_DIR)" -o ! -d "$(INSTALL_IMG_DIR)" ]; then \
echo "Set INSTALL_IMG_DIR to an existing directory where" \
"images should be installed."; \
else \
$(INSTALL) -c $(MH_E_IMG) $(INSTALL_IMG_DIR); \
fi
# Tag the MH-E files that are checked out.
tag:
@TAG=$(TAG) release-utils --tag $(MH_E_ALL)
# Create a distribution suitable for installing at SourceForge.
dist: all
@release-utils --dist $(MH_E_DIST)
# The unit test that finds unused code runs much faster when compiled.
clean::
rm -f mh-unit.elc
mh-unit.elc: mh-unit.el
$(COMPILE_COMMAND) -f batch-byte-compile $?
# Back up MH-E CVS files at Savannah.
MH_BACKUP_DIR = ../backup
MH_DIRS = sources/emacs/emacs/lisp/mh-e
MH_FILES = emacs/etc/MH-E-NEWS $(MH_E_IMG)
backup:
@[ -d $(MH_BACKUP_DIR) ] || mkdir $(MH_BACKUP_DIR)
@(host=`echo $(CVSROOT) | awk -F: '{print $$1}'` \
set $(MH_FILES); \
files=`for i; do \
echo -n $$i|sed -e 's/^/sources\/emacs\//' -e 's/$$/,v /';\
done`; \
set $(MH_DIRS) $$files; \
for file; do \
rsync -aziR $$host::$$file $(MH_BACKUP_DIR); \
done;)
|