# Nothing in here should require any modification. If you feel you need to # modify something first send mail to debian-www explaining why. CUR_YEAR := $(shell date +%Y) RELHTMLBASE := ../../www ENGLISHSRCDIR := $(WMLBASE)/../english TEMPLDIR := $(ENGLISHSRCDIR)/template/debian ENGLISHDIR := $(ENGLISHSRCDIR) # ^ just an alias ^ HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR) LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z") WMLOPTIONS := -q -D CUR_YEAR=$(CUR_YEAR) WMLOUTFILE = $(@F) WMLPROLOG := WMLEPILOG := WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG) WMLFILES = $(wildcard *.wml) ifndef SUBLANG HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES)) HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES)) else HTMLFILES = $(sort $(foreach i,$(SUBLANG),\ $(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\ $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES)))) endif OTHERFILES := $(wildcard *.ps.gz *.eps *.pdf *.css) OTHERFILES += $(wildcard *.jpg *.gif *.png *.fig *.xcf.gz *.ppm) OTHERDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(OTHERFILES)) existing-SUBS := $(shell for dir in $(wildcard $(SUBS)) ''; do test -d $$dir && echo $$dir; done) existing-SUBS-install := $(addsuffix -install,$(existing-SUBS)) existing-SUBS-clean := $(addsuffix -clean,$(existing-SUBS)) existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS)) # rules all:: $(HTMLFILES) $(existing-SUBS) $(existing-SUBS): -$(MAKE) -C $@ install:: $(HTMLDESTFILES) $(OTHERDESTFILES) $(existing-SUBS-install) $(existing-SUBS-install): -$(MAKE) -C $(subst -install,,$@) install clean:: rm -f *.$(LANGUAGE).html *~ *.forced clean:: $(existing-SUBS-clean) $(existing-SUBS-clean): -$(MAKE) -C $(subst -clean,,$@) clean cleandest:: rm -f $(HTMLDIR)/*.$(LANGUAGE).html cleandest:: $(existing-SUBS-cleandest) $(existing-SUBS-cleandest): -$(MAKE) -C $(subst -cleandest,,$@) cleandest # subdirectories of News, events and security dirs each have # their own generic wml file deps ifneq "$(findstring /News/,$(CURDIR))" "" NOGENERICDEP := true endif ifneq "$(findstring /events/,$(CURDIR))" "" NOGENERICDEP := true endif ifneq "$(findstring /security/,$(CURDIR))" "" NOGENERICDEP := true endif # the rule for every wml file ifndef NOGENERICDEP %.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(HTMLDEP) $(WML) $( $(@F) @ln -sf $(@F) $(@D)/$(*F).nb.html endif ifeq ($(LANGUAGE),en) @echo making a link $(@D)/$(*F).html -\> $(@F) @ln -sf $(@F) $(@D)/$(*F).html @ln -sf $(@F) $(@D)/$(*F).en-us.html @ln -sf $(@F) $(@D)/$(*F).en-gb.html endif endif $(OTHERDESTFILES): $(HTMLDIR)/%: % @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR) install -m 664 -p $< $(HTMLDIR) ifeq "$(LANGUAGE)" "en" # probably doesn't work for *.gz files, FIXME [ -f "$(HTMLDIR)/$(basename $(basename $<))$(suffix $<)" ] || ln -s $< $(HTMLDIR)/$(basename $(basename $<))$(suffix $<) endif # template dependencies $(TEMPLDIR)/%.wml: touch $@ $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/languages.wml: $(TEMPLDIR)/language_names.wml $(TEMPLDIR)/language_names.def $(TEMPLDIR)/mainpage.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/mirrors.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/footer.wml $(TEMPLDIR)/links.tags.wml \ $(ENGLISHSRCDIR)/Pics/blue-upperleft.png $(ENGLISHSRCDIR)/Pics/blue-upperright.png \ $(ENGLISHSRCDIR)/Pics/blue-lowerleft.png $(ENGLISHSRCDIR)/Pics/blue-lowerright.png $(TEMPLDIR)/mirrors.wml: $(TEMPLDIR)/countries.wml $(TEMPLDIR)/countries.def $(TEMPLDIR)/template.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/footer.wml $(TEMPLDIR)/news.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/footer.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/consultant.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/footer.wml $(TEMPLDIR)/event.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/events_common.wml $(TEMPLDIR)/past_event.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/events_common.wml ifndef SUBLANG $(TEMPLDIR)/navbar.wml: $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/mirrors.wml \ $(ENGLISHSRCDIR)/Pics/debian.jpg $(ENGLISHSRCDIR)/Pics/logo-50.jpg \ $(ENGLISHSRCDIR)/Pics/red-upperleft.png $(ENGLISHSRCDIR)/Pics/red-upperright.png \ $(ENGLISHSRCDIR)/Pics/red-lowerleft.png $(ENGLISHSRCDIR)/Pics/red-lowerright.png \ $(WMLBASE)/Pics/about.$(LANGUAGE).gif \ $(WMLBASE)/Pics/news.$(LANGUAGE).gif \ $(WMLBASE)/Pics/distrib.$(LANGUAGE).gif \ $(WMLBASE)/Pics/support.$(LANGUAGE).gif \ $(WMLBASE)/Pics/devel.$(LANGUAGE).gif \ # $(WMLBASE)/Pics/sitemap.$(LANGUAGE).gif \ $(WMLBASE)/Pics/search.$(LANGUAGE).gif else $(TEMPLDIR)/navbar.wml: $(TEMPLDIR)/common_translation.wml \ $(ENGLISHSRCDIR)/Pics/debian.jpg $(ENGLISHSRCDIR)/Pics/logo-50.jpg \ $(ENGLISHSRCDIR)/Pics/red-upperleft.png $(ENGLISHSRCDIR)/Pics/red-upperright.png \ $(ENGLISHSRCDIR)/Pics/red-lowerleft.png $(ENGLISHSRCDIR)/Pics/red-lowerright.png \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/about.$(LANGUAGE)-$(i).gif) \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/news.$(LANGUAGE)-$(i).gif) \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/distrib.$(LANGUAGE)-$(i).gif) \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/support.$(LANGUAGE)-$(i).gif) \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/devel.$(LANGUAGE)-$(i).gif) \ # $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/sitemap.$(LANGUAGE)-$(i).gif) \ $(foreach i,$(SUBLANG),$(WMLBASE)/Pics/search.$(LANGUAGE)-$(i).gif) endif $(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/fixes_link.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/footer.wml $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/footer.wml $(TEMPLDIR)/votebar.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/common_translation.wml \ $(ENGLISHSRCDIR)/Pics/blue-upperleft.png $(ENGLISHSRCDIR)/Pics/blue-upperright.png \ $(ENGLISHSRCDIR)/Pics/blue-lowerleft.png $(ENGLISHSRCDIR)/Pics/blue-lowerright.png $(TEMPLDIR)/weeklynews/header.wml: $(TEMPLDIR)/ctime.wml \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/countries.def: $(TEMPLDIR)/countries.wml cd $(TEMPLDIR) && sed -e /^#/d countries.wml | eperl -B '<:' -E ':>' - >/dev/null $(TEMPLDIR)/language_names.def: $(TEMPLDIR)/language_names.wml cd $(TEMPLDIR) && sed -e '/^#/d' -e '/^/,/^<\/perl>/!d' language_names.wml | eperl -B '' -E '' - >/dev/null .SUFFIXES: .PHONY: all $(existing-SUBS) install $(existing-SUBS-install) .PHONY: clean $(existing-SUBS-clean) cleandest $(existing-SUBS-cleandest)