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
7 # Initial source directory, assumed read-only
9 # Directory where temporary files live
11 # Directory where final files are created
13 # Directory where final archives are created
17 FONTCONFDIR
= fontconfig
21 RESOURCEDIR
= resources
24 ARCHIVEVER
= $(VERSION
)
26 ARCHIVEVER
= $(VERSION
)-$(SNAPSHOT
)
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 STATICSRCDOC
:= $(addprefix $(DOCDIR
)/, BUILDING
)
66 GENDOCFULL
= unicover.txt langcover.txt status.txt
67 GENDOCSANS
= unicover-sans.txt langcover-sans.txt
68 GENDOCLGC
= unicover-lgc.txt langcover-lgc.txt
72 $(TMPDIR
)/%.sfd
: $(SRCDIR
)/%.sfd
75 sed
"s@\(Version:\? \)\(0\.[0-9]\+\.[0-9]\+\|[1-9][0-9]*\.[0-9]\+\)@\1$(VERSION)@" $< > $@
78 $(TMPDIR
)/DejaVuLGC
%.sfd
: $(TMPDIR
)/DejaVu
%.sfd
80 sed
-e
's,FontName: DejaVu,FontName: DejaVuLGC,'\
81 -e
's,FullName: DejaVu,FullName: DejaVu LGC,'\
82 -e
's,FamilyName: DejaVu,FamilyName: DejaVu LGC,'\
83 -e
's,"DejaVu \(\(Sans\|Serif\)*\( Condensed\| Mono\)*\( Bold\)*\( Oblique\|Italic\)*\)","DejaVu LGC \1",g' < $< > $@
84 @echo
"Stripping unwanted glyphs from $@"
88 $(BUILDDIR
)/%.ttf
: $(TMPDIR
)/%.sfd
97 $(BUILDDIR
)/status.txt
: $(FULLSFD
)
100 $(STATUS
) $(VERSION
) $(OLDSTATUS
) $(FULLSFD
) > $@
102 $(BUILDDIR
)/unicover.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuSans DejaVuSerif DejaVuSansMono
)
105 $(UNICOVER
) $(UNICODEDATA
) $(BLOCKS
) \
106 $(TMPDIR
)/DejaVuSans.sfd
"Sans" \
107 $(TMPDIR
)/DejaVuSerif.sfd
"Serif" \
108 $(TMPDIR
)/DejaVuSansMono.sfd
"Sans Mono" > $@
110 $(BUILDDIR
)/unicover-sans.txt
: $(TMPDIR
)/DejaVuSans.sfd
113 $(UNICOVER
) $(UNICODEDATA
) $(BLOCKS
) \
114 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
116 $(BUILDDIR
)/unicover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
119 $(UNICOVER
) $(UNICODEDATA
) $(BLOCKS
) \
120 $(TMPDIR
)/DejaVuLGCSans.sfd
"Sans" \
121 $(TMPDIR
)/DejaVuLGCSerif.sfd
"Serif" \
122 $(TMPDIR
)/DejaVuLGCSansMono.sfd
"Sans Mono" > $@
124 $(BUILDDIR
)/langcover.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuSans DejaVuSerif DejaVuSansMono
)
130 $(LANGCOVER
) $(FC-LANG
) \
131 $(TMPDIR
)/DejaVuSans.sfd
"Sans" \
132 $(TMPDIR
)/DejaVuSerif.sfd
"Serif" \
133 $(TMPDIR
)/DejaVuSansMono.sfd
"Sans Mono" > $@
136 $(BUILDDIR
)/langcover-sans.txt
: $(TMPDIR
)/DejaVuSans.sfd
142 $(LANGCOVER
) $(FC-LANG
) \
143 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
146 $(BUILDDIR
)/langcover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
152 $(LANGCOVER
) $(FC-LANG
) \
153 $(TMPDIR
)/DejaVuLGCSans.sfd
"Sans" \
154 $(TMPDIR
)/DejaVuLGCSerif.sfd
"Serif" \
155 $(TMPDIR
)/DejaVuLGCSansMono.sfd
"Sans Mono" > $@
158 $(BUILDDIR
)/Makefile
: Makefile
161 sed
-e
"s+^VERSION\([[:space:]]*\)=\(.*\)+VERSION = $(VERSION)+g"\
162 -e
"s+^SNAPSHOT\([[:space:]]*\)=\(.*\)+SNAPSHOT = $(SNAPSHOT)+g" < $< > $@
165 $(TMPDIR
)/$(SRCARCHIVE
): $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
) Makefile
) $(FULLSFD
)
167 install -d
-m
0755 $@
/$(SCRIPTSDIR
)
168 install -d
-m
0755 $@
/$(SRCDIR
)
169 install -d
-m
0755 $@
/$(FONTCONFDIR
)
170 install -d
-m
0755 $@
/$(DOCDIR
)
171 install -p
-m
0644 $(BUILDDIR
)/Makefile
$@
172 install -p
-m
0755 $(GENERATE
) $(TTPOSTPROC
) $(LGC
) $(NORMALIZE
) \
173 $(UNICOVER
) $(LANGCOVER
) $(STATUS
) $(PROBLEMS
) \
175 install -p
-m
0644 $(FULLSFD
) $@
/$(SRCDIR
)
176 install -p
-m
0644 $(FONTCONF
) $@
/$(FONTCONFDIR
)
177 install -p
-m
0644 $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
)) \
178 $(STATICDOC
) $(STATICSRCDOC
) $@
/$(DOCDIR
)
180 $(TMPDIR
)/$(FULLARCHIVE
): full
182 install -d
-m
0755 $@
/$(TTFDIR
)
183 install -d
-m
0755 $@
/$(FONTCONFDIR
)
184 install -d
-m
0755 $@
/$(DOCDIR
)
185 install -p
-m
0644 $(FULLTTF
) $@
/$(TTFDIR
)
186 install -p
-m
0644 $(FONTCONFFULL
) $@
/$(FONTCONFDIR
)
187 install -p
-m
0644 $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
)) \
188 $(STATICDOC
) $@
/$(DOCDIR
)
190 $(TMPDIR
)/$(SANSARCHIVE
): sans
192 install -d
-m
0755 $@
/$(TTFDIR
)
193 install -d
-m
0755 $@
/$(DOCDIR
)
194 install -p
-m
0644 $(BUILDDIR
)/DejaVuSans.ttf
$@
/$(TTFDIR
)
195 install -p
-m
0644 $(addprefix $(BUILDDIR
)/, $(GENDOCSANS
)) \
196 $(STATICDOC
) $@
/$(DOCDIR
)
198 $(TMPDIR
)/$(LGCARCHIVE
): lgc
200 install -d
-m
0755 $@
/$(TTFDIR
)
201 install -d
-m
0755 $@
/$(FONTCONFDIR
)
202 install -d
-m
0755 $@
/$(DOCDIR
)
203 install -p
-m
0644 $(LGCTTF
) $@
/$(TTFDIR
)
204 install -p
-m
0644 $(FONTCONFLGC
) $@
/$(FONTCONFDIR
)
205 install -p
-m
0644 $(addprefix $(BUILDDIR
)/, $(GENDOCLGC
)) \
206 $(STATICDOC
) $@
/$(DOCDIR
)
208 $(DISTDIR
)/%.zip
: $(TMPDIR
)/%
211 (cd
$(TMPDIR
); zip
-rv
$(abspath
$@
) $(notdir $<))
213 $(DISTDIR
)/%.
tar.bz2
: $(TMPDIR
)/%
216 (cd
$(TMPDIR
); tar cjvf
$(abspath
$@
) $(notdir $<))
220 (cd
$(dir $<); md5sum
-b
$(notdir $<) > $(abspath
$@
))
224 (cd
$(dir $<); sha512sum
-b
$(notdir $<) > $(abspath
$@
))
227 @echo
"[11] $< => $@"
233 echo
"[12] Checking $$sfd" ;\
238 for sfd in
$(SFDFILES
) ; do \
239 echo
"[13] $(TMPDIR)/$$sfd.norm => $(SRCDIR)/$$sfd" ;\
240 cp
$(TMPDIR
)/$$sfd.norm
$(SRCDIR
)/$$sfd ;\
243 full
: $(FULLTTF
) $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
))
245 sans
: $(addprefix $(BUILDDIR
)/, DejaVuSans.ttf
$(GENDOCSANS
))
247 lgc
: $(LGCTTF
) $(addprefix $(BUILDDIR
)/, $(GENDOCLGC
))
249 ttf
: full-ttf sans-ttf lgc-ttf
251 full-ttf
: $(FULLTTF
)
253 sans-ttf
: $(BUILDDIR
)/DejaVuSans.ttf
257 status
: $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
))
259 dist : src-dist full-dist sans-dist lgc-dist
261 src-dist
: $(addprefix $(DISTDIR
)/$(SRCARCHIVE
), $(ARCHIVEEXT
) $(SUMEXT
))
263 full-dist
: $(addprefix $(DISTDIR
)/$(FULLARCHIVE
), $(ARCHIVEEXT
) $(SUMEXT
))
265 sans-dist
: $(addprefix $(DISTDIR
)/$(SANSARCHIVE
), $(ARCHIVEEXT
) $(SUMEXT
))
267 lgc-dist
: $(addprefix $(DISTDIR
)/$(LGCARCHIVE
), $(ARCHIVEEXT
) $(SUMEXT
))
271 check-harder
: clean check
273 pre-patch
: munge
clean
276 $(RM
) -r
$(TMPDIR
) $(BUILDDIR
) $(DISTDIR
)
278 condensed
: $(NORMSFD
)
279 $(NARROW
) 90 $(TMPDIR
)/DejaVuSans.sfd.norm
280 $(NARROW
) 90 $(TMPDIR
)/DejaVuSans-Bold.sfd.norm
281 $(NARROW
) 90 $(TMPDIR
)/DejaVuSans-Oblique.sfd.norm
282 $(NARROW
) 90 $(TMPDIR
)/DejaVuSans-BoldOblique.sfd.norm
283 $(NARROW
) 90 $(TMPDIR
)/DejaVuSerif.sfd.norm
284 $(NARROW
) 90 $(TMPDIR
)/DejaVuSerif-Bold.sfd.norm
285 $(NARROW
) 90 $(TMPDIR
)/DejaVuSerif-Italic.sfd.norm
286 $(NARROW
) 90 $(TMPDIR
)/DejaVuSerif-BoldItalic.sfd.norm
287 $(NORMALIZE
) $(TMPDIR
)/DejaVuSans.sfd.norm.narrow
288 $(NORMALIZE
) $(TMPDIR
)/DejaVuSans-Bold.sfd.norm.narrow
289 $(NORMALIZE
) $(TMPDIR
)/DejaVuSans-Oblique.sfd.norm.narrow
290 $(NORMALIZE
) $(TMPDIR
)/DejaVuSans-BoldOblique.sfd.norm.narrow
291 $(NORMALIZE
) $(TMPDIR
)/DejaVuSerif.sfd.norm.narrow
292 $(NORMALIZE
) $(TMPDIR
)/DejaVuSerif-Bold.sfd.norm.narrow
293 $(NORMALIZE
) $(TMPDIR
)/DejaVuSerif-Italic.sfd.norm.narrow
294 $(NORMALIZE
) $(TMPDIR
)/DejaVuSerif-BoldItalic.sfd.norm.narrow
295 cp
$(TMPDIR
)/DejaVuSans.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSansCondensed.sfd.norm
296 cp
$(TMPDIR
)/DejaVuSans-Bold.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSansCondensed-Bold.sfd.norm
297 cp
$(TMPDIR
)/DejaVuSans-Oblique.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSansCondensed-Oblique.sfd.norm
298 cp
$(TMPDIR
)/DejaVuSans-BoldOblique.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSansCondensed-BoldOblique.sfd.norm
299 cp
$(TMPDIR
)/DejaVuSerif.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSerifCondensed.sfd.norm
300 cp
$(TMPDIR
)/DejaVuSerif-Bold.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSerifCondensed-Bold.sfd.norm
301 cp
$(TMPDIR
)/DejaVuSerif-Italic.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSerifCondensed-Italic.sfd.norm
302 cp
$(TMPDIR
)/DejaVuSerif-BoldItalic.sfd.norm.narrow.norm
$(TMPDIR
)/DejaVuSerifCondensed-BoldItalic.sfd.norm