Anonymous avatar Anonymous committed 864c565

To: xemacs-patches@xemacs.org

Local.rules.template: Group settings together. Put XEmacs binary in XEMACS_BINARY
not XEMACS (XEMACS may be a wrapper). Track ever-changing
Cygwin semantics. tex etc. is not broken on Cygwin, you just
need to install the right packages -- document this.
XEmacs.rules, iterate.rules, meta-iterate.rules, Local.rules.inc, Version.rules, iterate-1.rules, meta-template.rules: Factor out repetitive code into meta-template.rules and
iterate-1.rules. Add some missing targets. New genclean
target for removing just generated files. Make sure that
`make install' actually does everything that `make' does
before installing; same for `make bindist'.

Comments (0)

Files changed (9)

+2004-11-07  Ben Wing  <ben@xemacs.org>
+
+	* Local.rules.template:
+	* Local.rules.template (XEMACS_BINARY):
+	Group settings together.  Put XEmacs binary in XEMACS_BINARY
+	not XEMACS (XEMACS may be a wrapper).  Track ever-changing
+	Cygwin semantics.  tex etc. is not broken on Cygwin, you just
+	need to install the right packages -- document this.
+
+	* XEmacs.rules:
+	* XEmacs.rules (distclean):
+	* XEmacs.rules (setup-info):
+	* XEmacs.rules (.PHONY):
+	* XEmacs.rules (binkit):
+	* iterate.rules:
+	* iterate.rules (ITERATE):
+	* iterate.rules (.PHONY):
+	* meta-iterate.rules:
+	* meta-iterate.rules (ITERATE):
+	* meta-iterate.rules (macro-list):
+	* meta-iterate.rules (World):
+	* Local.rules.inc:
+	* Version.rules:
+	* Version.rules (bindist):
+	* Version.rules (binkit):
+	* Version.rules (bytecompile):
+	* Version.rules (compile):
+	* Version.rules (extraclean):
+	* Version.rules (genclean):
+	* Version.rules (install-for-bindist):
+	* Version.rules (install-only):
+	* Version.rules (pdepends.mk):
+	* iterate-1.rules: New.
+	* meta-template.rules: New.
+	Factor out repetitive code into meta-template.rules and
+	iterate-1.rules.  Add some missing targets.  New genclean
+	target for removing just generated files.  Make sure that
+	`make install' actually does everything that `make' does
+	before installing; same for `make bindist'.
+
 2004-10-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Packages released: semantic.
 
 DEPENDS_FILE_NAME = pdepends.mk
 
-all: autoloads bytecompile
+include ${XEMACS_PACKAGES_BASE}/meta-targets.rules
 
 bytecompile:: compile
 

Local.rules.template

 # Path to XEmacs to use for byte compilation.
 #
 # (Double-quote path under native MS Windows if there are embedded spaces.)
-XEMACS = xemacs
+XEMACS_BINARY = xemacs
 
 # Are we running XEmacs 21.5 or greater?  If set, this will generate
 # custom-defines.el files for use with Custom (esp. the Custom menu), and
 #
 symlink = 
 
+# If `t', the build process will build and install .html versions of the
+# doc files.  NOTE: texi2html 1.56k (#### perhaps 1.64 is better?) issues
+# complaints about a large number of files that pass `makeinfo' just fine.
+# This doesn't prevent it from building the .html files, though.
+#
+INSTALL_HTML =
+
 ##################### End settings that commonly need to be changed
 
+# How to actually run XEmacs.
+
+# Under MS Windows, when you run a non-console-mode program, stdin and
+# stdout don't normally point anywhere, even when you run the program from
+# a console (e.g. a DOS window)!  Hence the console-mode helper program
+# lib-src/i.exe was written.  Formerly, this was not needed when running
+# XEmacs from a Cygwin program, but at some point around 2003-2004 the
+# behavior of Cygwin was broken^H^H^H^H^H^Hchanged to match normal Windows
+# in this respect.
+
+ifeq ($(XEMACS_NATIVE_NT),t)
+XEMACS = $(dir $(XEMACS_BINARY))../lib-src/i $(XEMACS_BINARY)
+else
+XEMACS = $(XEMACS_BINARY)
+endif
+
+# Flags to run XEmacs from Makefiles.
+#
+VANILLA = -vanilla
+BATCH = $(VANILLA) -batch -eval '(setq stack-trace-on-error t load-always-display-messages t load-ignore-out-of-date-elc-files t load-show-full-path-in-messages t)'
+
 #
 # Where to install the non-Mule packages, or where the symlink tree will
 # go.  You probably don't want to change this.
 
 PACKAGE_INDEX = package-index
 
+#### Path to various programs
+
 # Path to BSD install.
 # INSTALL = ginstall -c
 #
 	--exclude '*.rej'			\
 	--exclude '.\#*'
 
-VANILLA = -vanilla
-
-# Flags to run XEmacs from Makefiles.
-#
-BATCH = $(VANILLA) -batch -eval '(setq stack-trace-on-error t load-always-display-messages t load-ignore-out-of-date-elc-files t load-show-full-path-in-messages t)'
-
 # path to makeinfo
 #
 MAKEINFO = makeinfo
 
-# If `t', the build process will build and install .html versions of the
-# doc files.  NOTE: texi2html 1.56k (#### perhaps 1.64 is better?) issues
-# complaints about a large number of files that pass `makeinfo' just fine.
-# This doesn't prevent it from building the .html files, though.
-#
-INSTALL_HTML =
-
 # path to texi2html
 #
 TEXI2HTML = texi2html
 endif
 
 
-# path to texi2dvi, dvips, texi2pdf; If not defined, no conversion will happen
+# path to texi2dvi, dvips, texi2pdf; If not defined, no conversion will
+# happen
 #
-ifeq ($(XEMACS_NATIVE_NT),t)
-# Cygwin versions currently broken.
-TEXI2DVI =
-DVIPS =
-TEXI2PDF =
-else
 TEXI2DVI = texi2dvi
 DVIPS = dvips
 TEXI2PDF = texi2pdf
-endif
 
 # path to tex
 #
+# If you are getting errors like this:
+#   cd texi && tex math-ref
+#   This is TeX, Version 3.14159 (Web2C 7.4.5)
+#   kpathsea: Running mktexfmt tex.fmt
+#   fmtutil: config file `fmtutil.cnf' not found.
+#   I can't find the format file `tex.fmt'!
+# Then somehow you installed tex without installing all the library files.
+# Go back to Cygwin setup, look under `publishing' and select all the
+# TeX components.
+# 
 TEX = tex
 
 # path to msgfmt
 #
-ifeq ($(XEMACS_NATIVE_NT),t)
-# No Cygwin version.
-MSGFMT = 
-else
+# Under Cygwin, you need to install the gettext-devel package under the
+# `Devel' component to get this.
+#
 MSGFMT = msgfmt
-endif
 
 ifneq ('$(symlink)','t')
  # path to GNU cp, use the latter if no GNU cp is available.
 
 # From here on it is just a list of targets that all point to the
 # 'bad-version' target.
+
 all: bad-version
 
 autoloads: all
 
-pdepends.mk: all
+bindist: all
 
-bindist: all
+binkit: all
 
 bytecompile: all
 
+clean: all
+
 compile: all
 
-clean: all
+distclean: all
+
+extraclean: all
+
+genclean: all
+
+html: all
+
+install-for-bindist: all
+
+install-html: all
+
+install-only: all
+
+install: all
 
 mostlyclean: all
 
-extraclean: all
-
-distclean: all
-
-install: all
-
-install-only: all
-
-html: all
-
-install-html: all
-
-binkit: all
+pdepends.mk: all
 
 world: all
 
 World: all
 
 
-
 # Local Variables:
 # mode: makefile
 # End:
 
 mostlyclean::
 
+# Remove the generated files.
+genclean:
+	rm -f $(GENERATED_LISP) $(EARLY_GENERATED_LISP) $(GENERATED_ELCS) $(EARLY_GENERATED_ELCS) package-info $(AUTOLOAD_PATH)/_pkg.el
+
 clean:: mostlyclean
 	rm -f $(GENERATED_ELCS) $(EARLY_GENERATED_ELCS) $(ELCS) $(ELCS_1) \
 	$(HTML_FILES) $(INFO_FILES) $(DEPENDS_FILE_NAME) $(EXTRA_DEPENDENCIES)
 # distclean is what you use when making a distribution.  everything that
 # can get rebuilt should be killed.  everything.
 
-distclean:: clean
-	rm -f $(GENERATED_LISP) $(EARLY_GENERATED_LISP) package-info $(AUTOLOAD_PATH)/_pkg.el
+distclean:: clean genclean
 
 # extraclean means distclean plus removal of backup files, etc.
 extraclean: distclean
 	@echo ")" >> $(AUTOLOAD_PATH)/_pkg.el
 endif
 
-.PHONY: binkit-with-html bindist install autoloads
-
-bindist: compile binkit package-info setup-info
-
 setup-info:
 	$(XEMACS) $(BATCH) -l $(PACKAGE_NET_PACKAGES) \
 		-l $(PACKAGE_INFO) \
 		-f package-net-packages-batch-convert-index-to-ini $(PACKAGE_STAGING) $(CATEGORY)
 
-install: compile binkit
+.PHONY: binkit-with-html install-for-bindist autoloads
 
 # A target that _only_ installs and doesn't build _anything_
 install-only: binkit
 
+binkit: binkit-1
+
+ifeq ($(INSTALL_HTML),t)
+binkit:: install-html
+endif
+
+binkit-with-html: binkit-1 install-html
+
+install-for-bindist: binkit package-info setup-info
+
 ## Do not byte-compile as that could require stuff from elsewhere, and you
 ## get dependency circles.
 autoloads: $(EARLY_GENERATED_LISP)
 	ls -1 $(patsubst %,html/%, $(notdir $(HTML_FILES))) >> $(MANIFEST))
 endif
 
-binkit: binkit-1
-
-ifeq ($(INSTALL_HTML),t)
-binkit: install-html
-endif
-
-binkit-with-html: binkit-1 install-html
-
 # Export dependencies for outer make file usage
 
 # Passed in from outer Make
+# This file is part of XEmacs.
+
+# Copyright (C) 2002, 2003, 2004 Ben Wing.
+
+# XEmacs 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.
+
+# XEmacs 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 XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Avoid duplication between iterate.rules and meta-iterate.rules.
+
+AUTOLOADS_TARGETS= $(ITERATE:=/autoloads.target)
+BYTECOMPILE_TARGETS= $(ITERATE:=/bytecompile.target)
+CLEAN_TARGETS= $(ITERATE:=/clean.target)
+DISTCLEAN_TARGETS= $(ITERATE:=/distclean.target)
+EXTRACLEAN_TARGETS= $(ITERATE:=/extraclean.target)
+ELCCLEAN_TARGETS= $(ITERATE:=/elcclean.target)
+GENCLEAN_TARGETS= $(ITERATE:=/genclean.target)
+HTML_TARGETS= $(ITERATE:=/html.target)
+INSTALL_FOR_BINDIST_TARGETS= $(ITERATE:=/install-for-bindist.target)
+INSTALL_HTML_TARGETS= $(ITERATE:=/install-html.target)
+INSTALL_ONLY_TARGETS= $(ITERATE:=/install-only.target)
+
+ALL_TARGETS = \
+	$(AUTOLOADS_TARGETS)  $(BYTECOMPILE_TARGETS) \
+	$(CLEAN_TARGETS) $(DISTCLEAN_TARGETS) $(ELCCLEAN_TARGETS) \
+	$(EXTRACLEAN_TARGETS) $(GENCLEAN_TARGETS) \
+	$(HTML_TARGETS)  $(INSTALL_FOR_BINDIST_TARGETS) \
+	$(INSTALL_HTML_TARGETS) $(INSTALL_ONLY_TARGETS)
+
+.PHONY: autoloads bytecompile clean distclean elcclean extraclean \
+	genclean html install-for-bindist install-html install-only
+
+# Main driver rules
+
+bytecompile:: $(BYTECOMPILE_TARGETS)
+
+autoloads: $(AUTOLOADS_TARGETS)
+
+clean: $(CLEAN_TARGETS)
+
+distclean: $(DISTCLEAN_TARGETS)
+
+extraclean: $(EXTRACLEAN_TARGETS)
+
+elcclean: $(ELCCLEAN_TARGETS)
+
+genclean: $(GENCLEAN_TARGETS)
+
+html: $(HTML_TARGETS)
+
+install-for-bindist: $(INSTALL_FOR_BINDIST_TARGETS)
+
+install-html: $(INSTALL_HTML_TARGETS)
+
+install-only: $(INSTALL_ONLY_TARGETS)
+
+# Local Variables:
+# mode: Makefile
+# end:
 # Boston, MA 02111-1307, USA.
 
 #
-# This is used by subdirectories that directly contain packages.  Higher-level
-# subdirectories should use meta-iterate.rules instead.
+# This is used by subdirectories that directly contain packages.
+# Higher-level subdirectories should use meta-iterate.rules instead.
 #
 
 XEMACS_PACKAGES_BASE:= $(shell while [ ! -f XEmacs.rules ]; do \
 				done;	\
 				pwd)
 
-AUTOLOADS_TARGETS= $(PACKAGES:=/autoloads.target)
-BYTECOMPILE_TARGETS= $(PACKAGES:=/bytecompile.target)
-BINDIST_TARGETS= $(PACKAGES:=/bindist.target)
-CLEAN_TARGETS= $(PACKAGES:=/clean.target)
-DISTCLEAN_TARGETS= $(PACKAGES:=/distclean.target)
-EXTRACLEAN_TARGETS= $(PACKAGES:=/extraclean.target)
-ELCCLEAN_TARGETS= $(PACKAGES:=/elcclean.target)
-HTML_TARGETS= $(PACKAGES:=/html.target)
-INSTALL_TARGETS= $(PACKAGES:=/install.target)
-INSTALL_HTML_TARGETS= $(PACKAGES:=/install-html.target)
-INSTALL_ONLY_TARGETS= $(PACKAGES:=/install-only.target)
+include ${XEMACS_PACKAGES_BASE}/meta-targets.rules
 
-# Indicate which of the above need the pdepends to be built prior to doing
-# the work of the target.
-autoloads_NEED_PDEPENDS = t
-bytecompile_NEED_PDEPENDS = t
-all_NEED_PDEPENDS = t
+ITERATE:= $(PACKAGES)
 
-# Make this the first target
-all: autoloads bytecompile
-
-ALL_TARGETS = \
-	$(AUTOLOADS_TARGETS)  $(BYTECOMPILE_TARGETS) $(BINDIST_TARGETS) \
-	$(CLEAN_TARGETS) $(DISTCLEAN_TARGETS) $(ELCCLEAN_TARGETS) \
-	$(HTML_TARGETS) $(INSTALL_TARGETS) $(INSTALL_HTML_TARGETS) \
-	$(INSTALL_ONLY_TARGETS)
-
-.PHONY: $(ALL_TARGETS) autoloads bytecompile bindist clean \
-	distclean elcclean html install install-html install-only
+include ${XEMACS_PACKAGES_BASE}/iterate-1.rules
 
 # Master rule to pass down actual building 
 # Use a static pattern because of the extra dependencies
 $(ALL_TARGETS) : %.target:
 	[ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) $(*F)
 
+.PHONY: $(ALL_TARGETS) 
+
 # Standard dependencies
 
 # $(BYTECOMPILE_TARGETS): %bytecompile.target: %autoloads.target
 
-# If bindist builds as well as installing
-# $(BINDIST_TARGETS)= %bindist.target: %bytecompile.target %html.target
-
-# Main driver rules
-
-bytecompile:: $(BYTECOMPILE_TARGETS)
-
-autoloads: $(AUTOLOADS_TARGETS)
-
-bindist: $(BINDIST_TARGETS)
-
-clean: $(CLEAN_TARGETS)
-
-distclean: $(DISTCLEAN_TARGETS)
-
-extraclean: $(EXTRACLEAN_TARGETS)
-
-elcclean: $(ELCCLEAN_TARGETS)
-
-html: $(HTML_TARGETS)
-
-install: $(INSTALL_TARGETS)
-
-install-html: $(INSTALL_HTML_TARGETS)
-
-install-only: $(INSTALL_ONLY_TARGETS)
-
 # Optionally put in fake rules for packages that we cannot
 # recursively build (yet)
 ifneq ($(strip (ASSUMED_PRESENT)),)

meta-iterate.rules

                                 done;		\
                                 pwd)
 
-all: autoloads bytecompile
+include ${XEMACS_PACKAGES_BASE}/meta-targets.rules
 
-.PHONY: all all-bytecompile autoloads bytecompile bindist
-.PHONY: clean distclean extraclean elcclean html macro-list World
-.PHONY: install install-only
+ITERATE:= $(SUBDIRS)
 
-# The toplevel has slightly different rules so we do not use iterate.rules
-# directly
+include ${XEMACS_PACKAGES_BASE}/iterate-1.rules
 
-ALL_TARGETS= $(SUBDIRS:=/all.target)
-AUTOLOADS_TARGETS= $(SUBDIRS:=/autoloads.target)
-BYTECOMPILE_TARGETS= $(SUBDIRS:=/bytecompile.target)
-BINDIST_TARGETS= $(SUBDIRS:=/bindist.target)
-CLEAN_TARGETS= $(SUBDIRS:=/clean.target)
-DISTCLEAN_TARGETS= $(SUBDIRS:=/distclean.target)
-EXTRACLEAN_TARGETS= $(SUBDIRS:=/extraclean.target)
-ELCCLEAN_TARGETS= $(SUBDIRS:=/elcclean.target)
-HTML_TARGETS= $(SUBDIRS:=/html.target)
-INSTALL_TARGETS= $(SUBDIRS:=/install.target)
-INSTALL_HTML_TARGETS= $(SUBDIRS:=/install-html.target)
-INSTALL_ONLY_TARGETS= $(SUBDIRS:=/install-only.target)
+.PHONY: macro-list World
 
 # At some point we might have dependencies here...
 
 %.target:
 	[ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) $(*F)
 
-all-bytecompile: autoloads bytecompile html
-
-autoloads: $(AUTOLOADS_TARGETS)
-
-bytecompile: $(BYTECOMPILE_TARGETS)
-
-bindist: $(BINDIST_TARGETS)
-
-clean: $(CLEAN_TARGETS)
-
-distclean: $(DISTCLEAN_TARGETS)
-
-extraclean: $(EXTRACLEAN_TARGETS)
-
-elcclean:
-	$(XEMACS) $(BATCH) -l package-clean.el
-
-html: $(HTML_TARGETS)
-
 macro-list:
 	-rm -f macro.list
 	find . -type f -name \*.el | xargs awk -f gen-macro-list.awk > macro.list
 
-World: extraclean all install
-
-install: $(INSTALL_TARGETS)
-
-install-html: $(INSTALL_HTML_TARGETS)
-
-install-only: $(INSTALL_ONLY_TARGETS)
+World: extraclean install
 
 # Local Variables:
 # mode: Makefile

meta-targets.rules

+# This file is part of XEmacs.
+# Copyright (C) 2002, 2003, 2004 Ben Wing.
+
+# XEmacs 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.
+
+# XEmacs 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 XEmacs; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+#
+# All targets that compile as part of their operation do compilation need
+# to build all of the autoloads first before anything else.  To avoid the
+# need to duplicate these declarations in three places, we use a separate
+# file.
+#
+
+# Make this the first target
+all: autoloads bytecompile
+
+all-with-html: all html
+
+install: all install-only
+
+bindist: all install-for-bindist
+
+.PHONY: all all-with-html install bindist
+
+# Indicate which targets need the pdepends to be built prior to doing
+# the work of the target.
+autoloads_NEED_PDEPENDS = t
+bytecompile_NEED_PDEPENDS = t
+all-with-html_NEED_PDEPENDS = t
+install_NEED_PDEPENDS = t
+bindist_NEED_PDEPENDS = t
+
+# Local Variables:
+# mode: makefile
+# End:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.