* updated version to 2.26
[dejavu.git] / dejavu-fonts / Makefile
blob491d42c5a4896f7b9077b844501276ef513bb857
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.26
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
50 NARROW = $(SCRIPTSDIR)/narrow.pe
52 SRC := $(wildcard $(SRCDIR)/*.sfd)
53 SFDFILES := $(patsubst $(SRCDIR)/%, %, $(SRC))
54 FULLSFD := $(patsubst $(SRCDIR)/%.sfd, $(TMPDIR)/%.sfd, $(SRC))
55 NORMSFD := $(patsubst %, %.norm, $(FULLSFD))
56 LGCSFD := $(patsubst $(SRCDIR)/DejaVu%.sfd, $(TMPDIR)/DejaVuLGC%.sfd, $(SRC))
57 FULLTTF := $(patsubst $(TMPDIR)/%.sfd, $(BUILDDIR)/%.ttf, $(FULLSFD))
58 LGCTTF := $(patsubst $(TMPDIR)/%.sfd, $(BUILDDIR)/%.ttf, $(LGCSFD))
60 FONTCONF := $(wildcard $(FONTCONFDIR)/*.conf)
61 FONTCONFLGC := $(wildcard $(FONTCONFDIR)/*lgc*.conf)
62 FONTCONFFULL := $(filter-out $(FONTCONFLGC), $(FONTCONF))
64 STATICDOC := $(addprefix $(DOCDIR)/, AUTHORS BUGS LICENSE NEWS README)
65 GENDOCFULL = unicover.txt langcover.txt status.txt
66 GENDOCSANS = unicover-sans.txt langcover-sans.txt
67 GENDOCLGC = unicover-lgc.txt langcover-lgc.txt
69 all : full sans lgc
71 $(TMPDIR)/%.sfd: $(SRCDIR)/%.sfd
72 @echo "[1] $< => $@"
73 install -d $(dir $@)
74 sed "s@\(Version:\? \)\(0\.[0-9]\+\.[0-9]\+\|[1-9][0-9]*\.[0-9]\+\)@\1$(VERSION)@" $< > $@
75 touch -r $< $@
77 $(TMPDIR)/DejaVuLGC%.sfd: $(TMPDIR)/DejaVu%.sfd
78 @echo "[2] $< => $@"
79 sed -e 's,FontName: DejaVu,FontName: DejaVuLGC,'\
80 -e 's,FullName: DejaVu,FullName: DejaVu LGC,'\
81 -e 's,FamilyName: DejaVu,FamilyName: DejaVu LGC,'\
82 -e 's,"DejaVu \(\(Sans\|Serif\)*\( Condensed\| Mono\)*\( Bold\)*\( Oblique\|Italic\)*\)","DejaVu LGC \1",g' < $< > $@
83 @echo "Stripping unwanted glyphs from $@"
84 $(LGC) $@
85 touch -r $< $@
87 $(BUILDDIR)/%.ttf: $(TMPDIR)/%.sfd
88 @echo "[3] $< => $@"
89 install -d $(dir $@)
90 $(GENERATE) $<
91 mv $<.ttf $@
92 $(TTPOSTPROC) $@
93 $(RM) $@~
94 touch -r $< $@
96 $(BUILDDIR)/status.txt: $(FULLSFD)
97 @echo "[4] => $@"
98 install -d $(dir $@)
99 $(STATUS) $(VERSION) $(OLDSTATUS) $(FULLSFD) > $@
101 $(BUILDDIR)/unicover.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuSans DejaVuSerif DejaVuSansMono)
102 @echo "[5] => $@"
103 install -d $(dir $@)
104 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
105 $(TMPDIR)/DejaVuSans.sfd "Sans" \
106 $(TMPDIR)/DejaVuSerif.sfd "Serif" \
107 $(TMPDIR)/DejaVuSansMono.sfd "Sans Mono" > $@
109 $(BUILDDIR)/unicover-sans.txt: $(TMPDIR)/DejaVuSans.sfd
110 @echo "[5] => $@"
111 install -d $(dir $@)
112 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
113 $(TMPDIR)/DejaVuSans.sfd "Sans" > $@
115 $(BUILDDIR)/unicover-lgc.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono)
116 @echo "[5] => $@"
117 install -d $(dir $@)
118 $(UNICOVER) $(UNICODEDATA) $(BLOCKS) \
119 $(TMPDIR)/DejaVuLGCSans.sfd "Sans" \
120 $(TMPDIR)/DejaVuLGCSerif.sfd "Serif" \
121 $(TMPDIR)/DejaVuLGCSansMono.sfd "Sans Mono" > $@
123 $(BUILDDIR)/langcover.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuSans DejaVuSerif DejaVuSansMono)
124 @echo "[6] => $@"
125 install -d $(dir $@)
126 ifeq "$(FC-LANG)" ""
127 touch $@
128 else
129 $(LANGCOVER) $(FC-LANG) \
130 $(TMPDIR)/DejaVuSans.sfd "Sans" \
131 $(TMPDIR)/DejaVuSerif.sfd "Serif" \
132 $(TMPDIR)/DejaVuSansMono.sfd "Sans Mono" > $@
133 endif
135 $(BUILDDIR)/langcover-sans.txt: $(TMPDIR)/DejaVuSans.sfd
136 @echo "[6] => $@"
137 install -d $(dir $@)
138 ifeq "$(FC-LANG)" ""
139 touch $@
140 else
141 $(LANGCOVER) $(FC-LANG) \
142 $(TMPDIR)/DejaVuSans.sfd "Sans" > $@
143 endif
145 $(BUILDDIR)/langcover-lgc.txt: $(patsubst %, $(TMPDIR)/%.sfd, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono)
146 @echo "[6] => $@"
147 install -d $(dir $@)
148 ifeq "$(FC-LANG)" ""
149 touch $@
150 else
151 $(LANGCOVER) $(FC-LANG) \
152 $(TMPDIR)/DejaVuLGCSans.sfd "Sans" \
153 $(TMPDIR)/DejaVuLGCSerif.sfd "Serif" \
154 $(TMPDIR)/DejaVuLGCSansMono.sfd "Sans Mono" > $@
155 endif
157 $(BUILDDIR)/Makefile: Makefile
158 @echo "[7] => $@"
159 install -d $(dir $@)
160 sed -e "s+^VERSION\([[:space:]]*\)=\(.*\)+VERSION = $(VERSION)+g"\
161 -e "s+^SNAPSHOT\([[:space:]]*\)=\(.*\)+SNAPSHOT = $(SNAPSHOT)+g" < $< > $@
162 touch -r $< $@
164 $(TMPDIR)/$(SRCARCHIVE): $(addprefix $(BUILDDIR)/, $(GENDOCFULL) Makefile) $(FULLSFD)
165 @echo "[8] => $@"
166 install -d -m 0755 $@/$(SCRIPTSDIR)
167 install -d -m 0755 $@/$(SRCDIR)
168 install -d -m 0755 $@/$(FONTCONFDIR)
169 install -d -m 0755 $@/$(DOCDIR)
170 install -p -m 0644 $(BUILDDIR)/Makefile $@
171 install -p -m 0755 $(GENERATE) $(TTPOSTPROC) $(LGC) $(NORMALIZE) \
172 $(UNICOVER) $(LANGCOVER) $(STATUS) $(PROBLEMS) \
173 $@/$(SCRIPTSDIR)
174 install -p -m 0644 $(FULLSFD) $@/$(SRCDIR)
175 install -p -m 0644 $(FONTCONF) $@/$(FONTCONFDIR)
176 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCFULL)) \
177 $(STATICDOC) $@/$(DOCDIR)
179 $(TMPDIR)/$(FULLARCHIVE): full
180 @echo "[8] => $@"
181 install -d -m 0755 $@/$(TTFDIR)
182 install -d -m 0755 $@/$(FONTCONFDIR)
183 install -d -m 0755 $@/$(DOCDIR)
184 install -p -m 0644 $(FULLTTF) $@/$(TTFDIR)
185 install -p -m 0644 $(FONTCONFFULL) $@/$(FONTCONFDIR)
186 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCFULL)) \
187 $(STATICDOC) $@/$(DOCDIR)
189 $(TMPDIR)/$(SANSARCHIVE): sans
190 @echo "[8] => $@"
191 install -d -m 0755 $@/$(TTFDIR)
192 install -d -m 0755 $@/$(DOCDIR)
193 install -p -m 0644 $(BUILDDIR)/DejaVuSans.ttf $@/$(TTFDIR)
194 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCSANS)) \
195 $(STATICDOC) $@/$(DOCDIR)
197 $(TMPDIR)/$(LGCARCHIVE): lgc
198 @echo "[8] => $@"
199 install -d -m 0755 $@/$(TTFDIR)
200 install -d -m 0755 $@/$(FONTCONFDIR)
201 install -d -m 0755 $@/$(DOCDIR)
202 install -p -m 0644 $(LGCTTF) $@/$(TTFDIR)
203 install -p -m 0644 $(FONTCONFLGC) $@/$(FONTCONFDIR)
204 install -p -m 0644 $(addprefix $(BUILDDIR)/, $(GENDOCLGC)) \
205 $(STATICDOC) $@/$(DOCDIR)
207 $(DISTDIR)/%.zip: $(TMPDIR)/%
208 @echo "[9] => $@"
209 install -d $(dir $@)
210 (cd $(TMPDIR); zip -rv $(abspath $@) $(notdir $<))
212 $(DISTDIR)/%.tar.bz2: $(TMPDIR)/%
213 @echo "[9] => $@"
214 install -d $(dir $@)
215 (cd $(TMPDIR); tar cjvf $(abspath $@) $(notdir $<))
217 %.md5: %
218 @echo "[10] => $@"
219 (cd $(dir $<); md5sum -b $(notdir $<) > $(abspath $@))
221 %.sha512: %
222 @echo "[10] => $@"
223 (cd $(dir $<); sha512sum -b $(notdir $<) > $(abspath $@))
225 %.sfd.norm: %.sfd
226 @echo "[11] $< => $@"
227 $(NORMALIZE) $<
228 touch -r $< $@
230 check : $(NORMSFD)
231 for sfd in $^ ; do \
232 echo "[12] Checking $$sfd" ;\
233 $(PROBLEMS) $$sfd ;\
234 done
236 munge: $(NORMSFD)
237 for sfd in $(SFDFILES) ; do \
238 echo "[13] $(TMPDIR)/$$sfd.norm => $(SRCDIR)/$$sfd" ;\
239 cp $(TMPDIR)/$$sfd.norm $(SRCDIR)/$$sfd ;\
240 done
242 full : $(FULLTTF) $(addprefix $(BUILDDIR)/, $(GENDOCFULL))
244 sans : $(addprefix $(BUILDDIR)/, DejaVuSans.ttf $(GENDOCSANS))
246 lgc : $(LGCTTF) $(addprefix $(BUILDDIR)/, $(GENDOCLGC))
248 ttf : full-ttf sans-ttf lgc-ttf
250 full-ttf : $(FULLTTF)
252 sans-ttf: $(BUILDDIR)/DejaVuSans.ttf
254 lgc-ttf : $(LGCTTF)
256 status : $(addprefix $(BUILDDIR)/, $(GENDOCFULL))
258 dist : src-dist full-dist sans-dist lgc-dist
260 src-dist : $(addprefix $(DISTDIR)/$(SRCARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
262 full-dist : $(addprefix $(DISTDIR)/$(FULLARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
264 sans-dist : $(addprefix $(DISTDIR)/$(SANSARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
266 lgc-dist : $(addprefix $(DISTDIR)/$(LGCARCHIVE), $(ARCHIVEEXT) $(SUMEXT))
268 norm : $(NORMSFD)
270 check-harder : clean check
272 pre-patch : munge clean
274 clean :
275 $(RM) -r $(TMPDIR) $(BUILDDIR) $(DISTDIR)
277 condensed: $(NORMSFD)
278 $(NARROW) 90 $(TMPDIR)/DejaVuSans.sfd.norm
279 $(NARROW) 90 $(TMPDIR)/DejaVuSans-Bold.sfd.norm
280 $(NARROW) 90 $(TMPDIR)/DejaVuSans-Oblique.sfd.norm
281 $(NARROW) 90 $(TMPDIR)/DejaVuSans-BoldOblique.sfd.norm
282 $(NARROW) 90 $(TMPDIR)/DejaVuSerif.sfd.norm
283 $(NARROW) 90 $(TMPDIR)/DejaVuSerif-Bold.sfd.norm
284 $(NARROW) 90 $(TMPDIR)/DejaVuSerif-Italic.sfd.norm
285 $(NARROW) 90 $(TMPDIR)/DejaVuSerif-BoldItalic.sfd.norm
286 $(NORMALIZE) $(TMPDIR)/DejaVuSans.sfd.norm.narrow
287 $(NORMALIZE) $(TMPDIR)/DejaVuSans-Bold.sfd.norm.narrow
288 $(NORMALIZE) $(TMPDIR)/DejaVuSans-Oblique.sfd.norm.narrow
289 $(NORMALIZE) $(TMPDIR)/DejaVuSans-BoldOblique.sfd.norm.narrow
290 $(NORMALIZE) $(TMPDIR)/DejaVuSerif.sfd.norm.narrow
291 $(NORMALIZE) $(TMPDIR)/DejaVuSerif-Bold.sfd.norm.narrow
292 $(NORMALIZE) $(TMPDIR)/DejaVuSerif-Italic.sfd.norm.narrow
293 $(NORMALIZE) $(TMPDIR)/DejaVuSerif-BoldItalic.sfd.norm.narrow
294 cp $(TMPDIR)/DejaVuSans.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSansCondensed.sfd.norm
295 cp $(TMPDIR)/DejaVuSans-Bold.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSansCondensed-Bold.sfd.norm
296 cp $(TMPDIR)/DejaVuSans-Oblique.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSansCondensed-Oblique.sfd.norm
297 cp $(TMPDIR)/DejaVuSans-BoldOblique.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSansCondensed-BoldOblique.sfd.norm
298 cp $(TMPDIR)/DejaVuSerif.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSerifCondensed.sfd.norm
299 cp $(TMPDIR)/DejaVuSerif-Bold.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSerifCondensed-Bold.sfd.norm
300 cp $(TMPDIR)/DejaVuSerif-Italic.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSerifCondensed-Italic.sfd.norm
301 cp $(TMPDIR)/DejaVuSerif-BoldItalic.sfd.norm.narrow.norm $(TMPDIR)/DejaVuSerifCondensed-BoldItalic.sfd.norm