/[webwml]/webwml/Makefile.common
ViewVC logotype

Contents of /webwml/Makefile.common

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.91 - (hide annotations) (download)
Fri Aug 8 13:04:55 2008 UTC (4 years, 9 months ago) by joy
Branch: MAIN
Changes since 1.90: +3 -0 lines
added dependencies for installer and release_images templates
1 joy 1.1 # Nothing in here should require any modification. If you feel you need to
2     # modify something first send mail to debian-www explaining why.
3    
4 joy 1.4 CUR_YEAR := $(shell date +%Y)
5    
6 joy 1.12 ENGLISHSRCDIR := $(WMLBASE)/../english
7 joy 1.11 ENGLISHDIR := $(ENGLISHSRCDIR)
8     # ^ just an alias ^
9 joy 1.65
10 barbier 1.66 TEMPLDIR := $(ENGLISHDIR)/template/debian
11 joy 1.65 RELHTMLBASE := ../../www
12 joy 1.1 HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR)
13    
14 barbier 1.67 LOCALEDIR := $(WMLBASE)/../locale/$(LANGUAGE)/LC_MESSAGES
15     ifneq "$(LANGUAGE)" "en"
16 barbier 1.73 GETTEXTDEP := $(LOCALEDIR)/templates.mo $(LOCALEDIR)/countries.mo $(LOCALEDIR)/langs.mo $(LOCALEDIR)/date.mo
17 barbier 1.68 ifneq "$(GETTEXTFILES)" ""
18     GETTEXTDEP += $(addprefix $(LOCALEDIR)/,$(GETTEXTFILES))
19     endif
20 barbier 1.67 endif
21    
22 joy 1.1 LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z")
23 barbier 1.64 WMLOPTIONS := -q -D CUR_YEAR=$(CUR_YEAR)
24 joy 1.1 WMLOUTFILE = $(@F)
25     WMLPROLOG :=
26     WMLEPILOG :=
27     WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG)
28    
29     WMLFILES = $(wildcard *.wml)
30 joy 1.4 ifndef SUBLANG
31 joy 1.1 HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES))
32     HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES))
33 joy 1.4 else
34 foka 1.3 HTMLFILES = $(sort $(foreach i,$(SUBLANG),\
35     $(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
36     HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\
37     $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
38     endif
39 finnish 1.36
40 joy 1.46 OTHERFILES := $(wildcard *.ps.gz *.eps *.pdf *.css)
41 jseidel 1.89 OTHERFILES += $(wildcard *.jpg *.jpeg *.gif *.png *.fig *.xcf *.xcf.gz *.ppm *.svg)
42 joy 1.46 OTHERDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(OTHERFILES))
43 joy 1.1
44     existing-SUBS := $(shell for dir in $(wildcard $(SUBS)) ''; do test -d $$dir && echo $$dir; done)
45 joy 1.4 existing-SUBS-install := $(addsuffix -install,$(existing-SUBS))
46     existing-SUBS-clean := $(addsuffix -clean,$(existing-SUBS))
47     existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS))
48 joy 1.1
49 joy 1.4 # rules
50 joy 1.1 all:: $(HTMLFILES) $(existing-SUBS)
51    
52     $(existing-SUBS):
53 joy 1.8 -$(MAKE) -C $@
54 joy 1.1
55 joy 1.46 install:: $(HTMLDESTFILES) $(OTHERDESTFILES) $(existing-SUBS-install)
56 joy 1.1
57     $(existing-SUBS-install):
58 joy 1.79 -$(MAKE) -C $(patsubst %-install,%,$@) install
59 joy 1.1
60     clean::
61 joy 1.47 rm -f *.$(LANGUAGE).html *~ *.forced
62 joy 1.1 clean:: $(existing-SUBS-clean)
63    
64     $(existing-SUBS-clean):
65 joy 1.79 -$(MAKE) -C $(patsubst %-clean,%,$@) clean
66 joy 1.1
67     cleandest::
68     rm -f $(HTMLDIR)/*.$(LANGUAGE).html
69     cleandest:: $(existing-SUBS-cleandest)
70    
71     $(existing-SUBS-cleandest):
72 joy 1.79 -$(MAKE) -C $(patsubst %-cleandest,%,$@) cleandest
73 joy 1.1
74 joy 1.21 # subdirectories of News, events and security dirs each have
75 foka 1.9 # their own generic wml file deps
76 joy 1.18 ifneq "$(findstring /News/,$(CURDIR))" ""
77 joy 1.5 NOGENERICDEP := true
78     endif
79     ifneq "$(findstring /events/,$(CURDIR))" ""
80     NOGENERICDEP := true
81     endif
82     ifneq "$(findstring /security/,$(CURDIR))" ""
83 djpig 1.83 ifeq "$(findstring security/audit,$(CURDIR))" ""
84 joy 1.5 NOGENERICDEP := true
85 djpig 1.83 endif
86 joy 1.5 endif
87 djpig 1.82 ifneq "$(findstring legal/licenses,$(CURDIR))" ""
88     NOGENERICDEP := true
89     endif
90 thuriaux 1.87 ifneq "$(findstring /users/,$(CURDIR))" ""
91     NOGENERICDEP := true
92     endif
93 joy 1.5
94 joy 1.1 # the rule for every wml file
95 joy 1.2 ifndef NOGENERICDEP
96 joy 1.57 ifeq "$(findstring /CD,$(CURDIR))" ""
97 joy 1.12 %.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \
98 barbier 1.67 $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(GETTEXTDEP)
99 joy 1.1 $(WML) $(<F)
100 joy 1.52 else
101 joy 1.57 ifeq "$(findstring /CD/vendors,$(CURDIR))" ""
102 joy 1.52 %.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \
103 barbier 1.67 $(TEMPLDIR)/cdimage.wml $(GETTEXTDEP)
104 joy 1.56 $(WML) $(<F)
105 joy 1.57 else
106 joy 1.56 %.$(LANGUAGE).html : %.wml $(WMLBASE)/../.wmlrc $(WMLBASE)/.wmlrc \
107 barbier 1.67 $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml $(GETTEXTDEP)
108 joy 1.52 $(WML) $(<F)
109 joy 1.57 endif
110 joy 1.52 endif
111 joy 1.14 ifeq "$(LANGUAGE)" "en"
112 joy 1.39 ifeq "$(findstring /international/,$(CURDIR)/)" ""
113 joy 1.52 -$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
114 joy 1.39 endif
115 joy 1.14 endif
116 joey 1.30 ifneq "$(findstring /international/,$(CURDIR)/)" ""
117 joy 1.52 -$(WMLBASE)/../touch_translations.pl $(CURDIR)/$(<F) $(LANGUAGE)
118 joy 1.2 endif
119 joy 1.4 endif
120 joy 1.1
121 joy 1.10 ifndef NOGENERICINSTDEP
122 joy 1.44 $(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
123     @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
124 joy 1.1 @echo copying $(@F) to $(HTMLDIR)
125 foka 1.23 -@install -m 664 -p $(@F) $(HTMLDIR)
126 treacy 1.49 ifeq ($(LANGUAGE),no)
127     @echo making a link $(@D)/$(*F).nb.html -\> $(@F)
128     @ln -sf $(@F) $(@D)/$(*F).nb.html
129     endif
130 joy 1.1 ifeq ($(LANGUAGE),en)
131     @echo making a link $(@D)/$(*F).html -\> $(@F)
132 joy 1.4 @ln -sf $(@F) $(@D)/$(*F).html
133 treacy 1.48 @ln -sf $(@F) $(@D)/$(*F).en-us.html
134     @ln -sf $(@F) $(@D)/$(*F).en-gb.html
135 joy 1.10 endif
136 joy 1.1 endif
137    
138 barbier 1.70 # Ensure that MO files do exist
139     # Translators have to run make under webwml/<lang>/po if they
140     # want it updated, it cannot be automatically performed.
141     $(LOCALEDIR)/templates.mo:
142     $(MAKE) -C $(WMLBASE)/po install
143 barbier 1.75
144 joy 1.46 $(OTHERDESTFILES): $(HTMLDIR)/%: %
145 joy 1.44 @test -d $(HTMLDIR) || mkdir -m g+w -p $(HTMLDIR)
146 finnish 1.36 install -m 664 -p $< $(HTMLDIR)
147 joy 1.13 ifeq "$(LANGUAGE)" "en"
148 joy 1.46 # probably doesn't work for *.gz files, FIXME
149 finnish 1.36 [ -f "$(HTMLDIR)/$(basename $(basename $<))$(suffix $<)" ] || ln -s $< $(HTMLDIR)/$(basename $(basename $<))$(suffix $<)
150 joy 1.13 endif
151 joy 1.1
152     # template dependencies
153 joy 1.15 $(TEMPLDIR)/%.wml:
154     touch $@
155    
156 barbier 1.84 gendep:
157     @for f in $(TEMPLDIR)/*.wml $(TEMPLDIR)/weeklynews/*.wml; do \
158     grep -q '^#use wml::debian' $$f || continue; \
159     g=`echo "$$f" | sed -e 's,$(TEMPLDIR),\$$(TEMPLDIR),'`; \
160     grep '^#use wml::debian' $$f |\
161     grep -v openrecode |\
162     sed -e 's,.*::,\$$(TEMPLDIR)/,' \
163     -e 's/ .*$$//' \
164     -e 's/$$/.wml/' |\
165     awk "BEGIN {printf \"X$$g:\"}"'{printf " %s", $$1}' |\
166     fold -b -s -w 70 |\
167     sed -e 's/^\$$/ \$$/' -e 's/^X//' -e '/:$$/d' -e '$$!s/$$/\\/'; \
168     echo; \
169     done
170    
171     # this dependency cannot be automatically computed
172     $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml
173    
174     # dependencies below are generated by gendep and manually checked
175 joy 1.55 $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/common_translation.wml \
176 djpig 1.85 $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/footer.wml \
177     $(TEMPLDIR)/navbar.wml
178 joy 1.55 $(TEMPLDIR)/cdimage.wml: $(TEMPLDIR)/common_translation.wml \
179     $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
180 barbier 1.84 $(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/basic.wml
181 barbier 1.75 $(TEMPLDIR)/common_translation.wml: $(TEMPLDIR)/common_tags.wml
182     $(TEMPLDIR)/consultant.wml: $(TEMPLDIR)/common_tags.wml \
183     $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
184     $(TEMPLDIR)/countries.wml: $(TEMPLDIR)/common_tags.wml
185 joy 1.88 $(TEMPLDIR)/countries_all.wml: $(TEMPLDIR)/countries.wml
186 barbier 1.75 $(TEMPLDIR)/ctime.wml: $(TEMPLDIR)/common_tags.wml
187     $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml \
188     $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml
189 barbier 1.84 $(TEMPLDIR)/debian-cdd.wml: $(TEMPLDIR)/common_tags.wml \
190     $(TEMPLDIR)/template.wml
191 barbier 1.75 $(TEMPLDIR)/event.wml: $(TEMPLDIR)/events_common.wml \
192     $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
193 barbier 1.84 $(TEMPLDIR)/events_common.wml: $(TEMPLDIR)/common_translation.wml
194 barbier 1.75 $(TEMPLDIR)/fixes_link.wml: $(TEMPLDIR)/common_tags.wml
195 barbier 1.84 $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml \
196     $(TEMPLDIR)/common_tags.wml
197 barbier 1.75 $(TEMPLDIR)/header.wml: $(TEMPLDIR)/common_translation.wml
198 joy 1.91 $(TEMPLDIR)/installer.wml: $(TEMPLDIR)/release_data.wml
199 barbier 1.75 $(TEMPLDIR)/language_names.wml: $(TEMPLDIR)/common_tags.wml
200     $(TEMPLDIR)/languages.wml: $(TEMPLDIR)/common_tags.wml \
201     $(TEMPLDIR)/language_names.wml
202 barbier 1.84 $(TEMPLDIR)/legal.wml: $(TEMPLDIR)/common_tags.wml \
203     $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml \
204     $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/submenu.wml \
205     $(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/basic.wml
206 djpig 1.81 $(TEMPLDIR)/legal_lists.wml: $(TEMPLDIR)/ctime.wml \
207     $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml
208     $(TEMPLDIR)/legal_tags.wml: $(TEMPLDIR)/common_tags.wml \
209     $(TEMPLDIR)/common_translation.wml
210 barbier 1.75 $(TEMPLDIR)/links.tags.wml: $(TEMPLDIR)/common_tags.wml
211     $(TEMPLDIR)/mainpage.wml: $(TEMPLDIR)/common_translation.wml \
212     $(TEMPLDIR)/basic.wml $(TEMPLDIR)/links.tags.wml \
213     $(TEMPLDIR)/languages.wml
214     $(TEMPLDIR)/mirrors.wml: $(TEMPLDIR)/countries.wml \
215     $(TEMPLDIR)/languages.wml $(TEMPLDIR)/common_tags.wml
216     $(TEMPLDIR)/navbar.wml: $(TEMPLDIR)/common_translation.wml \
217     $(TEMPLDIR)/mirrors.wml
218     $(TEMPLDIR)/news.wml: $(TEMPLDIR)/common_translation.wml \
219     $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
220     $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/basic.wml
221     $(TEMPLDIR)/past_event.wml: $(TEMPLDIR)/events_common.wml \
222     $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
223 djpig 1.81 $(TEMPLDIR)/recent_list.wml: $(TEMPLDIR)/ctime.wml \
224     $(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml
225 barbier 1.75 $(TEMPLDIR)/release.wml: $(TEMPLDIR)/languages.wml
226 joy 1.90 $(TEMPLDIR)/release_data.wml: $(TEMPLDIR)/common_tags.wml \
227     $(TEMPLDIR)/ctime.wml
228 joy 1.91 $(TEMPLDIR)/release_images.wml: $(TEMPLDIR)/installer.wml \
229     $(TEMPLDIR)/release_data.wml
230 barbier 1.84 $(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_tags.wml \
231     $(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/fixes_link.wml \
232     $(TEMPLDIR)/languages.wml $(TEMPLDIR)/ctime.wml \
233     $(TEMPLDIR)/securityreferences.wml $(TEMPLDIR)/basic.wml
234     $(TEMPLDIR)/speakers.wml: $(TEMPLDIR)/common_tags.wml \
235     $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
236     $(TEMPLDIR)/template.wml: $(TEMPLDIR)/basic.wml \
237     $(TEMPLDIR)/languages.wml
238 barbier 1.75 $(TEMPLDIR)/todoitem.wml: $(TEMPLDIR)/common_tags.wml
239 barbier 1.84 $(TEMPLDIR)/translation-check.wml: $(TEMPLDIR)/languages.wml \
240     $(TEMPLDIR)/common_tags.wml
241 barbier 1.75 $(TEMPLDIR)/url.wml: $(TEMPLDIR)/common_tags.wml
242 barbier 1.84 $(TEMPLDIR)/votebar.wml: $(TEMPLDIR)/languages.wml \
243     $(TEMPLDIR)/common_tags.wml
244     $(TEMPLDIR)/wnpp.wml: $(TEMPLDIR)/common_tags.wml
245 barbier 1.75 $(TEMPLDIR)/weeklynews/footer.wml: $(TEMPLDIR)/common_tags.wml
246     $(TEMPLDIR)/weeklynews/header.wml: $(TEMPLDIR)/common_tags.wml \
247 barbier 1.84 $(TEMPLDIR)/ctime.wml $(TEMPLDIR)/links.tags.wml \
248     $(TEMPLDIR)/template.wml
249 joy 1.60
250 djpig 1.86 $(TEMPLDIR)/cdimage.wml: $(ENGLISHDIR)/Pics/debian.png \
251 barbier 1.75 $(ENGLISHSRCDIR)/logos/openlogo-nd-50.png \
252     $(ENGLISHDIR)/CD/pictures/menubar-tl.png \
253     $(ENGLISHDIR)/CD/pictures/menubar-tr.png \
254     $(ENGLISHDIR)/CD/pictures/menubar-bl.png \
255     $(ENGLISHDIR)/CD/pictures/menubar-br.png
256     # \
257     # $(WMLBASE)/CD/pictures/menu-faq.$(LANGUAGE).png \
258     # $(WMLBASE)/CD/pictures/menu-jigdo.$(LANGUAGE).png \
259     # $(WMLBASE)/CD/pictures/menu-http-ftp.$(LANGUAGE).png \
260     # $(WMLBASE)/CD/pictures/menu-buy.$(LANGUAGE).png \
261     # $(WMLBASE)/CD/pictures/menu-misc.$(LANGUAGE).png \
262     # $(WMLBASE)/CD/pictures/menu-netinst.$(LANGUAGE).png \
263     # $(WMLBASE)/CD/pictures/menu-pik.$(LANGUAGE).png
264    
265 djpig 1.86 $(TEMPLDIR)/navbar.wml: $(ENGLISHSRCDIR)/Pics/debian.png \
266     $(ENGLISHSRCDIR)/logos/openlogo-nd-50.png
267 barbier 1.75
268     $(TEMPLDIR)/todoitem.wml: $(ENGLISHSRCDIR)/Pics/star-grn.gif \
269     $(ENGLISHSRCDIR)/Pics/star-yel.gif \
270     $(ENGLISHSRCDIR)/Pics/star-red.gif
271     $(TEMPLDIR)/votebar.wml: $(ENGLISHSRCDIR)/Pics/blue-upperleft.png \
272     $(ENGLISHSRCDIR)/Pics/blue-upperright.png \
273     $(ENGLISHSRCDIR)/Pics/blue-lowerleft.png \
274     $(ENGLISHSRCDIR)/Pics/blue-lowerright.png
275 barbier 1.40
276 joy 1.1 .SUFFIXES:
277     .PHONY: all $(existing-SUBS) install $(existing-SUBS-install)
278     .PHONY: clean $(existing-SUBS-clean) cleandest $(existing-SUBS-cleandest)

  ViewVC Help
Powered by ViewVC 1.1.5