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 GENDOCFULL
= unicover.txt langcover.txt status.txt
66 GENDOCSANS
= unicover-sans.txt langcover-sans.txt
67 GENDOCLGC
= unicover-lgc.txt langcover-lgc.txt
71 $(TMPDIR
)/%.sfd
: $(SRCDIR
)/%.sfd
74 sed
"s@\(Version:\? \)\(0\.[0-9]\+\.[0-9]\+\|[1-9][0-9]*\.[0-9]\+\)@\1$(VERSION)@" $< > $@
77 $(TMPDIR
)/DejaVuLGC
%.sfd
: $(TMPDIR
)/DejaVu
%.sfd
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 $@"
87 $(BUILDDIR
)/%.ttf
: $(TMPDIR
)/%.sfd
96 $(BUILDDIR
)/status.txt
: $(FULLSFD
)
99 $(STATUS
) $(VERSION
) $(OLDSTATUS
) $(FULLSFD
) > $@
101 $(BUILDDIR
)/unicover.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuSans DejaVuSerif DejaVuSansMono
)
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
112 $(UNICOVER
) $(UNICODEDATA
) $(BLOCKS
) \
113 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
115 $(BUILDDIR
)/unicover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
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
)
129 $(LANGCOVER
) $(FC-LANG
) \
130 $(TMPDIR
)/DejaVuSans.sfd
"Sans" \
131 $(TMPDIR
)/DejaVuSerif.sfd
"Serif" \
132 $(TMPDIR
)/DejaVuSansMono.sfd
"Sans Mono" > $@
135 $(BUILDDIR
)/langcover-sans.txt
: $(TMPDIR
)/DejaVuSans.sfd
141 $(LANGCOVER
) $(FC-LANG
) \
142 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
145 $(BUILDDIR
)/langcover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
151 $(LANGCOVER
) $(FC-LANG
) \
152 $(TMPDIR
)/DejaVuLGCSans.sfd
"Sans" \
153 $(TMPDIR
)/DejaVuLGCSerif.sfd
"Serif" \
154 $(TMPDIR
)/DejaVuLGCSansMono.sfd
"Sans Mono" > $@
157 $(BUILDDIR
)/Makefile
: Makefile
160 sed
-e
"s+^VERSION\([[:space:]]*\)=\(.*\)+VERSION = $(VERSION)+g"\
161 -e
"s+^SNAPSHOT\([[:space:]]*\)=\(.*\)+SNAPSHOT = $(SNAPSHOT)+g" < $< > $@
164 $(TMPDIR
)/$(SRCARCHIVE
): $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
) Makefile
) $(FULLSFD
)
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
) \
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
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
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
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
)/%
210 (cd
$(TMPDIR
); zip
-rv
$(abspath
$@
) $(notdir $<))
212 $(DISTDIR
)/%.
tar.bz2
: $(TMPDIR
)/%
215 (cd
$(TMPDIR
); tar cjvf
$(abspath
$@
) $(notdir $<))
219 (cd
$(dir $<); md5sum
-b
$(notdir $<) > $(abspath
$@
))
223 (cd
$(dir $<); sha512sum
-b
$(notdir $<) > $(abspath
$@
))
226 @echo
"[11] $< => $@"
232 echo
"[12] Checking $$sfd" ;\
237 for sfd in
$(SFDFILES
) ; do \
238 echo
"[13] $(TMPDIR)/$$sfd.norm => $(SRCDIR)/$$sfd" ;\
239 cp
$(TMPDIR
)/$$sfd.norm
$(SRCDIR
)/$$sfd ;\
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
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
))
270 check-harder
: clean check
272 pre-patch
: munge
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