summaryrefslogtreecommitdiff
path: root/Makefile-maint
blob: f0839732aa05403b37548ff1e94e454cc967c2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Build the Autoconf Archive

srcdir		:= .
m4dir		:= $(srcdir)/m4
htmldir		:= $(srcdir)/html

STAGEDIR	:= $(srcdir)/stage
M4_FILES	:= $(wildcard $(m4dir)/*.m4)
MACROS		:= $(patsubst $(m4dir)/%.m4,%, $(M4_FILES))
CANON_M4_FILES	:= $(patsubst %,$(STAGEDIR)/%.m4,$(MACROS))
RAW_HTML_FILES	:= $(patsubst %,$(STAGEDIR)/%.html,$(MACROS))
HTML_FILES	:= $(patsubst %,$(htmldir)/%.html,$(MACROS))

GENERATED_FILES = $(HTML_FILES)
CLEAN_FILES	= $(GENERATED_FILES) $(STAGEDIR)/.dirCreated $(STAGEDIR)/autoconf-archive.css

.SECONDARY: $(GENERATED_FILES)
.PHONY: all clean

all: $(HTML_FILES)

$(STAGEDIR)/%.html : $(m4dir)/%.m4 $(STAGEDIR)/.dirCreated $(srcdir)/macro.py $(srcdir)/macro2html.py
	@$(srcdir)/macro2html.py --input-encoding=latin-1 --output-encoding=latin-1 --output-dir=$(STAGEDIR) --output-suffix=.html $<

$(htmldir)/%.html : $(STAGEDIR)/%.html
	@echo publish $*
	@tidy -quiet -ascii --indent yes --indent-spaces 1 --tidy-mark no -wrap 80 --hide-comments yes $< >$@

$(STAGEDIR)/autoconf-archive.css : $(srcdir)/autoconf-archive.css $(STAGEDIR)/.dirCreated
	@cp -v $< $@

%/.dirCreated:
	@install -D /dev/null $@

clean:
	@rm -f $(CLEAN_FILES)
	@if [ -d "$(STAGEDIR)" ] ; then rmdir "$(STAGEDIR)"; fi