unifont-7.0.01.tar.gz
[unifont.git] / font / Makefile
1 #
2 # Makefile to build a version of GNU Unifont with the
3 # unifoundry.com GNU Unifont utilities.  This Makefile
4 # converts unifont-$(VERSION).hex and related files into a final
5 # GNU Unifont font file.
6 #
7 # This software is released under version 2.0 of the GNU Public License,
8 # or (at your option) a later version of the GPL.
9 #
10 # Paul Hardy, 7 July 2008
11 #
12 # commands will be interpreted with the Bourne Shell
13 #
14 SHELL = /bin/sh
15 INSTALL = install
16 FONTFORGE = fontforge
17 #
18 # assembly date of this version
19 #
20 UNICODE_VERSION = 7.0
21 PKG_REV = 01
22 VERSION = $(UNICODE_VERSION).$(PKG_REV)
23
24 COPYRIGHT = "Copyright (C) 2014 Roman Czyborra, Paul Hardy, Qianqian Fang, \
25 Andrew Miller, et al.  \
26 Licensed under the GNU General Public License; either version 2, or \
27 (at your option) a later version, with the GNU Font Embedding Exception."
28
29 #
30 # Path to local unifont-bin utilities.  If your system doesn't
31 # use GNU's version of "make", use the first BINDIR definition.
32 # If using GNU's "make", use the second BINDIR definition.
33 #
34 # BINDIR = ../bin
35 BINDIR = $(CURDIR)/../bin
36 #
37 # The top-level directory for installing fonts on the system,
38 # and the installation directories for PCF and TrueType fonts.
39 #
40 CONSOLEDEST = $(DESTDIR)/usr/share/consolefonts
41 FONTDEST    = $(DESTDIR)/usr/share/fonts
42 PCFDEST     = $(FONTDEST)/X11/misc
43 TTFDEST     = $(FONTDEST)/truetype/unifont
44 #
45 # destination directory for compiled fonts
46 #
47 COMPILED_DIR = compiled
48 #
49 # destination directory for .png representation of font
50 #
51 PNGDIR = $(COMPILED_DIR)/png
52 #
53 # Directory with original unifont-$(VERSION).hex files
54 #
55 HEXDIR = plane00
56 #
57 # These are the files for building GNU Unifont with the Qianqian Fang's
58 # Wen Quan Yi CJK ideographs.  This version provides complete coverage
59 # of the Unicode Basic Multilingual Plane.
60 #
61 # If you want don't want to inlcude blank glyphs in unassigned code points,
62 # uncomment the UNASSIGNED definition or override from the make command line.
63 #
64 # Likewise, uncomment the PUA definiation if you want to use Private
65 # Use Area glyphs.
66 #
67 UNASSIGNED = $(HEXDIR)/unassigned.hex
68 # UNASSIGNED =
69
70 #
71 # Non-printing glyphs.  There are only about 100 of these, and many end
72 # users do want to print representations of these glyphs, so they are
73 # included as an optional assignment.
74 #
75 NONPRINTING = $(HEXDIR)/nonprinting.hex
76 # NONPRINTING =
77
78 #
79 # Private Use Area glyphs.  Uncomment to include four-digit hexadecimal glyphs
80 # or override from the make command line.
81 #
82 # PUA = $(HEXDIR)/pua.hex
83 PUA = 
84
85 # The remaining .hex files will be constant unless a customized font
86 # is being built.
87 UNIFONTBASE = $(HEXDIR)/unifont-base.hex
88 CJK         = $(HEXDIR)/wqy.hex
89 HANGUL      = $(HEXDIR)/hangul-syllables.hex
90 SPACES      = $(HEXDIR)/spaces.hex
91
92 UNIFILES = $(UNIFONTBASE) $(CJK) $(HANGUL) $(SPACES) $(UNASSIGNED) \
93            $(NONPRINTING) $(PUA)
94
95 #
96 # Planes 1 through 14 (0x0E) are ordinary;
97 # Planes 15 (0x0F) and 16 (0x10) are Private Use Area
98 #
99 UPPER_FILES = plane0[1-E]/*.hex
100
101 #
102 # Location of the file containing a list of Unicode combining characters.
103 #
104 COMBINING = plane00/bmp-combining.txt
105
106 UPPER_COMBINING = plane0[0-E]/*combining*.txt
107
108 VPATH = plane00 ttfsrc
109
110 #
111 # Location of  TTF source directory, where TTF font is built.
112 #
113 TTFSRC = ttfsrc
114
115
116 all: compiled
117
118 compiled: $(UNIFILES) $(COMBINING) $(UPPER_FILES) $(UPPER_COMBINING)
119         $(MAKE) compiled-files
120
121 compiled-files: pcf psf png ttf csurttf upperttf uppercsurttf bigpic coverage
122         install -p index.html $(COMPILED_DIR)/index.html
123
124 #
125 # Build the aggregate .hex font files
126 #
127 hex: distclean
128         if [ ! -d $(COMPILED_DIR) ] ; then \
129            mkdir -p $(COMPILED_DIR) ; \
130         fi
131         sort $(UNIFILES) > $(COMPILED_DIR)/unifont-$(VERSION).hex
132         (cd $(HEXDIR) ; sort *.hex) | \
133           egrep -v "^FFF[EF]" | \
134            $(BINDIR)/unigencircles $(COMBINING) plane00/nonprinting.hex \
135            > $(COMPILED_DIR)/unifont_sample-$(VERSION).hex
136         sort plane00csur/*.hex $(UNIFILES) \
137            > $(COMPILED_DIR)/unifont_csur-$(VERSION).hex
138         sort $(UPPER_FILES) \
139            > $(COMPILED_DIR)/unifont_upper-$(VERSION).hex
140         sort plane0[1-F]/*.hex plane0[1-F]csur/*.hex \
141            > $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex
142         sort $(UPPER_COMBINING) > $(COMPILED_DIR)/upper_combining.txt
143         sort plane0[1-F]/plane*-nonprinting.hex \
144            > $(COMPILED_DIR)/upper_nonprinting.hex
145         sort plane0[1-F]/*.hex | egrep -v "^..FFF[EF]" | \
146            $(BINDIR)/unigencircles $(COMPILED_DIR)/upper_combining.txt \
147            $(COMPILED_DIR)/upper_nonprinting.hex \
148            > $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex
149         # Create a .hex file with all CSUR glyphs, without combining circles
150         sort plane??csur/*.hex \
151            > $(COMPILED_DIR)/unifont_all_csur-$(VERSION).hex
152         # Create a .hex file with all CSUR glyphs, with combining circles
153         sort plane??csur/*combining.txt > $(COMPILED_DIR)/csur_combining.txt
154         $(BINDIR)/unigencircles \
155              $(COMPILED_DIR)/csur_combining.txt \
156              plane00/nonprinting.hex \
157            < $(COMPILED_DIR)/unifont_all_csur-$(VERSION).hex \
158            > $(COMPILED_DIR)/unifont_csur_sample-$(VERSION).hex
159
160 #
161 # Build a BDF font file from the final .hex file.
162 #
163 bdf: hex
164         # First make the default BDF font.  The font name will be "unifont".
165         $(BINDIR)/hex2bdf --version "$(VERSION)" --copyright $(COPYRIGHT) \
166            $(COMPILED_DIR)/unifont-$(VERSION).hex \
167            >$(COMPILED_DIR)/unifont-$(VERSION).bdf
168         gzip -f -9 <$(COMPILED_DIR)/unifont-$(VERSION).bdf \
169                    >$(COMPILED_DIR)/unifont-$(VERSION).bdf.gz
170         # Now make a version with combining circles.  The font name
171         # will be "unifont_sample" instead of "unifont" to distinguish
172         # it from the default font.
173         $(BINDIR)/hex2bdf --font "Unifont Sample" \
174            --version "$(VERSION)" --copyright $(COPYRIGHT) \
175              $(COMPILED_DIR)/unifont_sample-$(VERSION).hex \
176            > $(COMPILED_DIR)/unifont_sample-$(VERSION).bdf
177         gzip -f -9 <$(COMPILED_DIR)/unifont_sample-$(VERSION).bdf \
178                    >$(COMPILED_DIR)/unifont_sample-$(VERSION).bdf.gz
179         # Font with ConScript Unicode Registry (CSUR) glyphs added
180         $(BINDIR)/hex2bdf --font "Unifont CSUR" \
181            --version "$(VERSION)" --copyright $(COPYRIGHT) \
182              $(COMPILED_DIR)/unifont_csur-$(VERSION).hex \
183            > $(COMPILED_DIR)/unifont_csur-$(VERSION).bdf
184         gzip -f -9 <$(COMPILED_DIR)/unifont_csur-$(VERSION).bdf \
185                    >$(COMPILED_DIR)/unifont_csur-$(VERSION).bdf.gz
186         # Font with glyphs above Plane 0
187         $(BINDIR)/hex2bdf --font "Unifont Upper" \
188            --version "$(VERSION)" --copyright $(COPYRIGHT) \
189              $(COMPILED_DIR)/unifont_upper-$(VERSION).hex \
190            > $(COMPILED_DIR)/unifont_upper-$(VERSION).bdf
191         gzip -f -9 <$(COMPILED_DIR)/unifont_upper-$(VERSION).bdf \
192                    >$(COMPILED_DIR)/unifont_upper-$(VERSION).bdf.gz
193         # Font with glyphs above Plane 0 with CSUR glyphs above Plane 0
194         $(BINDIR)/hex2bdf --font "Unifont Upper CSUR" \
195            --version "$(VERSION)" --copyright $(COPYRIGHT) \
196              $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex \
197            > $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf
198         gzip -f -9 <$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf \
199                    >$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf.gz
200         # Font with glyphs above Plane 0 with combining circles added
201         $(BINDIR)/hex2bdf --font "Unifont Upper Sample" \
202            --version "$(VERSION)" --copyright $(COPYRIGHT) \
203              $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
204            > $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf
205         gzip -f -9 <$(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf \
206                    >$(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf.gz
207
208 #
209 # Build a PCF font file from the final .hex file.
210 #
211 pcf: bdf
212         bdftopcf <$(COMPILED_DIR)/unifont-$(VERSION).bdf \
213                  >$(COMPILED_DIR)/unifont-$(VERSION).pcf
214         gzip -f -9 $(COMPILED_DIR)/unifont-$(VERSION).pcf
215         bdftopcf <$(COMPILED_DIR)/unifont_sample-$(VERSION).bdf \
216                  >$(COMPILED_DIR)/unifont_sample-$(VERSION).pcf
217         gzip -f -9 $(COMPILED_DIR)/unifont_sample-$(VERSION).pcf
218         bdftopcf <$(COMPILED_DIR)/unifont_csur-$(VERSION).bdf \
219                  >$(COMPILED_DIR)/unifont_csur-$(VERSION).pcf
220         gzip -f -9 $(COMPILED_DIR)/unifont_csur-$(VERSION).pcf
221         bdftopcf <$(COMPILED_DIR)/unifont_upper-$(VERSION).bdf \
222                  >$(COMPILED_DIR)/unifont_upper-$(VERSION).pcf
223         gzip -f -9 $(COMPILED_DIR)/unifont_upper-$(VERSION).pcf
224         bdftopcf <$(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf \
225                  >$(COMPILED_DIR)/unifont_upper_sample-$(VERSION).pcf
226         gzip -f -9 $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).pcf
227         bdftopcf <$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf \
228                  >$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).pcf
229         gzip -f -9 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).pcf
230
231 #
232 # Make the PSF (console) font for APL (A Programming Language).
233 #
234 psf: bdf
235         bdf2psf --fb \
236            $(COMPILED_DIR)/unifont-$(VERSION).bdf \
237            psf/apl-equivalents.txt \
238            psf/unifont-apl.txt \
239            512 \
240            $(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf
241         gzip -f -9 $(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf
242
243 #
244 # Print coverage of scripts in Basic Multilingual Plane in .txt file.
245 #
246 # Note: can't use this older version unless unassigned.hex is merged
247 # with the rest of the built unifont-$(VERSION).hex final file.
248 #
249 # coverage: $(COMPILED_DIR)/unifont-$(VERSION).hex $(BINDIR)/unicoverage
250 #       $(BINDIR)/unicoverage < $(COMPILED_DIR)/unifont-$(VERSION).hex \
251 #                   > $(COMPILED_DIR)/coverage.txt
252 #
253 # Use this version because "unassigned.hex" isn't part of the final
254 # .hex font by default now:
255 #
256 coverage:
257         sort $(HEXDIR)/*.hex | \
258                 $(BINDIR)/unicoverage > $(COMPILED_DIR)/coverage.txt
259
260 #
261 # Print HTML page coverage in Basic Multilingual Plane in .txt file.
262 #
263 pagecount: $(COMPILED_DIR)/unifont-$(VERSION).hex $(BINDIR)/unipagecount
264         $(BINDIR)/unipagecount -l < $(COMPILED_DIR)/unifont-$(VERSION).hex \
265                         > $(COMPILED_DIR)/pagecount.html
266
267 #
268 # Create the .png (Portable Network Graphics) versions of the glyphs.
269 #
270 png: hex $(BINDIR)/unihex2png
271         if [ ! -d $(PNGDIR) ] ; then \
272            mkdir -p $(PNGDIR) ; \
273         fi
274         if [ ! -d $(PNGDIR)/plane00 ] ; then \
275            mkdir -p $(PNGDIR)/plane00 ; \
276         fi
277         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
278            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
279               $(BINDIR)/unihex2png -p 00$$i$$j \
280                  -i $(COMPILED_DIR)/unifont_sample-$(VERSION).hex \
281                  -o $(PNGDIR)/plane00/uni00$$i$$j.png ; \
282            done ; \
283         done
284         if [ ! -d $(PNGDIR)/plane01 ] ; then \
285            mkdir -p $(PNGDIR)/plane01 ; \
286         fi
287         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
288            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
289               $(BINDIR)/unihex2png -p 01$$i$$j \
290                  -i $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
291                  -o $(PNGDIR)/plane01/uni01$$i$$j.png ; \
292            done ; \
293         done
294         if [ ! -d $(PNGDIR)/plane0E ] ; then \
295            mkdir -p $(PNGDIR)/plane0E ; \
296         fi
297         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
298            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
299               $(BINDIR)/unihex2png -p 0E$$i$$j \
300                  -i $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
301                  -o $(PNGDIR)/plane0E/uni0E$$i$$j.png ; \
302            done ; \
303         done
304         if [ ! -d $(PNGDIR)/csur ] ; then \
305            mkdir -p $(PNGDIR)/csur ; \
306         fi
307         for i in E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA DB EB EC ED EE EF \
308                  F0 F1 F2 F3 F4 F5 F6 F7 F8 ; do \
309               $(BINDIR)/unihex2png -p 00$$i \
310                  -i $(COMPILED_DIR)/unifont_csur_sample-$(VERSION).hex \
311                  -o $(PNGDIR)/csur/uni00$$i.png ; \
312            done ; \
313         done
314         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
315            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
316               $(BINDIR)/unihex2png -p 0F$$i$$j \
317                  -i $(COMPILED_DIR)/unifont_csur_sample-$(VERSION).hex \
318                  -o $(PNGDIR)/csur/uni0F$$i$$j.png ; \
319            done ; \
320         done
321         echo "Done creating $(PNGDIR)"
322
323 #
324 # Build one bitmap of the entire Unifont as a 4096 x 16 grid.
325 # Use all the .hex files in $(HEXDIR) so we add the contents of
326 # omit.hex (FFFE & FFFF).  Those two glyphs aren't included in the
327 # unifont_sample font because they cause problems with MS Windows,
328 # but we can put them in the picture.
329 #
330 bigpic: $(COMPILED_DIR)/unifont_sample-$(VERSION).hex
331         sort -u $(HEXDIR)/*.hex | \
332            $(BINDIR)/unifontpic -d120 > $(COMPILED_DIR)/unifont-$(VERSION).bmp
333
334 #
335 # Note that $(TTFSRC) must exist, because it contains some source files
336 # Perform a "make && make clean" because ALL of the files would consume
337 # over 200 Megabytes if left around.  The .sfd file is about 100 Megabytes,
338 # and it is created from merging "[0-F].sfd", which take up another 100 MB.
339 #
340
341 ttf:
342         # First, copy the ordinary version, to make a TrueType font.
343         install -p \
344                 $(COMPILED_DIR)/unifont-$(VERSION).hex \
345                 $(TTFSRC)/unifont.hex
346         install -p \
347                 $(HEXDIR)/bmp-combining.txt \
348                 $(TTFSRC)/combining.txt
349         cd $(TTFSRC) ; \
350            $(MAKE) FONTFILE="unifont" COMBINING="combining" \
351                 FONTNAME="Unifont" PSNAME="Unifont"
352         mv $(TTFSRC)/unifont.sfd $(COMPILED_DIR)/unifont-$(VERSION).sfd 
353         mv $(TTFSRC)/unifont.ttf \
354                 $(COMPILED_DIR)/unifont-$(VERSION).ttf 
355         # Second, copy unifont_sample.bdf, to make an SBIT font.
356         install -p \
357                 $(COMPILED_DIR)/unifont_sample-$(VERSION).bdf \
358                 $(TTFSRC)/unifont_sample.bdf
359         cd $(TTFSRC) ; \
360            $(MAKE) sbit FONTFILE="unifont_sample" COMBINING="" \
361                 FONTNAME="Unifont Sample" PSNAME="UnifontSample"
362         mv $(TTFSRC)/unifont_sample.ttf \
363                 $(COMPILED_DIR)/unifont_sample-$(VERSION).ttf 
364
365 #
366 # Now build the ConScript Unicode Registry PUA font.
367 #
368 csurttf:
369         install -p \
370                 $(COMPILED_DIR)/unifont_csur-$(VERSION).hex \
371                 $(TTFSRC)/unifont_csur.hex
372         sort -u plane00csur/csur-combining.txt $(HEXDIR)/bmp-combining.txt \
373                 > $(TTFSRC)/combining_csur.txt
374         cd $(TTFSRC) ; \
375            $(MAKE) outline FONTFILE="unifont_csur" COMBINING="combining_csur" \
376                 FONTNAME="Unifont CSUR" PSNAME="UnifontCSUR"
377         mv $(TTFSRC)/unifont_csur.sfd \
378                 $(COMPILED_DIR)/unifont_csur-$(VERSION).sfd 
379         mv $(TTFSRC)/unifont_csur.ttf \
380                 $(COMPILED_DIR)/unifont_csur-$(VERSION).ttf 
381         gzip -f -9 $(COMPILED_DIR)/unifont_csur-$(VERSION).sfd 
382
383 #
384 # Now build the ConScript Unicode Registry PUA font.
385 #
386 upperttf:
387         # First, copy the ordinary version, to make a TrueType font.
388         install -p \
389                 $(COMPILED_DIR)/unifont_upper-$(VERSION).hex \
390                 $(TTFSRC)/unifont_upper.hex
391         sort -u $(UPPER_COMBINING) > $(TTFSRC)/combining_upper.txt
392         cd $(TTFSRC) ; \
393            $(MAKE) outline FONTFILE="unifont_upper" COMBINING="combining_upper" \
394                 FONTNAME="Unifont Upper" PSNAME="UnifontUpper"
395         mv $(TTFSRC)/unifont_upper.sfd \
396                 $(COMPILED_DIR)/unifont_upper-$(VERSION).sfd 
397         mv $(TTFSRC)/unifont_upper.ttf \
398                 $(COMPILED_DIR)/unifont_upper-$(VERSION).ttf 
399         gzip -f -9 $(COMPILED_DIR)/unifont_upper-$(VERSION).sfd 
400         # Second, copy unifont_upper_sample.bdf, to make an SBIT font.
401         install -p \
402                 $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf \
403                 $(TTFSRC)/unifont_upper_sample.bdf
404         cd $(TTFSRC) ; \
405            $(MAKE) sbit FONTFILE="unifont_upper_sample" COMBINING="" \
406                 FONTNAME="Unifont Upper Sample" PSNAME="UnifontUpperSample"
407         mv $(TTFSRC)/unifont_upper_sample.ttf \
408                 $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).ttf 
409
410
411
412 #
413 # ConScript Unicode Registry PUA font beyond Plane 0.
414 #
415 uppercsurttf:
416         install -p \
417                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex \
418                 $(TTFSRC)/unifont_upper_csur.hex
419         sort -u plane0[1-F]/*combining*.txt plane0[1-F]csur/*combining*.txt \
420                 > $(TTFSRC)/combining_upper_csur.txt
421         cd $(TTFSRC) ; \
422            $(MAKE) outline FONTFILE="unifont_upper_csur" COMBINING="combining_upper_csur" \
423                 FONTNAME="Unifont Upper CSUR" PSNAME="UnifontUpperCSUR"
424         mv $(TTFSRC)/unifont_upper_csur.sfd \
425                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).sfd 
426         mv $(TTFSRC)/unifont_upper_csur.ttf \
427                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf 
428         gzip -f -9 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).sfd 
429
430 #
431 #
432 # Copy the newly created files from $(COMPILED_DIR) to the precompiled/
433 # directory.  This has to be called manually, because the precompiled/
434 # directory usually remains untouched.
435 #
436 precompiled: all
437         \rm -rf precompiled
438         install -m0755 -d precompiled
439         install -m0644 -p $(COMPILED_DIR)/unifont-$(VERSION).hex \
440                           $(COMPILED_DIR)/unifont-$(VERSION).bdf.gz \
441                           $(COMPILED_DIR)/unifont-$(VERSION).pcf.gz \
442                           $(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf.gz \
443                           $(COMPILED_DIR)/unifont-$(VERSION).ttf \
444                           $(COMPILED_DIR)/unifont_csur-$(VERSION).pcf.gz \
445                           $(COMPILED_DIR)/unifont_csur-$(VERSION).ttf \
446                           $(COMPILED_DIR)/unifont_sample-$(VERSION).hex \
447                           $(COMPILED_DIR)/unifont_sample-$(VERSION).bdf.gz \
448                           $(COMPILED_DIR)/unifont_sample-$(VERSION).pcf.gz \
449                           $(COMPILED_DIR)/unifont_sample-$(VERSION).ttf \
450                           $(COMPILED_DIR)/coverage.txt \
451                           $(COMPILED_DIR)/unifont-$(VERSION).bmp \
452                           $(COMPILED_DIR)/unifont_upper-$(VERSION).hex \
453                           $(COMPILED_DIR)/unifont_upper-$(VERSION).bdf.gz \
454                           $(COMPILED_DIR)/unifont_upper-$(VERSION).pcf.gz \
455                           $(COMPILED_DIR)/unifont_upper-$(VERSION).ttf \
456                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
457                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf.gz \
458                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).pcf.gz \
459                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).ttf \
460                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex \
461                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf.gz \
462                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).pcf.gz \
463                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf \
464            precompiled
465
466 #
467 # This is set up for Debian.  Solaris places fonts in
468 # "/usr/share/fonts/TrueType".  Other unices use other directories.
469 # The original font format was BDF, but Debian doesn't use that and
470 # xfs should only need TrueType, so the BDF font isn't installed.
471 #
472 # The TrueType font is about 16 Megabytes.  To avoid duplication,
473 # the fonts are installed as symbolic links back to the original package.
474 # Alternatively, the fonts can be copied to the destination directory
475 # with "install -m0644" or moved there (but "mv" is a destructive
476 # one-time operation).
477 #
478 # After installing the new fonts, register them with X Window System using:
479 #
480 #      xset fp rehash
481 #
482 install:
483         if [ x$(CURDIR) = x ] ; \
484         then \
485            echo "Fatal Error: CURDIR not defined -- define in Makefile." ; \
486            exit 1 ; \
487         fi
488         $(INSTALL) -m0755 -d $(CONSOLEDEST)
489         $(INSTALL) -m0755 -d $(PCFDEST)
490         $(INSTALL) -m0755 -d $(TTFDEST)
491         if [ ! -d $(COMPILED_DIR) ] ; then \
492            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/Unifont-APL8x16-$(VERSION).psf.gz $(CONSOLEDEST)/Unifont-APL8x16.psf.gz ; \
493            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont-$(VERSION).pcf.gz $(PCFDEST)/unifont.pcf.gz ; \
494            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_sample-$(VERSION).pcf.gz $(PCFDEST)/unifont_sample.pcf.gz ; \
495            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_csur-$(VERSION).pcf.gz     $(PCFDEST)/unifont_csur.pcf.gz ; \
496            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont-$(VERSION).ttf             $(TTFDEST)/unifont.ttf ; \
497            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_sample-$(VERSION).ttf      $(TTFDEST)/unifont_sample.ttf ; \
498            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_csur-$(VERSION).ttf        $(TTFDEST)/unifont_csur.ttf ; \
499            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_upper-$(VERSION).ttf       $(TTFDEST)/unifont_upper.ttf ; \
500            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_upper_csur-$(VERSION).ttf  $(TTFDEST)/unifont_upper_csur.ttf ; \
501         else \
502            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf.gz $(CONSOLEDEST)/Unifont-APL8x16.psf.gz ; \
503            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont-$(VERSION).pcf.gz $(PCFDEST)/unifont.pcf.gz ; \
504            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_sample-$(VERSION).pcf.gz    $(PCFDEST)/unifont_sample.pcf.gz ; \
505            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_csur-$(VERSION).pcf.gz      $(PCFDEST)/unifont_csur.pcf.gz ; \
506            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont-$(VERSION).ttf              $(TTFDEST)/unifont.ttf ; \
507            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_sample-$(VERSION).ttf       $(TTFDEST)/unifont_sample.ttf ; \
508            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_csur-$(VERSION).ttf         $(TTFDEST)/unifont_csur.ttf ; \
509            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_upper-$(VERSION).ttf        $(TTFDEST)/unifont_upper.ttf ; \
510            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf   $(TTFDEST)/unifont_upper_csur.ttf ; \
511         fi
512
513 clean:
514         \rm -rf $(COMPILED_DIR)/png
515         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).hex
516         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).bdf
517         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).bdf.gz
518         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).sfd.gz
519         \rm -f *~
520
521 #
522 # Note that distclean leaves precompiled/ alone.  This is intentional.
523 # The .DS files are created under Mac OS X.
524 #
525 distclean:
526         \rm -rf $(COMPILED_DIR)
527         $(MAKE) -C ttfsrc distclean
528         \rm -f *~
529         \rm -rf .DS* ._.DS*
530
531 .PHONY: all hex bdf pcf coverage pagecount png bigpic csurttf upper ttf \
532         precompiled install clean distclean