1 |
TEXI_SRC := $(wildcard ../../*.texinfo) |
# If you find this sed script failing, then you probably don't have |
2 |
MHTML_SRC := $(patsubst ../../%, %, $(TEXI_SRC:.texinfo=.mhtml)) $(wildcard *.mhtml) |
# sed 3.02.80+ currently available on ftp://alpha.gnu.org/pub/sed/ |
|
HTML_OBJS := $(MHTML_SRC:.mhtml=.html) |
|
|
VPATH = ../.. |
|
3 |
|
|
4 |
ifndef MHC |
SUBDIRS= |
5 |
export MHC=mhc |
|
6 |
|
ifndef WMK |
7 |
|
export WMK=wmk |
8 |
endif |
endif |
9 |
|
|
10 |
%.mhtml : %.texinfo |
TEXI_SRC := $(wildcard ../../*.texinfo) |
11 |
|
VPATH = ../.. |
12 |
|
WML_SRC = $(patsubst ../../%, %, $(TEXI_SRC:.texinfo=.wml)) $(wildcard *.wml) |
13 |
|
WML_EN_OBJS = $(patsubst %.wml,%.en.html,$(WML_SRC)) |
14 |
|
|
15 |
|
%.wml : %.texinfo |
16 |
texi2html -monolithic $<; |
texi2html -monolithic $<; |
17 |
sed -e 's/<BODY>/<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#1F00FF" ALINK="#FF0000" VLINK="#9900DD">/' -e 's/<\/BODY>/<include footer.mhtml><footer><\/BODY>/' $(subst .mhtml,.html,$(@)) > $@; |
sed -e 's/<HTML>/\#!wml --include=..\n\#use wml::std::lang\n\#use wml::fmt::isolatin\n\#use wml::std::case global=upper\n<lang:new id=en short>\n<lang:star:slice:>\n\#include <include\/macros.wml>\n<HTML>/' -e 's/<BODY>/<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#1F00FF" ALINK="#FF0000" VLINK="#9900DD">/' -e 's/<\/BODY>/<footer>\n<\/BODY>/' $(subst .wml,.html,$(@)) > $@; |
18 |
-rm $(subst .mhtml,.html,$(@)); |
-rm -f $(subst .wml,.html,$(@)) |
19 |
|
|
20 |
%.html : %.mhtml footer.mhtml |
%.en.html: %.wml ../include/macros.wml |
21 |
$(MHC) $< > $@ |
$(WMK) -f $< |
22 |
|
-rm -f $(patsubst %.wml,%.html,$<) |
23 |
|
|
24 |
all : $(HTML_OBJS) |
.PHONY : all |
25 |
|
all : $(WML_EN_OBJS) subdirs |
26 |
|
|
27 |
.PHONY : clean |
.PHONY : clean |
28 |
clean : |
clean : |
29 |
-rm *.html |
$(foreach dir, $(SUBDIRS), sh -c "cd $(dir) && $(MAKE) clean";) |
30 |
|
-rm -f *.html |
31 |
|
-rm -f hacking.wml vmintegration.wml |
32 |
|
|
33 |
|
.PHONY : subdirs |
34 |
|
subdirs : |
35 |
|
$(foreach dir, $(SUBDIRS), sh -c "cd $(dir) && $(MAKE)";) |