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

Diff of /webwml/Makefile.common

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by foka, Wed Aug 16 10:24:08 2000 UTC revision 1.4 by joy, Sat Aug 19 23:33:57 2000 UTC
# Line 1  Line 1 
1  # Nothing in here should require any modification. If you feel you need to  # Nothing in here should require any modification. If you feel you need to
2  # modify something first send mail to debian-www explaining why.  # 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  RELHTMLBASE := ../../debian.org
16  RELTEMPLDIR := ../english/template/debian  RELTEMPLDIR := ../english/template/debian
17  CUR_YEAR := $(shell date +%Y)  ENGLISHSRCDIR = $(WMLBASE)/../english
18    endif
19    
20  HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR)  HTMLDIR = $(WMLBASE)/$(RELHTMLBASE)/$(CUR_DIR)
21  TEMPLDIR = $(WMLBASE)/$(RELTEMPLDIR)  TEMPLDIR = $(WMLBASE)/$(RELTEMPLDIR)
 ENGLISHSRCDIR = $(WMLBASE)/../english  
22    
23  LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z")  LANGUAGECAP = $(shell echo $(LANGUAGE) | tr "a-z" "A-Z")
24  WMLOPTIONS := -q -D CUR_YEAR=$(shell date +%Y)  WMLOPTIONS := -q -D CUR_YEAR=$(shell date +%Y)
# Line 17  WMLEPILOG := Line 28  WMLEPILOG :=
28  WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG)  WML = wml $(WMLOPTIONS) -o UNDEFu$(LANGUAGECAP):$(WMLOUTFILE)@g+w $(WMLPROLOG) $(WMLEPILOG)
29    
30  WMLFILES = $(wildcard *.wml)  WMLFILES = $(wildcard *.wml)
31    ifndef SUBLANG
32  HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES))  HTMLFILES = $(patsubst %.wml,%.$(LANGUAGE).html,$(WMLFILES))
33  HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES))  HTMLDESTFILES = $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE).html,$(WMLFILES))
34    else
 # Redefine HTMLFILES and HTMLDESTFILES for SUBLANG like *.zh-cn.html  
 # and *.zh-tw.html.  This is currently needed by the Chinese web pages  
 # only.  I tried to define these in chinese/Make.lang, but it didn't work.  
 # (foka, 2000-08-16)  
 ifdef SUBLANG  
35  HTMLFILES = $(sort $(foreach i,$(SUBLANG),\  HTMLFILES = $(sort $(foreach i,$(SUBLANG),\
36          $(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES))))          $(patsubst %.wml,%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
37  HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\  HTMLDESTFILES = $(sort $(foreach i,$(SUBLANG),\
38          $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES))))          $(patsubst %.wml,$(HTMLDIR)/%.$(LANGUAGE)-$(i).html,$(WMLFILES))))
39  endif  endif
   
 # all the binary file types should be added below.  
40  JPGSOURCE := $(wildcard *.jpg)  JPGSOURCE := $(wildcard *.jpg)
41  JPGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(JPGSOURCE))  JPGDESTFILES := $(patsubst %,$(HTMLDIR)/%,$(JPGSOURCE))
42  GIFSOURCE := $(wildcard *.gif)  GIFSOURCE := $(wildcard *.gif)
# Line 54  IMGFILES := $(JPGSOURCE) $(GIFSOURCE) $( Line 59  IMGFILES := $(JPGSOURCE) $(GIFSOURCE) $(
59  IMGDESTFILES := $(JPGDESTFILES) $(GIFDESTFILES) $(PNGDESTFILES) $(PSDESTFILES) $(EPSDESTFILES) $(PDFDESTFILES) $(FIGDESTFILES) $(XCFDESTFILES) $(CSSSOURCE)  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)  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)  all:: $(HTMLFILES) $(existing-SUBS)
68    
69  $(existing-SUBS):  $(existing-SUBS):
70          $(MAKE) -C $@          $(MAKE) -C $@
71    
 existing-SUBS-install := $(addsuffix -install,$(existing-SUBS))  
   
72  install::  install::
73          test -d $(HTMLDIR) || mkdir -p $(HTMLDIR)          test -d $(HTMLDIR) || mkdir -p $(HTMLDIR)
74  install:: $(HTMLDESTFILES) $(IMGDESTFILES) $(existing-SUBS-install)  install:: $(HTMLDESTFILES) $(IMGDESTFILES) $(existing-SUBS-install)
# Line 69  install:: $(HTMLDESTFILES) $(IMGDESTFILE Line 76  install:: $(HTMLDESTFILES) $(IMGDESTFILE
76  $(existing-SUBS-install):  $(existing-SUBS-install):
77          $(MAKE) -C $(subst -install,,$@) install          $(MAKE) -C $(subst -install,,$@) install
78    
 existing-SUBS-clean := $(addsuffix -clean,$(existing-SUBS))  
   
79  clean::  clean::
80          rm -f *.$(LANGUAGE).html          rm -f *.$(LANGUAGE).html
81  clean:: $(existing-SUBS-clean)  clean:: $(existing-SUBS-clean)
# Line 78  clean:: $(existing-SUBS-clean) Line 83  clean:: $(existing-SUBS-clean)
83  $(existing-SUBS-clean):  $(existing-SUBS-clean):
84          $(MAKE) -C $(subst -clean,,$@) clean          $(MAKE) -C $(subst -clean,,$@) clean
85    
 existing-SUBS-cleandest := $(addsuffix -cleandest,$(existing-SUBS))  
   
86  cleandest::  cleandest::
87          rm -f $(HTMLDIR)/*.$(LANGUAGE).html          rm -f $(HTMLDIR)/*.$(LANGUAGE).html
88  cleandest:: $(existing-SUBS-cleandest)  cleandest:: $(existing-SUBS-cleandest)
# Line 89  $(existing-SUBS-cleandest): Line 92  $(existing-SUBS-cleandest):
92    
93  # the rule for every wml file  # the rule for every wml file
94  ifndef NOGENERICDEP  ifndef NOGENERICDEP
95    ifdef SPI
96    %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml
97            $(WML) $(<F)
98    else
99  %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml  %.$(LANGUAGE).html : %.wml $(TEMPLDIR)/template.wml $(TEMPLDIR)/languages.wml
100          $(WML) $(<F)          $(WML) $(<F)
101  endif  endif
102    endif
103    
104  $(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html  $(HTMLDIR)/%.$(LANGUAGE).html: %.$(LANGUAGE).html
105          @echo copying $(@F) to $(HTMLDIR)          @echo copying $(@F) to $(HTMLDIR)
106          -@cp $(@F) $(HTMLDIR)          -@cp $(@F) $(HTMLDIR)
107  ifeq ($(LANGUAGE),en)  ifeq ($(LANGUAGE),en)
108          @echo making a link $(@D)/$(*F).html -\> $(@F)          @echo making a link $(@D)/$(*F).html -\> $(@F)
109          -@ln -f -s $(@F) $(@D)/$(*F).html          @ln -sf $(@F) $(@D)/$(*F).html
110  endif  endif
111    
112  $(IMGDESTFILES): $(IMGFILES)  $(IMGDESTFILES): $(IMGFILES)
113          cp $(@F) $(HTMLDIR)          cp $(@F) $(HTMLDIR)
114    
115  # template dependencies  # template dependencies
116    ifdef SPI
117    $(TEMPLDIR)/template.wml: $(TEMPLDIR)/footer.wml $(TEMPLDIR)/languages.wml
118            touch $(TEMPLDIR)/template.wml
119    
120    $(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml
121            touch $(TEMPLDIR)/footer.wml
122    else
123  $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml  $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml
124          touch $(TEMPLDIR)/basic.wml          touch $(TEMPLDIR)/basic.wml
125    
# Line 143  $(TEMPLDIR)/security.wml: $(TEMPLDIR)/co Line 158  $(TEMPLDIR)/security.wml: $(TEMPLDIR)/co
158  $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \  $(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \
159                  $(TEMPLDIR)/footer.wml                  $(TEMPLDIR)/footer.wml
160          touch $(TEMPLDIR)/ddp.wml          touch $(TEMPLDIR)/ddp.wml
161    endif
162    
163  .SUFFIXES:  .SUFFIXES:
164  .PHONY: all $(existing-SUBS) install $(existing-SUBS-install)  .PHONY: all $(existing-SUBS) install $(existing-SUBS-install)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.5