| 1 |
# Nothing in here should require any modification. If you feel you need to |
# Nothing in here should require any modification. If you feel you need to |
| 2 |
# modify something first send mail to debian-www explaining why. |
# modify something first send mail to debian-www explaining why. |
| 3 |
|
|
| 4 |
|
CUR_YEAR := $(shell date +%Y) |
| 5 |
|
|
| 6 |
|
ifeq "$(findstring SPI,$(CURDIR))" "SPI" |
| 7 |
|
SPI := true |
| 8 |
|
endif |
| 9 |
|
|
| 10 |
|
ifdef SPI |
| 11 |
|
RELHTMLBASE := ../../../debian.org/SPI |
| 12 |
|
RELTEMPLDIR := ../../english/SPI/template |
| 13 |
|
ENGLISHSRCDIR = $(WMLBASE)/../../english/SPI |
| 14 |
|
else |
| 15 |
RELHTMLBASE := ../../debian.org |
RELHTMLBASE := ../../debian.org |
| 16 |
RELTEMPLDIR := ../english/template/debian |
RELTEMPLDIR := ../english/template/debian |
| 17 |
CUR_YEAR := $(shell date +%Y) |
ENGLISHSRCDIR = $(WMLBASE)/../english |
| 18 |
|
endif |
| 19 |
|
|
| 20 |
HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR) |
HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR) |
| 21 |
TEMPLDIR = $(WMLBASE)/$(RELTEMPLDIR) |
TEMPLDIR = $(WMLBASE)/$(RELTEMPLDIR) |
|
ENGLISHSRCDIR = $(WMLBASE)/../english |
|
| 22 |
|
|
| 23 |
LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z") |
LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z") |
| 24 |
WMLOPTIONS := -q -D CUR_YEAR=$(shell date +%Y) |
WMLOPTIONS := -q -D CUR_YEAR=$(shell date +%Y) |
| 28 |
WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG) |
WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG) |
| 29 |
|
|
| 30 |
WMLFILES = $(wildcard *.wml) |
WMLFILES = $(wildcard *.wml) |
| 31 |
|
ifndef SUBLANG |
| 32 |
HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES)) |
HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES)) |
| 33 |
HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES)) |
HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES)) |
| 34 |
|
else |
|
# Redefine HTMLFILES and HTMLDESTFILES for SUBLANG like *.zh-cn.html |
|
|
# and *.zh-tw.html. This is currently needed by the Chinese web pages |
|
|
# only. I tried to define these in chinese/Make.lang, but it didn't work. |
|
|
# (foka, 2000-08-16) |
|
|
ifdef SUBLANG |
|
| 35 |
HTMLFILES = $(sort $(foreach i,$(SUBLANG),\ |
HTMLFILES = $(sort $(foreach i,$(SUBLANG),\ |
| 36 |
$(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) |
$(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) |
| 37 |
HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\ |
HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\ |
| 38 |
$(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) |
$(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) |
| 39 |
endif |
endif |
|
|
|
|
# all the binary file types should be added below. |
|
| 40 |
JPGSOURCE := $(wildcard *.jpg) |
JPGSOURCE := $(wildcard *.jpg) |
| 41 |
JPGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(JPGSOURCE)) |
JPGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(JPGSOURCE)) |
| 42 |
GIFSOURCE := $(wildcard *.gif) |
GIFSOURCE := $(wildcard *.gif) |
| 59 |
IMGDESTFILES := $(JPGDESTFILES) $(GIFDESTFILES) $(PNGDESTFILES) $(PSDESTFILES) $(EPSDESTFILES) $(PDFDESTFILES) $(FIGDESTFILES) $(XCFDESTFILES) $(CSSSOURCE) |
IMGDESTFILES := $(JPGDESTFILES) $(GIFDESTFILES) $(PNGDESTFILES) $(PSDESTFILES) $(EPSDESTFILES) $(PDFDESTFILES) $(FIGDESTFILES) $(XCFDESTFILES) $(CSSSOURCE) |
| 60 |
|
|
| 61 |
existing-SUBS := $(shell for dir in $(wildcard $(SUBS)) ''; do test -d $$dir && echo $$dir; done) |
existing-SUBS := $(shell for dir in $(wildcard $(SUBS)) ''; do test -d $$dir && echo $$dir; done) |
| 62 |
|
existing-SUBS-install := $(addsuffix -install,$(existing-SUBS)) |
| 63 |
|
existing-SUBS-clean := $(addsuffix -clean,$(existing-SUBS)) |
| 64 |
|
existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS)) |
| 65 |
|
|
| 66 |
|
# rules |
| 67 |
all:: $(HTMLFILES) $(existing-SUBS) |
all:: $(HTMLFILES) $(existing-SUBS) |
| 68 |
|
|
| 69 |
$(existing-SUBS): |
$(existing-SUBS): |
| 70 |
$(MAKE) -C $@ |
$(MAKE) -C $@ |
| 71 |
|
|
|
existing-SUBS-install := $(addsuffix -install,$(existing-SUBS)) |
|
|
|
|
| 72 |
install:: |
install:: |
| 73 |
test -d $(HTMLDIR) || mkdir -p $(HTMLDIR) |
test -d $(HTMLDIR) || mkdir -p $(HTMLDIR) |
| 74 |
install:: $(HTMLDESTFILES) $(IMGDESTFILES) $(existing-SUBS-install) |
install:: $(HTMLDESTFILES) $(IMGDESTFILES) $(existing-SUBS-install) |
| 76 |
$(existing-SUBS-install): |
$(existing-SUBS-install): |
| 77 |
$(MAKE) -C $(subst -install,,$@) install |
$(MAKE) -C $(subst -install,,$@) install |
| 78 |
|
|
|
existing-SUBS-clean := $(addsuffix -clean,$(existing-SUBS)) |
|
|
|
|
| 79 |
clean:: |
clean:: |
| 80 |
rm -f *.$(LANGUAGE).html |
rm -f *.$(LANGUAGE).html |
| 81 |
clean:: $(existing-SUBS-clean) |
clean:: $(existing-SUBS-clean) |
| 83 |
$(existing-SUBS-clean): |
$(existing-SUBS-clean): |
| 84 |
$(MAKE) -C $(subst -clean,,$@) clean |
$(MAKE) -C $(subst -clean,,$@) clean |
| 85 |
|
|
|
existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS)) |
|
|
|
|
| 86 |
cleandest:: |
cleandest:: |
| 87 |
rm -f $(HTMLDIR)/*.$(LANGUAGE).html |
rm -f $(HTMLDIR)/*.$(LANGUAGE).html |
| 88 |
cleandest:: $(existing-SUBS-cleandest) |
cleandest:: $(existing-SUBS-cleandest) |
| 92 |
|
|
| 93 |
# the rule for every wml file |
# the rule for every wml file |
| 94 |
ifndef NOGENERICDEP |
ifndef NOGENERICDEP |
| 95 |
|
ifdef SPI |
| 96 |
|
%.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml |
| 97 |
|
$(WML) $(<F) |
| 98 |
|
else |
| 99 |
%.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml |
%.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml |
| 100 |
$(WML) $(<F) |
$(WML) $(<F) |
| 101 |
endif |
endif |
| 102 |
|
endif |
| 103 |
|
|
| 104 |
$(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html |
$(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html |
| 105 |
@echo copying $(@F) to $(HTMLDIR) |
@echo copying $(@F) to $(HTMLDIR) |
| 106 |
-@cp $(@F) $(HTMLDIR) |
-@cp $(@F) $(HTMLDIR) |
| 107 |
ifeq ($(LANGUAGE),en) |
ifeq ($(LANGUAGE),en) |
| 108 |
@echo making a link $(@D)/$(*F).html -\> $(@F) |
@echo making a link $(@D)/$(*F).html -\> $(@F) |
| 109 |
-@ln -f -s $(@F) $(@D)/$(*F).html |
@ln -sf $(@F) $(@D)/$(*F).html |
| 110 |
endif |
endif |
| 111 |
|
|
| 112 |
$(IMGDESTFILES): $(IMGFILES) |
$(IMGDESTFILES): $(IMGFILES) |
| 113 |
cp $(@F) $(HTMLDIR) |
cp $(@F) $(HTMLDIR) |
| 114 |
|
|
| 115 |
# template dependencies |
# template dependencies |
| 116 |
|
ifdef SPI |
| 117 |
|
$(TEMPLDIR)/template.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml |
| 118 |
|
touch $(TEMPLDIR)/template.wml |
| 119 |
|
|
| 120 |
|
$(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml |
| 121 |
|
touch $(TEMPLDIR)/footer.wml |
| 122 |
|
else |
| 123 |
$(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml |
$(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml |
| 124 |
touch $(TEMPLDIR)/basic.wml |
touch $(TEMPLDIR)/basic.wml |
| 125 |
|
|
| 158 |
$(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \ |
$(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \ |
| 159 |
$(TEMPLDIR)/footer.wml |
$(TEMPLDIR)/footer.wml |
| 160 |
touch $(TEMPLDIR)/ddp.wml |
touch $(TEMPLDIR)/ddp.wml |
| 161 |
|
endif |
| 162 |
|
|
| 163 |
.SUFFIXES: |
.SUFFIXES: |
| 164 |
.PHONY: all $(existing-SUBS) install $(existing-SUBS-install) |
.PHONY: all $(existing-SUBS) install $(existing-SUBS-install) |