Makefile 3.36 KB
Newer Older
1 2
# If this makefile is not generic enough to support a translation,
# please contact debian-www.
3

4 5
WMLBASE=.
CUR_DIR=
6
SUBS=Bugs CD MailingLists News Pics banners blends consultants devel \
7
distrib doc events intro international legal logos lts mirror misc partners \
8
ports releases reports security users volatile vote women y2k derivatives
James A. Treacy's avatar
James A. Treacy committed
9

Denis Barbier's avatar
Denis Barbier committed
10 11
all install:: install-locale

12 13
clean:: clean-locale

14
include $(WMLBASE)/Make.lang
James A. Treacy's avatar
James A. Treacy committed
15

16
ifndef SUBLANG
17
INDEXPAGE = index.$(LANGUAGE).html
18
SITEMAP = sitemap.$(LANGUAGE).html
19
DESTSITEMAP = $(HTMLDIR)/$(SITEMAP)
20 21
SEARCHXML = search.$(LANGUAGE).xml
DESTSEARCHXML =  $(HTMLDIR)/$(SEARCHXML)
22
else
23
INDEXPAGE = $(sort $(foreach i,$(SUBLANG),$(subst index,index.$(LANGUAGE)-$(i),index.html)))
24 25
SITEMAP = $(sort $(foreach i,$(SUBLANG),\
	$(patsubst %.wml,%.$(LANGUAGE)-$(i).html,sitemap.wml)))
26
DESTSITEMAP = $(patsubst %.html,$(HTMLDIR)/%.html,$(SITEMAP))
27 28
SEARCHXML = $(sort $(foreach i,$(SUBLANG),$(subst search,search.$(LANGUAGE)-$(i),search.xml)))
DESTSEARCHXML = $(patsubst %.xml,$(HTMLDIR)/%.xml,$(SEARCHXML))
29
endif
James A. Treacy's avatar
James A. Treacy committed
30

31
$(INDEXPAGE): index.wml $(TEMPLDIR)/mainpage.wml $(GETTEXTDEP) \
32
		$(wildcard News/$(CUR_YEAR)/[0-9]*.wml) $(wildcard $(ENGLISHSRCDIR)/News/$(CUR_YEAR)/[0-9]*.wml) \
33
     		$(wildcard News/$(CUR_YEAR)/[0-9]*.title) \
34 35
		$(wildcard security/$(CUR_YEAR)/dsa-[0-9]*.wml) $(wildcard $(ENGLISHSRCDIR)/security/$(CUR_YEAR)/dsa-[0-9]*.wml) \
		$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/recent_list.wml $(TEMPLDIR)/languages.wml \
36
		$(TEMPLDIR)/release_info.wml $(TEMPLDIR)/release_images.wml
37 38 39 40 41 42
ifeq "$(LANGUAGE)" "zh"
	@echo -n "Processing $(<F): "
	$(shell echo $(WML) | perl -pe 's,:.zh-(..)\.html,:index.zh-$$1.html,g') \
          $(shell egrep '^-D (CUR_|CHAR)' ../.wmlrc) index.wml
	@$(GENERATE_ZH_VARIANTS) index html
else
43
	$(WML) index.wml
44
endif
45

46
$(SITEMAP): $(ENGLISHDIR)/sitemap.wml $(TEMPLDIR)/card.wml \
47
  $(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/template.wml $(GETTEXTDEP) \
48
  $(TEMPLDIR)/release_info.wml $(ENGLISHDIR)/MailingLists/mklist.tags
49
ifeq "$(LANGUAGE)" "zh"
50
	@echo -n "Processing $(<F): "
51 52 53
	$(subst :.zh,:sitemap.zh,$(WML)) \
          $(shell egrep '^-D (CUR_|CHAR)' .wmlrc) \
            $(shell echo $(ENGLISHDIR) | sed s,./,,)/sitemap.wml
54
	@$(GENERATE_ZH_VARIANTS) sitemap html
55
else
56 57
	$(WML) $(shell egrep '^-D (CUR_|CHAR)' .wmlrc) \
          $(shell echo $(ENGLISHDIR) | sed s,./,,)/sitemap.wml
Josip Rodin's avatar
Josip Rodin committed
58
endif
Josip Rodin's avatar
Josip Rodin committed
59

60 61
ifneq "$(LANGUAGE)" "en"
contact.$(LANGUAGE).html : contact.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \
62 63
  $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml \
  $(ENGLISHDIR)/devel/website/tc.data $(LOCALEDIR)/others.mo
64 65
endif

66
all:: $(SITEMAP) $(SEARCHXML)
67

68
install:: $(DESTSITEMAP) $(DESTSEARCHXML)
69
ifeq "$(LANGUAGE)" "en"
70

71
install:: $(HTMLDIR)/favicon.ico
72 73 74

$(HTMLDIR)/favicon.ico: favicon.ico
	install -p -m 664 favicon.ico $(HTMLDIR)
75
endif
Denis Barbier's avatar
Denis Barbier committed
76

77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
$(SEARCHXML): $(ENGLISHDIR)/search.xml.in $(GETTEXTDEP)
ifeq "$(LANGUAGE)" "zh"
	@echo -n "Processing $(<F): "
	$(shell echo $(WML) | perl -pe 's,:.zh-(..)\.html,:search.zh-$$1.xml,g') \
	$(shell egrep '^-D (CUR_|CHAR)' .wmlrc) \
	  $(shell echo $(ENGLISHDIR) | sed s,./,,)/search.xml.in
	@$(GENERATE_ZH_VARIANTS) search xml
else
	$(WML) $(shell egrep '^-D (CUR_|CHAR)' .wmlrc) \
	  $(shell echo $(ENGLISHDIR) | sed s,./,,)/search.xml.in
endif

$(DESTSEARCHXML): $(HTMLDIR)/%: %
	@test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
	install -m 664 -p $< $(HTMLDIR)

Denis Barbier's avatar
Denis Barbier committed
93 94 95
install-locale:
	$(MAKE) -C po install

96 97
clean-locale:
	$(MAKE) -C po clean