1
# This requires GNU make. -*- makefile -*-
3
# To use this, a script must include the following minimal set of
6
# include relative/path/to/scripts/make.rules
7
# ROOT_DIR = relative/path/to
8
# ROOT_OFFSET = path/of/cwd/relative/to/ROOT_DIR
10
# E.g. for the cp4e directory:
12
# include ../scripts/make.rules
16
# Make rules for www.python.org ht->html generation. SOURCES
17
# indirection filters out "*.ht" value when no ht files are around.
18
SOURCES = $(wildcard *.ht)
19
HTTARGETS = $(filter-out *.html,$(SOURCES:%.ht=%.html))
20
TARGETS = $(HTTARGETS) $(EXTRA_TARGETS)
22
# Where to upload stuff for make install. LIVE_ROOT is the actual
23
# physical location of files on the server.
24
LIVE_HOST = shell.sourceforge.net
25
LIVE_ROOT = /home/groups/p/py/python-mode/htdocs
26
LIVE_DEST = $(LIVE_HOST):$(LIVE_ROOT)/$(ROOT_OFFSET)
32
HTML_CATALOG = /usr/share/sgml/html-4.01/HTML4.cat
36
# If the file .rsync-excludes exists in the make dir, use it.
37
EXCLUDE_FROM = $(shell if [ -f .rsync-excludes ]; then \
38
echo "--exclude-from=.rsync-excludes"; \
44
SCRIPTDIR = $(ROOT_DIR)
45
HT2HTML = $(shell which ht2html)
47
HTALLFLAGS = -f -s $(HTSTYLE)
48
HTROOT = $(shell $(SCRIPTDIR)/calcroot.py $(ROOT_OFFSET))
49
HTFLAGS = $(HTALLFLAGS) -r $(HTROOT)
53
#HTWF = $(SCRIPTDIR)/ht2html/htwf.py
54
#HTWFFLAGS = -s $(HTSTYLE) -r $(HTROOT)
56
GENERATED_HTML= $(SOURCES:.ht=.html)
61
PYTHONPATH=$(SCRIPTDIR) $(HT2HTML) $(HTFLAGS) $(HTRELDIR)/$<
65
$(HTTARGETS): $(HT2HTML) $(SCRIPTDIR)/$(HTSTYLE).py
68
-rm -f *~ .*~ *.py[co]
71
-rm -f $(GENERATED_HTML)
73
install: all local_install
74
@if [ -z "$(ROOT_OFFSET)" ]; then \
75
echo "You have to specify a value for 'ROOT_OFFSET' in the makefile!"; \
78
@echo Push to $(LIVE_DEST) ...
79
rsync --rsh=$(RSYNC_RSH) -v -l -u $(GLOBAL_EXCLUDES) $(EXCLUDE_FROM) $(HTTARGETS) *.ht $(LIVE_DEST)
82
for f in $(TARGETS); \
84
$(NSGMLS) -s -c $(HTML_CATALOG) $$f; \
88
$(HTWF) $(HTWFFLAGS) $(SOURCES)
90
# Override local_install in Makefile for directory-specific install actions.
95
if [ -f $$dir/Makefile ] ; then \
96
echo "Changing to $$dir" ; \
97
cd $$dir ; make recursive; cd .. ; \