~python-mode-devs/python-mode/python-mode

« back to all changes in this revision

Viewing changes to website/make.rules

  • Committer: Barry Warsaw
  • Date: 2017-02-24 21:38:07 UTC
  • Revision ID: barry@python.org-20170224213807-h762012vx6fgvrve
Move repo to GitLab

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This requires GNU make.  -*- makefile -*-
2
 
#
3
 
# To use this, a script must include the following minimal set of
4
 
# stuff:
5
 
#
6
 
# include relative/path/to/scripts/make.rules
7
 
# ROOT_DIR = relative/path/to
8
 
# ROOT_OFFSET = path/of/cwd/relative/to/ROOT_DIR
9
 
#
10
 
# E.g. for the cp4e directory:
11
 
#
12
 
# include ../scripts/make.rules
13
 
# ROOT_DIR = ..
14
 
# ROOT_OFFSET = cp4e
15
 
 
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)
21
 
 
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)
27
 
 
28
 
# rsync definitions.
29
 
RSYNC_RSH =     ssh
30
 
 
31
 
# Validation
32
 
HTML_CATALOG = /usr/share/sgml/html-4.01/HTML4.cat
33
 
NSGMLS = nsgmls
34
 
 
35
 
GLOBAL_EXCLUDES = 
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"; \
39
 
                        else \
40
 
                           echo ""; \
41
 
                        fi)
42
 
LOCAL_INCLUDE =
43
 
 
44
 
SCRIPTDIR =     $(ROOT_DIR)
45
 
HT2HTML =       $(shell which ht2html)
46
 
HTSTYLE =       PMGenerator
47
 
HTALLFLAGS =    -f -s $(HTSTYLE)
48
 
HTROOT =        $(shell $(SCRIPTDIR)/calcroot.py $(ROOT_OFFSET))
49
 
HTFLAGS =       $(HTALLFLAGS) -r $(HTROOT)
50
 
RST2HT =        rst2ht.py
51
 
RSTFLAGS =      -g -t -s
52
 
HTRELDIR =      .
53
 
#HTWF =         $(SCRIPTDIR)/ht2html/htwf.py
54
 
#HTWFFLAGS =    -s $(HTSTYLE) -r $(HTROOT)
55
 
 
56
 
GENERATED_HTML= $(SOURCES:.ht=.html)
57
 
 
58
 
.SUFFIXES:      .ht .html
59
 
 
60
 
%.html : %.ht
61
 
                PYTHONPATH=$(SCRIPTDIR) $(HT2HTML) $(HTFLAGS) $(HTRELDIR)/$<
62
 
 
63
 
all: $(TARGETS)
64
 
 
65
 
$(HTTARGETS): $(HT2HTML) $(SCRIPTDIR)/$(HTSTYLE).py
66
 
 
67
 
clean:
68
 
        -rm -f *~ .*~ *.py[co]
69
 
 
70
 
realclean: clean
71
 
        -rm -f $(GENERATED_HTML)
72
 
 
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!"; \
76
 
          false; \
77
 
        fi
78
 
        @echo Push to $(LIVE_DEST) ...
79
 
        rsync --rsh=$(RSYNC_RSH) -v -l -u $(GLOBAL_EXCLUDES) $(EXCLUDE_FROM) $(HTTARGETS) *.ht $(LIVE_DEST)
80
 
 
81
 
validate:       $(TARGETS)
82
 
        for f in $(TARGETS); \
83
 
        do echo $$f;\
84
 
        $(NSGMLS) -s -c $(HTML_CATALOG) $$f; \
85
 
        done
86
 
 
87
 
wfcheck:
88
 
        $(HTWF) $(HTWFFLAGS) $(SOURCES)
89
 
 
90
 
# Override local_install in Makefile for directory-specific install actions.
91
 
local_install:
92
 
 
93
 
recursive: all
94
 
        for dir in * ; do \
95
 
            if [ -f $$dir/Makefile ] ; then \
96
 
                echo "Changing to $$dir" ; \
97
 
                cd $$dir ; make recursive; cd .. ; \
98
 
            fi \
99
 
        done