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

Contents of /webwml/Makefile.common

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sun Aug 20 00:02:31 2000 UTC (12 years, 9 months ago) by joy
Branch: MAIN
Changes since 1.4: +15 -0 lines
added four special dirs where NOGENERICDEP is implied
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 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
16 RELTEMPLDIR := ../english/template/debian
17 ENGLISHSRCDIR = $(WMLBASE)/../english
18 endif
19
20 HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR)
21 TEMPLDIR = $(WMLBASE)/$(RELTEMPLDIR)
22
23 LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z")
24 WMLOPTIONS := -q -D CUR_YEAR=$(shell date +%Y)
25 WMLOUTFILE = $(@F)
26 WMLPROLOG :=
27 WMLEPILOG :=
28 WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG)
29
30 WMLFILES = $(wildcard *.wml)
31 ifndef SUBLANG
32 HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES))
33 HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES))
34 else
35 HTMLFILES = $(sort $(foreach i,$(SUBLANG),\
36 $(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
37 HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\
38 $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
39 endif
40 JPGSOURCE := $(wildcard *.jpg)
41 JPGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(JPGSOURCE))
42 GIFSOURCE := $(wildcard *.gif)
43 GIFDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(GIFSOURCE))
44 PNGSOURCE := $(wildcard *.png)
45 PNGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(PNGSOURCE))
46 PSSOURCE := $(wildcard *.ps.gz)
47 PSDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(PSSOURCE))
48 EPSSOURCE := $(wildcard *.eps)
49 EPSDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(EPSSOURCE))
50 PDFSOURCE := $(wildcard *.pdf)
51 PDFDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(PDFSOURCE))
52 FIGSOURCE := $(wildcard *.fig)
53 FIGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(FIGSOURCE))
54 XCFSOURCE := $(wildcard *.xcf.gz)
55 XCFDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(XCFSOURCE))
56 CSSSOURCE := $(wildcard *.css)
57 CSSDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(CSSSOURCE))
58 IMGFILES := $(JPGSOURCE) $(GIFSOURCE) $(PNGSOURCE) $(PSSOURCE) $(EPSSOURCE) $(PDFSOURCE) $(FIGSOURCE) $(XCFSOURCE) $(CSSSOURCE)
59 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)
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)
68
69 $(existing-SUBS):
70 $(MAKE) -C $@
71
72 install::
73 test -d $(HTMLDIR) || mkdir -p $(HTMLDIR)
74 install:: $(HTMLDESTFILES) $(IMGDESTFILES) $(existing-SUBS-install)
75
76 $(existing-SUBS-install):
77 $(MAKE) -C $(subst -install,,$@) install
78
79 clean::
80 rm -f *.$(LANGUAGE).html
81 clean:: $(existing-SUBS-clean)
82
83 $(existing-SUBS-clean):
84 $(MAKE) -C $(subst -clean,,$@) clean
85
86 cleandest::
87 rm -f $(HTMLDIR)/*.$(LANGUAGE).html
88 cleandest:: $(existing-SUBS-cleandest)
89
90 $(existing-SUBS-cleandest):
91 $(MAKE) -C $(subst -cleandest,,$@) cleandest
92
93 # subdirectories of News, events, security and vote dirs all have their own
94 # generic wml file deps
95 ifneq "$(findstring /News/,$(CURDIR))" ""
96 NOGENERICDEP := true
97 endif
98 ifneq "$(findstring /events/,$(CURDIR))" ""
99 NOGENERICDEP := true
100 endif
101 ifneq "$(findstring /security/,$(CURDIR))" ""
102 NOGENERICDEP := true
103 endif
104 ifneq "$(findstring /vote/,$(CURDIR))" ""
105 NOGENERICDEP := true
106 endif
107
108 # the rule for every wml file
109 ifndef NOGENERICDEP
110 ifdef SPI
111 %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml
112 $(WML) $(<F)
113 else
114 %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml
115 $(WML) $(<F)
116 endif
117 endif
118
119 $(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
120 @echo copying $(@F) to $(HTMLDIR)
121 -@cp $(@F) $(HTMLDIR)
122 ifeq ($(LANGUAGE),en)
123 @echo making a link $(@D)/$(*F).html -\> $(@F)
124 @ln -sf $(@F) $(@D)/$(*F).html
125 endif
126
127 $(IMGDESTFILES): $(IMGFILES)
128 cp $(@F) $(HTMLDIR)
129
130 # template dependencies
131 ifdef SPI
132 $(TEMPLDIR)/template.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml
133 touch $(TEMPLDIR)/template.wml
134
135 $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml
136 touch $(TEMPLDIR)/footer.wml
137 else
138 $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml
139 touch $(TEMPLDIR)/basic.wml
140
141 $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml
142 touch $(TEMPLDIR)/footer.wml
143
144 $(TEMPLDIR)/menubar.wml: $(TEMPLDIR)/footer.wml
145 touch $(TEMPLDIR)/menubar.wml
146
147 $(TEMPLDIR)/mainpage.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/menubar.wml
148 touch $(TEMPLDIR)/mainpage.wml
149
150 $(TEMPLDIR)/template.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/footer.wml \
151 $(TEMPLDIR)/languages.wml
152 touch $(TEMPLDIR)/template.wml
153
154 $(TEMPLDIR)/news.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/footer.wml \
155 $(TEMPLDIR)/languages.wml
156 touch $(TEMPLDIR)/news.wml
157
158 $(TEMPLDIR)/consultant.wml: $(TEMPLDIR)/footer.wml
159 touch $(TEMPLDIR)/consultant.wml
160
161 $(TEMPLDIR)/event.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml $(TEMPLDIR)/basic.wml
162 touch $(TEMPLDIR)/event.wml
163
164 $(TEMPLDIR)/navbar.wml: $(ENGLISHSRCDIR)/Pics/banner.jpg $(ENGLISHSRCDIR)/Pics/logo-50.jpg
165 touch $(TEMPLDIR)/navbar.wml
166
167 $(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_translation.wml \
168 $(TEMPLDIR)/basic.wml $(TEMPLDIR)/fixes_link.wml \
169 $(TEMPLDIR)/languages.wml $(TEMPLDIR)/ctime.wml \
170 $(TEMPLDIR)/footer.wml
171 touch $(TEMPLDIR)/security.wml
172
173 $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \
174 $(TEMPLDIR)/footer.wml
175 touch $(TEMPLDIR)/ddp.wml
176 endif
177
178 .SUFFIXES:
179 .PHONY: all $(existing-SUBS) install $(existing-SUBS-install)
180 .PHONY: clean $(existing-SUBS-clean) cleandest $(existing-SUBS-cleandest)

  ViewVC Help
Powered by ViewVC 1.1.5