1. xemacs
  2. xemacsweb


xemacsweb / Makefile

# -*-Makefile-*- Begin of xemacsweb Makefile
# Adrian Aichner (APA), aichner@ecf.teradyne.com, Teradyne GmbH, 2000-07-29.
# xemacsweb makefile for UNIX and Windows NT,
# requiring GNU make, available on Windows NT via Cygwin
# Please adjust definitions of CONTENT_FILES and HTML_FILES for other
# versions of make.
# Supported targets:
# htdocs (default): creation of .html from .content files
# validate: validation of all .html files using XEmacs/PSGML
# all: creation and validation

# Use a Local.rules file to specify what you wish to have installed
XEMACS_WEBSITE_BASE:= $(shell pwd)

all: validate

include Local.rules.mk
-include Local.rules

.SUFFIXES:			   # Delete the default suffixes
.SUFFIXES: .content .html .el .elc # Define our suffix list

# APA: Default target (first to occur in file):
validate: htdocs validate-time-stamp

htdocs: $(ELCS) htdocs-time-stamp

# APA: Compile any lisp file for performance (a bit simple-minded, maybe).
%.elc: %.el
	$(XEMACS) $(FLAGS) -f batch-byte-compile $<

all: Download/win32 validate namazu-re-index

# APA: Run linklint on the local working directory tree, including
# remote link checking (-net).
# Use -output_index site so that all files are reachable in directory
# and not hidden by index.html, which does not reference url*.html
# files.
linklint: FORCE
	$(LINKLINT) $(LINKLINT_CASE) -docbase http://www.xemacs.org -net -limit 0 -db3 /@ -doc $(LINKLINT_OUTDIR) -output_index site

# APA: To be run after initial checkout of module.
# Create directory for commit logs.
# Create compatibility link faq.
# configure and build Texi2html.
# APA: Build the genpage documentation.  Maintain a timestamp to avoid
# needless re-generation of genpage release documentation.
# APA: The genpage/content/index.content is not the only dependency,
# but any improvements should go into the genpage/Makefile itself and
# be integrated with a genpage release.
	if test ! -d logs; then \
	      mkdir logs; \
	if test ! -d $(LINKLINT_OUTDIR); then \
	      mkdir $(LINKLINT_OUTDIR); \
	ln -s FAQ faq
	cd genpage; $(MAKE) gp
	cd Texi2html; bash configure; make
	cd FAQ; $(MAKE)

# APA: When contentdir and outputdir are the same then, and only then,
# genpage depends only on content files.  Copying of all other files
# (from contentdir to outputdir) is not necessary in this case.
htdocs-time-stamp: $(CONTENT_FILES) template.html template-de.html template-ja.html
	perl ./genpage/bin/genpage -p $(GENPAGE_CONF) -o "."
	touch htdocs-time-stamp

# APA: Validate only files younger than time-stamp file created by
# previous validation
# See batch-psgml-validate.el for details, in particular ...
# (defun batch-psgml-validate (&optional file-or-dir)
# (defun batch-psgml-validate-file (file &optional insert-result indent)
# (defun batch-psgml-validate-buffer (&optional insert-result indent)
validate-time-stamp: $(HTML_FILES)
	$(XEMACS) $(FLAGS) -l ./batch-psgml-validate.elc -f batch-psgml-validate $?
	touch validate-time-stamp

# PB: target for rebuilding the namazu index
# APA: Touch index.html for index template files to be re-generated.
# www.xemacs.org has a patched mknmz that will update index files,
# unless they are newer than the associated template.
namazu-re-index: FORCE
	touch index.html
	if test -f ${NAMAZU_CGI}; then \

# APA: Remove all .html files (and backups) generated from .content
# files.  Need to remove timestamp files as well!
	$(FIND) . \( -name "*.content" -o -name "*~" \) -print | perl -ne "{ chomp; s/\.content/.html/; unlink; }"
	rm -f htdocs-time-stamp
	rm -f validate-time-stamp

Download/win32: FORCE
	cd $@ && $(MAKE)


# End of xemacsweb Makefile