| 1 |
# Common Makefile material for package Makefiles |
# Common Makefile material for package Makefiles |
| 2 |
# Copyright (C) 1997 Free Software Foundation Inc. |
# Copyright (C) 1997 Free Software Foundation Inc. |
| 3 |
|
# Copyright (C) 2002 Ben Wing. |
| 4 |
|
|
| 5 |
# This file is part of XEmacs. |
# This file is part of XEmacs. |
| 6 |
|
|
| 28 |
|
|
| 29 |
DEPENDS_FILE_NAME = pdepends.mk |
DEPENDS_FILE_NAME = pdepends.mk |
| 30 |
|
|
| 31 |
# Make this the first target |
all: autoloads bytecompile |
| 32 |
bytecompile:: all |
|
| 33 |
|
bytecompile:: compile |
| 34 |
|
|
| 35 |
include ${XEMACS_PACKAGES_BASE}/Local.rules.mk |
include ${XEMACS_PACKAGES_BASE}/Local.rules.mk |
| 36 |
-include ${XEMACS_PACKAGES_BASE}/Local.rules |
-include ${XEMACS_PACKAGES_BASE}/Local.rules |
| 61 |
.SUFFIXES: |
.SUFFIXES: |
| 62 |
.SUFFIXES: .html .info .txi .texi .texinfo .dvi .elc .el |
.SUFFIXES: .html .info .txi .texi .texinfo .dvi .elc .el |
| 63 |
|
|
| 64 |
|
# STAGING is the top of the directory tree where a particular package's |
| 65 |
|
# files are installed, or where tarballs are installed using `make bindist'. |
| 66 |
|
|
| 67 |
|
# 'make bindist' needs STAGING to be set to NONMULE_INSTALLED_PACKAGES_ROOT |
| 68 |
|
# if we are building a Mule package so we don't end up with 2 package-index |
| 69 |
|
# files. (Unsupported packages have a separate package-index-unsupported, |
| 70 |
|
# so this doesn't apply to them.) |
| 71 |
|
|
| 72 |
|
ifeq ('$(CATEGORY)','unsupported') |
| 73 |
|
STAGING:= $(UNSUPPORTED_INSTALLED_PACKAGES_ROOT) |
| 74 |
|
else |
| 75 |
|
ifeq ('$(MAKECMDGOALS)','bindist') |
| 76 |
|
STAGING:= $(NONMULE_INSTALLED_PACKAGES_ROOT) |
| 77 |
|
else |
| 78 |
|
ifeq ('$(CATEGORY)','mule') |
| 79 |
|
STAGING:= $(MULE_INSTALLED_PACKAGES_ROOT) |
| 80 |
|
else |
| 81 |
|
STAGING:= $(NONMULE_INSTALLED_PACKAGES_ROOT) |
| 82 |
|
endif |
| 83 |
|
endif |
| 84 |
|
endif |
| 85 |
|
|
| 86 |
|
# If something goes wrong and $(STAGING) is blank, the commands below will |
| 87 |
|
# attempt to install files into absolute paths /lisp/* and /etc/* -- not |
| 88 |
|
# a good idea at all. |
| 89 |
|
|
| 90 |
|
check-staging: |
| 91 |
|
ifeq ($(STAGING),) |
| 92 |
|
$(error STAGING is not set; potential major filesystem trashing! Fix this) |
| 93 |
|
endif |
| 94 |
|
|
| 95 |
FORMAT_INFO_LEVEL_3_USING_XEMACS_NO_SAVE_ARGS = -eval '(setq load-path (append (list "../../../xemacs-packages/texinfo" "../../../xemacs-packages/xemacs-base") load-path))' -l informat -l texinfmt -f texinfo-format-buffer |
FORMAT_INFO_LEVEL_3_USING_XEMACS_NO_SAVE_ARGS = -eval '(setq load-path (append (list "../../../xemacs-packages/texinfo" "../../../xemacs-packages/xemacs-base") load-path))' -l informat -l texinfmt -f texinfo-format-buffer |
| 96 |
|
|
| 97 |
%-ja.info: %-ja.texi |
%-ja.info: %-ja.texi |
| 98 |
$(XEMACS) -batch -q -no-site-file -insert $< \ |
$(XEMACS) $(BATCH) -insert $< \ |
| 99 |
-eval '(unless (featurep (quote mule)) (kill-emacs 0))' \ |
-eval '(unless (featurep (quote mule)) (kill-emacs 0))' \ |
| 100 |
$(FORMAT_INFO_LEVEL_3_USING_XEMACS_NO_SAVE_ARGS) \ |
$(FORMAT_INFO_LEVEL_3_USING_XEMACS_NO_SAVE_ARGS) \ |
| 101 |
-eval '(setq file-coding-system (quote iso-2022-7))' \ |
-eval '(setq file-coding-system (quote iso-2022-7))' \ |
| 104 |
%.info: %.texi |
%.info: %.texi |
| 105 |
$(MAKEINFO) $(MAKEINFO_FLAGS) -o $@ $< |
$(MAKEINFO) $(MAKEINFO_FLAGS) -o $@ $< |
| 106 |
|
|
| 107 |
html: $(HTML_DEP) |
html: check-staging $(HTML_DEP) |
| 108 |
ifneq ($(HTML_FILES),) |
ifneq ($(HTML_FILES),) |
| 109 |
@-mkdir -p $(STAGING)/html |
@-mkdir -p $(STAGING)/html |
| 110 |
endif |
endif |
| 112 |
$(RCOPY) $(addprefix $(PWD)/, $(HTML_FILES)) $(STAGING)/html |
$(RCOPY) $(addprefix $(PWD)/, $(HTML_FILES)) $(STAGING)/html |
| 113 |
endif |
endif |
| 114 |
%.html: %.txi |
%.html: %.txi |
| 115 |
$(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
# V 1.56k (with Cygwin) does not allow -p flag. Works fine without it. |
| 116 |
|
# $(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
| 117 |
|
$(TEXI2HTML) $(TEXI2HTML_FLAGS) $< |
| 118 |
%.html: %.texi |
%.html: %.texi |
| 119 |
$(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
# $(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
| 120 |
|
$(TEXI2HTML) $(TEXI2HTML_FLAGS) $< |
| 121 |
%.html: %.texinfo |
%.html: %.texinfo |
| 122 |
$(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
# $(TEXI2HTML) $(TEXI2HTML_FLAGS) -p $* $< |
| 123 |
|
$(TEXI2HTML) $(TEXI2HTML_FLAGS) $< |
| 124 |
|
|
| 125 |
FORMAT_INFO_USING_XEMACS_NO_SAVE_ARGS = -eval '(setq load-path (append (list "../../xemacs-packages/texinfo" "../../xemacs-packages/xemacs-base") load-path))' -l informat -l texinfmt -f texinfo-format-buffer |
FORMAT_INFO_USING_XEMACS_NO_SAVE_ARGS = -eval '(setq load-path (append (list "../../xemacs-packages/texinfo" "../../xemacs-packages/xemacs-base") load-path))' -l informat -l texinfmt -f texinfo-format-buffer |
| 126 |
|
|
| 145 |
endif |
endif |
| 146 |
|
|
| 147 |
# Behaves like an XEmacs with the required packages setup |
# Behaves like an XEmacs with the required packages setup |
| 148 |
BOOT_XEMACS= $(XEMACS) -no-autoloads -batch -l $(PACKAGE_COMPILE) -- $(REQUIRES) -- $(PRELOADS) |
BOOT_XEMACS= $(XEMACS) -no-autoloads $(BATCH) -l $(PACKAGE_COMPILE) -- $(REQUIRES) -- $(PRELOADS) |
| 149 |
|
|
| 150 |
%.elc: %.el |
%.elc: %.el |
| 151 |
$(BOOT_XEMACS) -f batch-byte-compile $< |
$(BOOT_XEMACS) -f batch-byte-compile $< |
| 152 |
|
|
| 153 |
all:: $(AUTOLOAD_PATH)/_pkg.el |
compile:: $(AUTOLOAD_PATH)/_pkg.el |
| 154 |
|
|
| 155 |
dist:: binkit package-info |
dist:: binkit package-info |
| 156 |
|
|
| 184 |
# correctly. |
# correctly. |
| 185 |
|
|
| 186 |
elcclean: |
elcclean: |
| 187 |
$(XEMACS) $(VANILLA) -batch -l $(PACKAGE_CLEAN) |
$(XEMACS) $(BATCH) -l $(PACKAGE_CLEAN) |
| 188 |
|
|
| 189 |
# XEmacs native MS Windows needs this quoting of command-line |
# XEmacs native MS Windows needs this quoting of command-line |
| 190 |
# arguments due to basic differences in the handling of command-line |
# arguments due to basic differences in the handling of command-line |
| 201 |
endif |
endif |
| 202 |
|
|
| 203 |
$(AUTOLOAD_PATH)/auto-autoloads.el : $(ELCS:.elc=.el) $(AUTOLOAD_PATH)/_pkg.el |
$(AUTOLOAD_PATH)/auto-autoloads.el : $(ELCS:.elc=.el) $(AUTOLOAD_PATH)/_pkg.el |
| 204 |
$(XEMACS) $(VANILLA) -batch -no-autoloads \ |
$(XEMACS) $(BATCH) -no-autoloads \ |
| 205 |
-eval "$(AUTOLOAD_PACKAGE_NAME)" \ |
-eval "$(AUTOLOAD_PACKAGE_NAME)" \ |
| 206 |
-eval "$(AUTOLOAD_FILE)" \ |
-eval "$(AUTOLOAD_FILE)" \ |
| 207 |
-l autoload -f batch-update-autoloads $^ |
-l autoload -f batch-update-autoloads $^ |
| 208 |
@rm -f $(AUTOLOAD_PATH)/auto-autoloads.el~ |
@rm -f $(AUTOLOAD_PATH)/auto-autoloads.el~ |
| 209 |
|
|
| 210 |
$(AUTOLOAD_PATH)/custom-load.el : $(ELCS:.elc=.el) |
$(AUTOLOAD_PATH)/custom-load.el : $(ELCS:.elc=.el) |
| 211 |
$(XEMACS) $(VANILLA) -batch -l cus-dep \ |
$(XEMACS) $(BATCH) -l cus-dep \ |
| 212 |
-f Custom-make-dependencies $(AUTOLOAD_PATH) |
-f Custom-make-dependencies $(AUTOLOAD_PATH) |
| 213 |
|
|
| 214 |
pkg_tar = $(STAGING)/$(PACKAGE)-$(VERSION)-pkg.tar |
pkg_tar = $(STAGING)/$(PACKAGE)-$(VERSION)-pkg.tar |
| 226 |
# Make the $(pkg_tar).gz first, then the $(pkg_tar).bz2 |
# Make the $(pkg_tar).gz first, then the $(pkg_tar).bz2 |
| 227 |
package-info : package-info.in Makefile $(AUTOLOAD_PATH)/_pkg.el \ |
package-info : package-info.in Makefile $(AUTOLOAD_PATH)/_pkg.el \ |
| 228 |
$(pkg_tar).gz $(pkg_tar).bz2 |
$(pkg_tar).gz $(pkg_tar).bz2 |
| 229 |
$(XEMACS) $(VANILLA) -batch \ |
$(XEMACS) $(BATCH) \ |
| 230 |
-l package-info.elc -f batch-update-package-info \ |
-l package-info.elc -f batch-update-package-info \ |
| 231 |
'$(VERSION)' $(PKG_TAR_GZ) \ |
'$(VERSION)' $(PKG_TAR_GZ) \ |
| 232 |
'$(REQUIRES)' \ |
'$(REQUIRES)' \ |
| 233 |
'$(AUTHOR_VERSION)' '$(MAINTAINER)' '$(CATEGORY)' |
'$(AUTHOR_VERSION)' '$(MAINTAINER)' '$(CATEGORY)' |
| 234 |
$(XEMACS) $(VANILLA) -batch \ |
$(XEMACS) $(BATCH) \ |
| 235 |
-l ../../hack-package-index.el -f batch-hack-package-index \ |
-l ../../hack-package-index.el -f batch-hack-package-index \ |
| 236 |
$(PACKAGE) package-info $(PACKAGE_INFO) |
$(PACKAGE) package-info $(PACKAGE_INFO) $(CATEGORY) |
| 237 |
|
|
| 238 |
ifeq ($(BUILD_TARS),t) |
ifeq ($(BUILD_TARS),t) |
| 239 |
$(pkg_tar): $(STAGING)/$(MANIFEST) |
$(pkg_tar): $(STAGING)/$(MANIFEST) |
| 281 |
.PHONY: binkit-sourceonly binkit-sourceinfo binkit-sourcedata binkit-sourcedatainfo binkit-with-html |
.PHONY: binkit-sourceonly binkit-sourceinfo binkit-sourcedata binkit-sourcedatainfo binkit-with-html |
| 282 |
.PHONY: bindist install autoloads |
.PHONY: bindist install autoloads |
| 283 |
|
|
| 284 |
bindist: binkit package-info setup-info |
bindist: all binkit package-info setup-info |
| 285 |
|
|
| 286 |
setup-info: |
setup-info: |
| 287 |
$(XEMACS) $(VANILLA) -batch -l $(PACKAGE_NET_PACKAGES) \ |
$(XEMACS) $(BATCH) -l $(PACKAGE_NET_PACKAGES) \ |
| 288 |
-l $(PACKAGE_INFO) \ |
-l $(PACKAGE_INFO) \ |
| 289 |
-f package-net-packages-batch-convert-index-to-ini $(PACKAGE_STAGING) |
-f package-net-packages-batch-convert-index-to-ini $(PACKAGE_STAGING) $(CATEGORY) |
| 290 |
|
|
| 291 |
install: binkit |
install: all binkit |
| 292 |
|
|
| 293 |
autoloads: $(AUTOLOAD_PATH)/auto-autoloads.el |
just-install: binkit |
| 294 |
|
|
| 295 |
|
autoloads: $(AUTOLOAD_PATH)/auto-autoloads.el |
| 296 |
|
|
| 297 |
binkit-common: all |
binkit-common: check-staging |
| 298 |
(if test -d $(STAGING); then \ |
(if test -d $(STAGING); then \ |
| 299 |
cd $(STAGING); \ |
cd $(STAGING); \ |
| 300 |
if test -f $(MANIFEST); then \ |
if test -f $(MANIFEST); then \ |