# 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) ENGLISHSRCDIR := $(WMLBASE)/../english ENGLISHDIR := $(ENGLISHSRCDIR) # ^ just an alias ^ TEMPLDIR := $(ENGLISHDIR)/template/debian RELHTMLBASE := ../../www HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR) LOCALEDIR := $(WMLBASE)/../locale/$(LANGUAGE)/LC_MESSAGES ifneq "$(LANGUAGE)" "en" GETTEXTDEP := $(LOCALEDIR)/templates.mo $(LOCALEDIR)/countries.mo $(LOCALEDIR)/langs.mo $(LOCALEDIR)/date.mo ifneq "$(GETTEXTFILES)" "" GETTEXTDEP += $(addprefix $(LOCALEDIR)/,$(GETTEXTFILES)) endif endif 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 *.jpeg *.gif *.png *.fig *.xcf *.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 $(patsubst %-install,%,$@) install clean:: rm -f *.$(LANGUAGE).html *~ *.forced clean:: $(existing-SUBS-clean) $(existing-SUBS-clean): -$(MAKE) -C $(patsubst %-clean,%,$@) clean cleandest:: rm -f $(HTMLDIR)/*.$(LANGUAGE).html cleandest:: $(existing-SUBS-cleandest) $(existing-SUBS-cleandest): -$(MAKE) -C $(patsubst %-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))" "" ifeq "$(findstring security/audit,$(CURDIR))" "" NOGENERICDEP := true endif endif ifneq "$(findstring legal/licenses,$(CURDIR))" "" NOGENERICDEP := true endif ifneq "$(findstring /users/,$(CURDIR))" "" NOGENERICDEP := true endif # the rule for every wml file ifndef NOGENERICDEP ifeq "$(findstring /CD,$(CURDIR))" "" %.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(GETTEXTDEP) $(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 # Ensure that MO files do exist # Translators have to run make under webwml//po if they # want it updated, it cannot be automatically performed. $(LOCALEDIR)/templates.mo: $(MAKE) -C $(WMLBASE)/po install $(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 $@ gendep: @for f in $(TEMPLDIR)/*.wml $(TEMPLDIR)/weeklynews/*.wml; do \ grep -q '^#use wml::debian' $$f || continue; \ g=`echo "$$f" | sed -e 's,$(TEMPLDIR),\$$(TEMPLDIR),'`; \ grep '^#use wml::debian' $$f |\ grep -v openrecode |\ sed -e 's,.*::,\$$(TEMPLDIR)/,' \ -e 's/ .*$$//' \ -e 's/$$/.wml/' |\ awk "BEGIN {printf \"X$$g:\"}"'{printf " %s", $$1}' |\ fold -b -s -w 70 |\ sed -e 's/^\$$/ \$$/' -e 's/^X//' -e '/:$$/d' -e '$$!s/$$/\\/'; \ echo; \ done # this dependency cannot be automatically computed $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml # dependencies below are generated by gendep and manually checked $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/footer.wml \ $(TEMPLDIR)/navbar.wml $(TEMPLDIR)/cdimage.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/basic.wml $(TEMPLDIR)/common_translation.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/consultant.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/countries.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/ctime.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml \ $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/debian-cdd.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/event.wml: $(TEMPLDIR)/events_common.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/events_common.wml: $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/fixes_link.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/header.wml: $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/language_names.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/language_names.wml $(TEMPLDIR)/legal.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/submenu.wml \ $(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/basic.wml $(TEMPLDIR)/legal_lists.wml: $(TEMPLDIR)/ctime.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/legal_tags.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/links.tags.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/mainpage.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/links.tags.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/mirrors.wml: $(TEMPLDIR)/countries.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/navbar.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/mirrors.wml $(TEMPLDIR)/news.wml: $(TEMPLDIR)/common_translation.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/basic.wml $(TEMPLDIR)/past_event.wml: $(TEMPLDIR)/events_common.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/recent_list.wml: $(TEMPLDIR)/ctime.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/release.wml: $(TEMPLDIR)/languages.wml $(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/fixes_link.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/ctime.wml \ $(TEMPLDIR)/securityreferences.wml $(TEMPLDIR)/basic.wml $(TEMPLDIR)/speakers.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/template.wml: $(TEMPLDIR)/basic.wml \ $(TEMPLDIR)/languages.wml $(TEMPLDIR)/todoitem.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/translation-check.wml: $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/url.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/votebar.wml: $(TEMPLDIR)/languages.wml \ $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/wnpp.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/weeklynews/footer.wml: $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/weeklynews/header.wml: $(TEMPLDIR)/common_tags.wml \ $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/links.tags.wml \ $(TEMPLDIR)/template.wml $(TEMPLDIR)/cdimage.wml: $(ENGLISHDIR)/Pics/debian.png \ $(ENGLISHSRCDIR)/logos/openlogo-nd-50.png \ $(ENGLISHDIR)/CD/pictures/menubar-tl.png \ $(ENGLISHDIR)/CD/pictures/menubar-tr.png \ $(ENGLISHDIR)/CD/pictures/menubar-bl.png \ $(ENGLISHDIR)/CD/pictures/menubar-br.png # \ # $(WMLBASE)/CD/pictures/menu-faq.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-jigdo.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-http-ftp.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-buy.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-misc.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-netinst.$(LANGUAGE).png \ # $(WMLBASE)/CD/pictures/menu-pik.$(LANGUAGE).png $(TEMPLDIR)/navbar.wml: $(ENGLISHSRCDIR)/Pics/debian.png \ $(ENGLISHSRCDIR)/logos/openlogo-nd-50.png $(TEMPLDIR)/todoitem.wml: $(ENGLISHSRCDIR)/Pics/star-grn.gif \ $(ENGLISHSRCDIR)/Pics/star-yel.gif \ $(ENGLISHSRCDIR)/Pics/star-red.gif $(TEMPLDIR)/votebar.wml: $(ENGLISHSRCDIR)/Pics/blue-upperleft.png \ $(ENGLISHSRCDIR)/Pics/blue-upperright.png \ $(ENGLISHSRCDIR)/Pics/blue-lowerleft.png \ $(ENGLISHSRCDIR)/Pics/blue-lowerright.png .SUFFIXES: .PHONY: all $(existing-SUBS) install $(existing-SUBS-install) .PHONY: clean $(existing-SUBS-clean) cleandest $(existing-SUBS-cleandest)