Source

xemacsweb / Makefile

Full commit
adriana 61e9e52 
adriana e5371d0 
adriana 41e5984 
stephent f41dffe 
adriana 41e5984 
stephent f41dffe 


adriana 6f0c3cf 

adriana e5371d0 
stephent f41dffe 







adriana 0738198 
stephent f41dffe 

adrian 39b6ea5 

adriana 8e3cd24 
stephent f41dffe 
adriana 8e3cd24 
stephent f41dffe 
adrian ba85573 
stephent f41dffe 

adrian 12adf03 
stephent f41dffe 





adrian ba85573 
stephent f41dffe 
adriana 00f8a58 
stephent f41dffe 


















apa-guest c4856ce 



stephent f41dffe 







adrian 10154ec 
adrian c755d26 

adrian 39b6ea5 


stephent f41dffe 



adrian c755d26 
adrian 10154ec 
adrian c755d26 
adrian 10154ec 

adriana 604c739 




stephent f41dffe 

adrian c755d26 





scop 56e8ec2 


adrian 10154ec 


stephent f41dffe 
adriana 1b05876 
adriana 8e3cd24 


adriana 3871022 
stephent f41dffe 
adrian 236a4a0 









adrian dfd2cf3 
stephent f41dffe 
adriana 8e3cd24 
adriana e9c8d24 

adriana 1b05876 



stephent f41dffe 










unwelcome-guest 49f97bc 

stephent f41dffe 
unwelcome-guest 49f97bc 


stephent f41dffe 
adriana 61e9e52 
adrian 8d86a80 
adrian 03a08c8 


stephent f41dffe 
adrian 03a08c8 
adrian 46fe7b8 
adrian a540cc4 
rendhalver 0eb1658 

adriana 61e9e52 


adriana e1eaa9a 
stephent f41dffe 

adriana 61e9e52 
stephent f41dffe 
adrian 31fb61c 

stephent f41dffe 
adrian a109b93 
adrian c755d26 
stephent f41dffe 







adrian 92138df 
# -*-Makefile-*- Begin of xemacsweb Makefile
#
# Adrian Aichner (APA), aichner@ecf.teradyne.com, Teradyne GmbH, 2000-07-29.
# Stephen Turnbull (stephen), stephen@xemacs.org, 2008-02-02
#
# xemacsweb makefile for UNIX and Windows NT.
# Requires GNU make, available on Windows NT via Cygwin and MSYS.
# (This Makefile uses immediately-expanded assignments in an essential way.)
#
# Supported targets:
#
# all:              same as validate [default target]
# everything:       validate + namazu-re-index + Download/win32
# validate:         htdocs + validation of all .html files using XEmacs/PSGML
# htdocs:           creation of .html from .content files using genpage
# linklint:         run linklint on the tree, including remote links
# namazu-re-index:  run the namazu indexer on the tree
# Documentation:    make HTML documents from XEmacs 21.5 sources
# Download/win32:   update Win32 download information

################ Override variables in Local.rules. ################
################  No user-serviceable parts below.  ################

.SUFFIXES:			   # Delete the default suffixes
.SUFFIXES: .content .html .el .elc # Define our suffix list
.PHONY: namazu-re-index linklint Documentation Download/win32

XEMACS_WEBSITE_BASE := $(shell pwd)

# Prune directories where we won't find .content files
# or HTML files requiring validation.

PRUNE_GENPAGE  := -path ./genpage -prune
PRUNE_LINKLINT := -path "./linklint*" -prune
PRUNE_215_TEXI := -path ./Documentation/21.5/html -prune
PRUNE_PKG_TEXI := -path ./Documentation/packages/html -prune
PRUNES := $(PRUNE_GENPAGE) -o $(PRUNE_LINKLINT)
PRUNES := \( $(PRUNES) -o $(PRUNE_215_TEXI) -o $(PRUNE_PKG_TEXI) \)

# Define collections of files to process.

# These must be recursively-expanded variables.  FIND is defined in Local.rules.
CONTENT_FILES        = $(shell $(FIND) . $(PRUNES) -o -name "*.content" -print)
GENERATED_HTML_FILES = $(CONTENT_FILES:.content=.html)
VALIDATE_HTML_FILES  = $(shell $(FIND) . $(PRUNES) -o -name "*.html" -print)

# Some prerequisites we use.

GENPAGE_CONF := "genpage.conf"
ELCS         := batch-psgml-validate.elc release-mail-to-html.elc

#   Include the sanity checks and default program locations.

include Local.rules.mk
# Include any local overrides specified by the user.
-include Local.rules

#   Targets

#   Default target; must come before other targets but after Local.rules.
# all: validate
# Just generate .html from .content without validate until validation
# is working incrementally again.
all: htdocs

everything: validate Download/win32 namazu-re-index

validate: htdocs $(STAMPS)/validate

htdocs: $(GENERATED_HTML_FILES)

$(GENERATED_HTML_FILES): $(ELCS) $(STAMPS)/htdocs

# 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:
	$(LINKLINT) $(LINKLINT_CASE) -docbase http://www.xemacs.org \
		-net -limit 0 -db3 /@ -doc $(LINKLINT_OUTDIR) \
		$(LINKLINT_IGNORESET) -output_index site -timeout 30

# 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.
init: $(STAMPS)/init
	rm $(STAMPS)/init
	if test ! -d logs; then \
	      mkdir logs; \
	fi;
	if test ! -d $(LINKLINT_OUTDIR); then \
	      mkdir $(LINKLINT_OUTDIR); \
	fi;
	if test ! -e faq; then \
	      ln -s FAQ faq; \
	fi;
	cd genpage; $(MAKE) gp
	cd Texi2html; bash configure; make
	cd FAQ; $(MAKE)
	touch $(STAMPS)/init

# 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.
# See $(GENPAGE_CONF).
$(STAMPS)/htdocs: $(STAMPS) $(CONTENT_FILES) \
	template.html \
	template-de.html \
	template-ja.html \
	Releases/core-stable.txt \
	Releases/core-beta.txt \
	Releases/packages-official.txt \
	Releases/packages-pre-release.txt \
	Download/win32/netinstall-win32.txt \
	Download/win32/innosetup-win32.txt \
	Download/win32/installshield-win32.txt
	perl ./genpage/bin/genpage -q -p $(GENPAGE_CONF) -o "."
	touch $(STAMPS)/htdocs

# 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)

# stephen: $(VALIDATE_HTML_FILES) *must* be evaluated when Make creates
# its dependency graph, so that will happen before htdocs is made in the
# toplevel make.  So we use a recursive make to ensure that htdocs has
# already made all the needed HTML by the time the arguments to
# batch-psgml-validate are computed.
# The conditional is to avoid doing the find in the toplevel make.
$(STAMPS)/validate: $(STAMPS) $(VALIDATE_HTML_FILES)
	make real-validate SUBMAKE=validate
	touch $(STAMPS)/validate
ifeq ($(SUBMAKE),validate)
# We'd like to use VALIDATE_HTML_FILES or $<, but we've got too many of them.
# (Limit on line length in shell.)  So we run the find again here with xargs.
real-validate: $(VALIDATE_HTML_FILES)
	$(FIND) . $(PRUNES) -o -name "*.html" -print \
	| xargs $(XEMACS) $(FLAGS) -l ./batch-psgml-validate.elc \
				   -f batch-psgml-validate
endif

# 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:
	touch index.html
	if test -n "$(NAMAZU_INDEX_DIR)" -a -d "$(NAMAZU_INDEX_DIR)"; then \
		$(MKNMZ) --output-dir=$(NAMAZU_INDEX_DIR) . ; \
	fi;

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

Documentation:
	cd $@ && $(MAKE) TEXI2HTML="$(TEXI2HTML)" all

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

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

#    Scaffolding

$(STAMPS):
	$(MKDIR) $(STAMPS)

# End of xemacsweb Makefile