* fixed U+2117 in Sans Extralight, fixing bug #12900.
[dejavu.git] / dejavu-fonts / Makefile
blob57a836f38b7ad7be8e1c838734f217f673f5aaba
1 .PHONY: all check munge full sans lgc ttf full-ttf sans-ttf lgc-ttf status dist src-dist full-dist sans-dist lgc-dist norm check-harder pre-patch clean
3 # Release version
4 VERSION = 2.22
5 # Snapshot version
6 SNAPSHOT =
7 # Initial source directory, assumed read-only
8 SRCDIR = src
9 # Directory where temporary files live
10 TMPDIR = tmp
11 # Directory where final files are created
12 BUILDDIR = build
13 # Directory where final archives are created
14 DISTDIR = dist
16 # Release layout
17 FONTCONFDIR = fontconfig
18 DOCDIR = .
19 SCRIPTSDIR = scripts
20 TTFDIR = ttf
21 RESOURCEDIR = resources
23 ifeq "$(SNAPSHOT)" ""
24 ARCHIVEVER = $(VERSION)
25 else
26 ARCHIVEVER = $(VERSION)-$(SNAPSHOT)
27 endif
29 SRCARCHIVE = dejavu-fonts-$(ARCHIVEVER)
30 FULLARCHIVE = dejavu-fonts-ttf-$(ARCHIVEVER)
31 SANSARCHIVE = dejavu-sans-ttf-$(ARCHIVEVER)
32 LGCARCHIVE = dejavu-lgc-fonts-ttf-$(ARCHIVEVER)
34 ARCHIVEEXT = .zip .tar.bz2
35 SUMEXT = .zip.md5 .tar.bz2.md5 .tar.bz2.sha512
37 OLDSTATUS = $(DOCDIR)/status.txt
38 BLOCKS = $(RESOURCEDIR)/Blocks.txt
39 UNICODEDATA = $(RESOURCEDIR)/UnicodeData.txt
40 FC-LANG = $(RESOURCEDIR)/fc-lang
42 GENERATE = $(SCRIPTSDIR)/generate.pe
43 TTPOSTPROC = $(SCRIPTSDIR)/ttpostproc.pl
44 LGC = $(SCRIPTSDIR)/lgc.pe
45 UNICOVER = $(SCRIPTSDIR)/unicover.pl
46 LANGCOVER = $(SCRIPTSDIR)/langcover.pl
47 STATUS = $(SCRIPTSDIR)/status.pl
48 PROBLEMS = $(SCRIPTSDIR)/problems.pl
49 NORMALIZE = $(SCRIPTSDIR)/sfdnormalize.pl
51 SRC := $(wildcard $(SRCDIR)/*.sfd)
52 SFDFILES := $(patsubst $(SRCDIR)/%, %, $(SRC))
53 FULLSFD := $(patsubst $(SRCDIR)/%.sfd, $(TMPDIR)/%.sfd, $(SRC))
54 NORMSFD := $(patsubst %, %.norm, $(FULLSFD))
55 LGCSFD := $(patsubst $(SRCDIR)/DejaVu%.sfd, $(TMPDIR)/DejaVuLGC%.sfd, $(SRC))
56 FULLTTF := $(patsubst $(TMPDIR)/%.sfd, $(BUILDDIR)/%.ttf, $(FULLSFD))
57 LGCTTF := $(patsubst $(TMPDIR)/%.sfd, $(BUILDDIR)/%.ttf, $(LGCSFD))
59 FONTCONF := $(wildcard $(FONTCONFDIR)/*.conf)
60 FONTCONFLGC := $(wildcard $(FONTCONFDIR)/*lgc*.conf)
61 FONTCONFFULL := $(filter-out $(FONTCONFLGC), $(FONTCONF))
63 STATICDOC := $(addprefix $(DOCDIR)/, AUTHORS BUGS LICENSE NEWS README)
64 GENDOCFULL = unicover.txt langcover.txt status.txt
65 GENDOCSANS = unicover-sans.txt langcover-sans.txt
66 GENDOCLGC = unicover-lgc.txt langcover-lgc.txt
68 all : full sans lgc
70 $(TMPDIR)/%.sfd: $(SRCDIR)/%.sfd
71 @echo "[1] $< => $@"
72 install -d $(dir $@)
73 sed "s@\(Version:\? \)\(0\.[0-9]\+\.[0-9]\+\|[1-9][0-9]*\.[0-9]\+\)@\1$(VERSION)@" $< > $@
74 touch -r $< $@
76 $(TMPDIR)/DejaVuLGC%.sfd: $(TMPDIR)/DejaVu%.sfd
77 @echo "[2] $< => $@"
78 sed -e 's,FontName: DejaVu,FontName: DejaVuLGC,'\
79 -e 's,FullName: DejaVu,FullName: DejaVu LGC,'\
80 -e 's,FamilyName: DejaVu,FamilyName: DejaVu LGC,'\
81 -e 's,"DejaVu \(\(Sans\|Serif\)*\( Condensed\| Mono\)*\( Bold\)*\( Oblique\|Italic\)*\)","DejaVu LGC \1",g' < $< > $@
82 @echo "Stripping unwanted glyphs from $@"
83 $(LGC) $@
84 touch -r $< $@
86 $(BUILDDIR)/%.ttf: $(TMPDIR)/%.sfd
87 @echo "[3] $< => $@"
88 install -d $(dir $@)
89 $(GENERATE) $<
90 mv $<.ttf $@
91 $(TTPOSTPROC) $@
92 $(RM) $@~
93 touch -r $< $@
95 $(BUILDDIR)/status.txt: $(FULLSFD)
96 @echo "[4] => $@"
97 install -d $(dir $@)
98 $(STATUS) $(VERSION) $(OLDSTATUS) $(FULLSFD) > $@
100 $(BUILDDIR)/unicover.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuSans DejaVuSerif DejaVuSansMono)
101 @echo "[5] => $@"
102 install -d $(dir $@)
103 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
104 $(TMPDIR)/DejaVuSans.sfd "Sans" \
105 $(TMPDIR)/DejaVuSerif.sfd "Serif" \
106 $(TMPDIR)/DejaVuSansMono.sfd "Sans Mono" > $@
108 $(BUILDDIR)/unicover-sans.txt: $(TMPDIR)/DejaVuSans.sfd
109 @echo "[5] => $@"
110 install -d $(dir $@)
111 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
112 $(TMPDIR)/DejaVuSans.sfd "Sans" > $@
114 $(BUILDDIR)/unicover-lgc.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono)
115 @echo "[5] => $@"
116 install -d $(dir $@)
117 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
118 $(TMPDIR)/DejaVuLGCSans.sfd "Sans" \
119 $(TMPDIR)/DejaVuLGCSerif.sfd "Serif" \
120 $(TMPDIR)/DejaVuLGCSansMono.sfd "Sans Mono" > $@
122 $(BUILDDIR)/langcover.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuSans DejaVuSerif DejaVuSansMono)
123 @echo "[6] => $@"
124 install -d $(dir $@)
125 ifeq "$(FC-LANG)" ""
126 touch $@
127 else
128 $(LANGCOVER) $(FC-LANG) \
129 $(TMPDIR)/DejaVuSans.sfd "Sans" \
130 $(TMPDIR)/DejaVuSerif.sfd "Serif" \
131 $(TMPDIR)/DejaVuSansMono.sfd "Sans Mono" > $@
132 endif
134 $(BUILDDIR)/langcover-sans.txt: $(TMPDIR)/DejaVuSans.sfd
135 @echo "[6] => $@"
136 install -d $(dir $@)
137 ifeq "$(FC-LANG)" ""
138 touch $@
139 else
140 $(LANGCOVER) $(FC-LANG) \
141 $(TMPDIR)/DejaVuSans.sfd "Sans" > $@
142 endif
144 $(BUILDDIR)/langcover-lgc.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono)
145 @echo "[6] => $@"
146 install -d $(dir $@)
147 ifeq "$(FC-LANG)" ""
148 touch $@
149 else
150 $(LANGCOVER) $(FC-LANG) \
151 $(TMPDIR)/DejaVuLGCSans.sfd "Sans" \
152 $(TMPDIR)/DejaVuLGCSerif.sfd "Serif" \
153 $(TMPDIR)/DejaVuLGCSansMono.sfd "Sans Mono" > $@
154 endif
156 $(BUILDDIR)/Makefile: Makefile
157 @echo "[7] => $@"
158 install -d $(dir $@)
159 sed -e "s+^VERSION\([[:space:]]*\)=\(.*\)+VERSION = $(VERSION)+g"\
160 -e "s+^SNAPSHOT\([[:space:]]*\)=\(.*\)+SNAPSHOT = $(SNAPSHOT)+g" < $< > $@
161 touch -r $< $@
163 $(TMPDIR)/$(SRCARCHIVE): $(addprefix $(BUILDDIR)/, $(GENDOCFULL) Makefile) $(FULLSFD)
164 @echo "[8] => $@"
165 install -d -m 0755 $@/{$(SCRIPTSDIR),$(SRCDIR),$(FONTCONFDIR),$(DOCDIR)}
166 install -p -m 0644 $(BUILDDIR)/Makefile $@
167 install -p -m 0755 $(GENERATE) $(TTPOSTPROC) $(LGC) $(NORMALIZE) \
168 $(UNICOVER) $(LANGCOVER) $(STATUS) $(PROBLEMS) \
169 $@/$(SCRIPTSDIR)
170 install -p -m 0644 $(FULLSFD) $@/$(SRCDIR)
171 install -p -m 0644 $(FONTCONF) $@/$(FONTCONFDIR)
172 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCFULL)) \
173 $(STATICDOC) $@/$(DOCDIR)
175 $(TMPDIR)/$(FULLARCHIVE): full
176 @echo "[8] => $@"
177 install -d -m 0755 $@/{$(TTFDIR),$(FONTCONFDIR),$(DOCDIR)}
178 install -p -m 0644 $(FULLTTF) $@/$(TTFDIR)
179 install -p -m 0644 $(FONTCONFFULL) $@/$(FONTCONFDIR)
180 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCFULL)) \
181 $(STATICDOC) $@/$(DOCDIR)
183 $(TMPDIR)/$(SANSARCHIVE): sans
184 @echo "[8] => $@"
185 install -d -m 0755 $@/{$(TTFDIR),$(DOCDIR)}
186 install -p -m 0644 $(BUILDDIR)/DejaVuSans.ttf $@/$(TTFDIR)
187 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCSANS)) \
188 $(STATICDOC) $@/$(DOCDIR)
190 $(TMPDIR)/$(LGCARCHIVE): lgc
191 @echo "[8] => $@"
192 install -d -m 0755 $@/{$(TTFDIR),$(FONTCONFDIR),$(DOCDIR)}
193 install -p -m 0644 $(LGCTTF) $@/$(TTFDIR)
194 install -p -m 0644 $(FONTCONFLGC) $@/$(FONTCONFDIR)
195 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCLGC)) \
196 $(STATICDOC) $@/$(DOCDIR)
198 $(DISTDIR)/%.zip: $(TMPDIR)/%
199 @echo "[9] => $@"
200 install -d $(dir $@)
201 (cd $(TMPDIR); zip -rv $(abspath $@) $(notdir $<))
203 $(DISTDIR)/%.tar.bz2: $(TMPDIR)/%
204 @echo "[9] => $@"
205 install -d $(dir $@)
206 (cd $(TMPDIR); tar cjvf $(abspath $@) $(notdir $<))
208 %.md5: %
209 @echo "[10] => $@"
210 (cd $(dir $<); md5sum -b $(notdir $<) > $(abspath $@))
212 %.sha512: %
213 @echo "[10] => $@"
214 (cd $(dir $<); sha512sum -b $(notdir $<) > $(abspath $@))
216 %.sfd.norm: %.sfd
217 @echo "[11] $< => $@"
218 $(NORMALIZE) $<
219 touch -r $< $@
221 check : $(NORMSFD)
222 for sfd in $^ ; do \
223 echo "[12] Checking $$sfd" ;\
224 $(PROBLEMS) $$sfd ;\
225 done
227 munge: $(NORMSFD)
228 for sfd in $(SFDFILES) ; do \
229 echo "[13] $(TMPDIR)/$$sfd.norm => $(SRCDIR)/$$sfd" ;\
230 cp -p $(TMPDIR)/$$sfd.norm $(SRCDIR)/$$sfd ;\
231 done
233 full : $(FULLTTF) $(addprefix $(BUILDDIR)/, $(GENDOCFULL))
235 sans : $(addprefix $(BUILDDIR)/, DejaVuSans.ttf $(GENDOCSANS))
237 lgc : $(LGCTTF) $(addprefix $(BUILDDIR)/, $(GENDOCLGC))
239 ttf : full-ttf sans-ttf lgc-ttf
241 full-ttf : $(FULLTTF)
243 sans-ttf: $(BUILDDIR)/DejaVuSans.ttf
245 lgc-ttf : $(LGCTTF)
247 status : $(addprefix $(BUILDDIR)/, $(GENDOCFULL))
249 dist : src-dist full-dist sans-dist lgc-dist
251 src-dist : $(addprefix $(DISTDIR)/$(SRCARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
253 full-dist : $(addprefix $(DISTDIR)/$(FULLARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
255 sans-dist : $(addprefix $(DISTDIR)/$(SANSARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
257 lgc-dist : $(addprefix $(DISTDIR)/$(LGCARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
259 norm : $(NORMSFD)
261 check-harder : clean check
263 pre-patch : munge clean
265 clean :
266 $(RM) -r $(TMPDIR) $(BUILDDIR) $(DISTDIR)