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
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
70 $(TMPDIR
)/%.sfd
: $(SRCDIR
)/%.sfd
73 sed
"s@\(Version:\? \)\(0\.[0-9]\+\.[0-9]\+\|[1-9][0-9]*\.[0-9]\+\)@\1$(VERSION)@" $< > $@
76 $(TMPDIR
)/DejaVuLGC
%.sfd
: $(TMPDIR
)/DejaVu
%.sfd
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 $@"
86 $(BUILDDIR
)/%.ttf
: $(TMPDIR
)/%.sfd
95 $(BUILDDIR
)/status.txt
: $(FULLSFD
)
98 $(STATUS
) $(VERSION
) $(OLDSTATUS
) $(FULLSFD
) > $@
100 $(BUILDDIR
)/unicover.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuSans DejaVuSerif DejaVuSansMono
)
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
111 $(UNICOVER
) $(UNICODEDATA
) $(BLOCKS
) \
112 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
114 $(BUILDDIR
)/unicover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
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
)
128 $(LANGCOVER
) $(FC-LANG
) \
129 $(TMPDIR
)/DejaVuSans.sfd
"Sans" \
130 $(TMPDIR
)/DejaVuSerif.sfd
"Serif" \
131 $(TMPDIR
)/DejaVuSansMono.sfd
"Sans Mono" > $@
134 $(BUILDDIR
)/langcover-sans.txt
: $(TMPDIR
)/DejaVuSans.sfd
140 $(LANGCOVER
) $(FC-LANG
) \
141 $(TMPDIR
)/DejaVuSans.sfd
"Sans" > $@
144 $(BUILDDIR
)/langcover-lgc.txt
: $(patsubst %, $(TMPDIR
)/%.sfd
, DejaVuLGCSans DejaVuLGCSerif DejaVuLGCSansMono
)
150 $(LANGCOVER
) $(FC-LANG
) \
151 $(TMPDIR
)/DejaVuLGCSans.sfd
"Sans" \
152 $(TMPDIR
)/DejaVuLGCSerif.sfd
"Serif" \
153 $(TMPDIR
)/DejaVuLGCSansMono.sfd
"Sans Mono" > $@
156 $(BUILDDIR
)/Makefile
: Makefile
159 sed
-e
"s+^VERSION\([[:space:]]*\)=\(.*\)+VERSION = $(VERSION)+g"\
160 -e
"s+^SNAPSHOT\([[:space:]]*\)=\(.*\)+SNAPSHOT = $(SNAPSHOT)+g" < $< > $@
163 $(TMPDIR
)/$(SRCARCHIVE
): $(addprefix $(BUILDDIR
)/, $(GENDOCFULL
) Makefile
) $(FULLSFD
)
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
) \
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
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
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
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
)/%
201 (cd
$(TMPDIR
); zip
-rv
$(abspath
$@
) $(notdir $<))
203 $(DISTDIR
)/%.
tar.bz2
: $(TMPDIR
)/%
206 (cd
$(TMPDIR
); tar cjvf
$(abspath
$@
) $(notdir $<))
210 (cd
$(dir $<); md5sum
-b
$(notdir $<) > $(abspath
$@
))
214 (cd
$(dir $<); sha512sum
-b
$(notdir $<) > $(abspath
$@
))
217 @echo
"[11] $< => $@"
223 echo
"[12] Checking $$sfd" ;\
228 for sfd in
$(SFDFILES
) ; do \
229 echo
"[13] $(TMPDIR)/$$sfd.norm => $(SRCDIR)/$$sfd" ;\
230 cp
-p
$(TMPDIR
)/$$sfd.norm
$(SRCDIR
)/$$sfd ;\
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
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
))
261 check-harder
: clean check
263 pre-patch
: munge
clean
266 $(RM
) -r
$(TMPDIR
) $(BUILDDIR
) $(DISTDIR
)