2 # Makefile rules for multi HTMLs and a single text
9 IMAGE_EXPR = -o -name '*.gif' \
17 ifeq ($(origin BASENAME), undefined)
18 BASENAME := $(notdir $(CURDIR))
24 ifeq ($(RESTRICT_COMMERCIAL), yes)
25 ifeq ($(RESTRICT-DIST), yes)
31 # default target by condition.
33 ifeq ($(COMPILE), yes)
34 all: index.html $(BASENAME).txt
36 install: install-work \
42 @echo Skip compilation.
44 @echo Skip installation.
52 @echo HTMLs are supplied from upstream
55 @echo text is supplied from upstream
57 $(BASENAME).tar.gz: index.html
58 find . -name '*.html' $(IMAGE_EXPR) \
59 | tar cvfz $@ --files-from=-
66 # single html file with images, multiple html files,
67 # multiple html files with images
70 $(WORK_TEXT)/$(BASENAME).txt \
71 $(WORK_HTML)/$(BASENAME)/index.html
73 $(WORK_TEXT)/$(BASENAME).txt: $(BASENAME).txt
76 touch $(LAST_MODIFIED)
78 $(WORK_HTML)/$(BASENAME)/index.html: index.html
81 tar cf - `find . -name '*.html' $(IMAGE_EXPR)` \
82 | ( cd $(@D); tar xpf -)
85 # Install WWW contents
87 ifneq ($(INSTALL_WWW), yes)
91 $(DEST_WWW_TEXT)/$(BASENAME).txt \
92 $(DEST_WWW_HTML)/$(BASENAME)/index.html
94 $(DEST_WWW_TEXT)/$(BASENAME).txt: $(BASENAME).txt
98 $(DEST_WWW_HTML)/$(BASENAME)/index.html: index.html
99 mkdir -p $(DEST_WWW_HTML)
101 tar cf - `find . -name '*.html' $(IMAGE_EXPR)` \
102 | ( cd $(@D); tar xpf -)
103 if [ -r dot.htaccess ]; then \
104 $(INSTALL) dot.htaccess $(@D)/.htaccess ; \
109 # Install FTP contents
111 ifneq ($(INSTALL_FTP), yes)
115 $(DEST_FTP_TEXT)/$(BASENAME).gz \
116 $(DEST_FTP_HTML)/$(BASENAME).tar.gz
118 $(DEST_FTP_TEXT)/$(BASENAME).gz: $(BASENAME).txt
120 $(INSTALL) $< $(@:.gz=)
124 $(DEST_FTP_HTML)/$(BASENAME).tar.gz: $(BASENAME).tar.gz
130 # Install LDP translations for mirror
132 ifneq ($(INSTALL_LDP), yes)
135 ifneq ($(KIND), LDP-TRANS)
137 @echo Non-LDP document. Skipped.
139 install-ldp-mirror: \
140 $(DEST_LDP_TEXT)/$(BASENAME).gz \
141 $(DEST_LDP_HTML)/$(BASENAME).tar.gz
143 $(DEST_LDP_TEXT)/$(BASENAME).gz: $(BASENAME).txt
145 $(INSTALL) $< $(@:.gz=)
149 $(DEST_LDP_HTML)/$(BASENAME).tar.gz: $(BASENAME).tar.gz
158 rm -f $(BASENAME).tar.gz