5bb7c48f262361a51b2c6da17a93c0c98248cf4d
[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 = 05
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         # Generate files in plane01/all directory to create PNG files.
288         (cd plane01 ; make)
289         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
290            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
291               $(BINDIR)/unihex2png -p 01$$i$$j \
292                  -i plane01/all/plane01-all.hex \
293                  -o $(PNGDIR)/plane01/uni01$$i$$j.png ; \
294            done ; \
295         done
296         if [ ! -d $(PNGDIR)/plane0E ] ; then \
297            mkdir -p $(PNGDIR)/plane0E ; \
298         fi
299         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
300            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
301               $(BINDIR)/unihex2png -p 0E$$i$$j \
302                  -i $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
303                  -o $(PNGDIR)/plane0E/uni0E$$i$$j.png ; \
304            done ; \
305         done
306         if [ ! -d $(PNGDIR)/csur ] ; then \
307            mkdir -p $(PNGDIR)/csur ; \
308         fi
309         for i in E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF \
310                  F0 F1 F2 F3 F4 F5 F6 F7 F8 ; do \
311               $(BINDIR)/unihex2png -p 00$$i \
312                  -i $(COMPILED_DIR)/unifont_csur_sample-$(VERSION).hex \
313                  -o $(PNGDIR)/csur/uni00$$i.png ; \
314         done
315         for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
316            for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do \
317               $(BINDIR)/unihex2png -p 0F$$i$$j \
318                  -i $(COMPILED_DIR)/unifont_csur_sample-$(VERSION).hex \
319                  -o $(PNGDIR)/csur/uni0F$$i$$j.png ; \
320            done ; \
321         done
322         # Create HTML table showing color-coded percent coverage in Plane 01.
323         ../bin/unipagecount -P1 -h < plane01/all/plane01-all.hex \
324            > compiled/plane01.html
325         echo "Done creating $(PNGDIR)"
326
327 #
328 # Build one bitmap of the entire Unifont as a 4096 x 16 grid.
329 # Use all the .hex files in $(HEXDIR) so we add the contents of
330 # omit.hex (FFFE & FFFF).  Those two glyphs aren't included in the
331 # unifont_sample font because they cause problems with MS Windows,
332 # but we can put them in the picture.
333 #
334 bigpic: $(COMPILED_DIR)/unifont_sample-$(VERSION).hex
335         sort -u $(HEXDIR)/*.hex | \
336            $(BINDIR)/unifontpic -d120 > $(COMPILED_DIR)/unifont-$(VERSION).bmp
337
338 #
339 # Note that $(TTFSRC) must exist, because it contains some source files
340 # Perform a "make && make clean" because ALL of the files would consume
341 # over 200 Megabytes if left around.  The .sfd file is about 100 Megabytes,
342 # and it is created from merging "[0-F].sfd", which take up another 100 MB.
343 #
344
345 ttf:
346         # First, copy the ordinary version, to make a TrueType font.
347         install -p \
348                 $(COMPILED_DIR)/unifont-$(VERSION).hex \
349                 $(TTFSRC)/unifont.hex
350         install -p \
351                 $(HEXDIR)/bmp-combining.txt \
352                 $(TTFSRC)/combining.txt
353         cd $(TTFSRC) ; \
354            $(MAKE) FONTFILE="unifont" COMBINING="combining" \
355                 FONTNAME="Unifont" PSNAME="Unifont"
356         mv $(TTFSRC)/unifont.sfd $(COMPILED_DIR)/unifont-$(VERSION).sfd 
357         mv $(TTFSRC)/unifont.ttf \
358                 $(COMPILED_DIR)/unifont-$(VERSION).ttf 
359         # Second, copy unifont_sample.bdf, to make an SBIT font.
360         install -p \
361                 $(COMPILED_DIR)/unifont_sample-$(VERSION).bdf \
362                 $(TTFSRC)/unifont_sample.bdf
363         cd $(TTFSRC) ; \
364            $(MAKE) sbit FONTFILE="unifont_sample" COMBINING="" \
365                 FONTNAME="Unifont Sample" PSNAME="UnifontSample"
366         mv $(TTFSRC)/unifont_sample.ttf \
367                 $(COMPILED_DIR)/unifont_sample-$(VERSION).ttf 
368
369 #
370 # Now build the ConScript Unicode Registry PUA font.
371 #
372 csurttf:
373         install -p \
374                 $(COMPILED_DIR)/unifont_csur-$(VERSION).hex \
375                 $(TTFSRC)/unifont_csur.hex
376         sort -u plane00csur/csur-combining.txt $(HEXDIR)/bmp-combining.txt \
377                 > $(TTFSRC)/combining_csur.txt
378         cd $(TTFSRC) ; \
379            $(MAKE) outline FONTFILE="unifont_csur" COMBINING="combining_csur" \
380                 FONTNAME="Unifont CSUR" PSNAME="UnifontCSUR"
381         mv $(TTFSRC)/unifont_csur.sfd \
382                 $(COMPILED_DIR)/unifont_csur-$(VERSION).sfd 
383         mv $(TTFSRC)/unifont_csur.ttf \
384                 $(COMPILED_DIR)/unifont_csur-$(VERSION).ttf 
385         gzip -f -9 $(COMPILED_DIR)/unifont_csur-$(VERSION).sfd 
386
387 #
388 # Now build the ConScript Unicode Registry PUA font.
389 #
390 upperttf:
391         # First, copy the ordinary version, to make a TrueType font.
392         install -p \
393                 $(COMPILED_DIR)/unifont_upper-$(VERSION).hex \
394                 $(TTFSRC)/unifont_upper.hex
395         sort -u $(UPPER_COMBINING) > $(TTFSRC)/combining_upper.txt
396         cd $(TTFSRC) ; \
397            $(MAKE) outline FONTFILE="unifont_upper" COMBINING="combining_upper" \
398                 FONTNAME="Unifont Upper" PSNAME="UnifontUpper"
399         mv $(TTFSRC)/unifont_upper.sfd \
400                 $(COMPILED_DIR)/unifont_upper-$(VERSION).sfd 
401         mv $(TTFSRC)/unifont_upper.ttf \
402                 $(COMPILED_DIR)/unifont_upper-$(VERSION).ttf 
403         gzip -f -9 $(COMPILED_DIR)/unifont_upper-$(VERSION).sfd 
404         # Second, copy unifont_upper_sample.bdf, to make an SBIT font.
405         install -p \
406                 $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf \
407                 $(TTFSRC)/unifont_upper_sample.bdf
408         cd $(TTFSRC) ; \
409            $(MAKE) sbit FONTFILE="unifont_upper_sample" COMBINING="" \
410                 FONTNAME="Unifont Upper Sample" PSNAME="UnifontUpperSample"
411         mv $(TTFSRC)/unifont_upper_sample.ttf \
412                 $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).ttf 
413
414
415
416 #
417 # ConScript Unicode Registry PUA font beyond Plane 0.
418 #
419 uppercsurttf:
420         install -p \
421                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex \
422                 $(TTFSRC)/unifont_upper_csur.hex
423         sort -u plane0[1-F]/*combining*.txt plane0[1-F]csur/*combining*.txt \
424                 > $(TTFSRC)/combining_upper_csur.txt
425         cd $(TTFSRC) ; \
426            $(MAKE) outline FONTFILE="unifont_upper_csur" COMBINING="combining_upper_csur" \
427                 FONTNAME="Unifont Upper CSUR" PSNAME="UnifontUpperCSUR"
428         mv $(TTFSRC)/unifont_upper_csur.sfd \
429                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).sfd 
430         mv $(TTFSRC)/unifont_upper_csur.ttf \
431                 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf 
432         gzip -f -9 $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).sfd 
433
434 #
435 #
436 # Copy the newly created files from $(COMPILED_DIR) to the precompiled/
437 # directory.  This has to be called manually, because the precompiled/
438 # directory usually remains untouched.
439 #
440 precompiled: all
441         \rm -rf precompiled
442         install -m0755 -d precompiled
443         install -m0644 -p $(COMPILED_DIR)/unifont-$(VERSION).hex \
444                           $(COMPILED_DIR)/unifont-$(VERSION).bdf.gz \
445                           $(COMPILED_DIR)/unifont-$(VERSION).pcf.gz \
446                           $(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf.gz \
447                           $(COMPILED_DIR)/unifont-$(VERSION).ttf \
448                           $(COMPILED_DIR)/unifont_csur-$(VERSION).pcf.gz \
449                           $(COMPILED_DIR)/unifont_csur-$(VERSION).ttf \
450                           $(COMPILED_DIR)/unifont_sample-$(VERSION).hex \
451                           $(COMPILED_DIR)/unifont_sample-$(VERSION).bdf.gz \
452                           $(COMPILED_DIR)/unifont_sample-$(VERSION).pcf.gz \
453                           $(COMPILED_DIR)/unifont_sample-$(VERSION).ttf \
454                           $(COMPILED_DIR)/coverage.txt \
455                           $(COMPILED_DIR)/unifont-$(VERSION).bmp \
456                           $(COMPILED_DIR)/unifont_upper-$(VERSION).hex \
457                           $(COMPILED_DIR)/unifont_upper-$(VERSION).bdf.gz \
458                           $(COMPILED_DIR)/unifont_upper-$(VERSION).pcf.gz \
459                           $(COMPILED_DIR)/unifont_upper-$(VERSION).ttf \
460                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).hex \
461                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).bdf.gz \
462                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).pcf.gz \
463                           $(COMPILED_DIR)/unifont_upper_sample-$(VERSION).ttf \
464                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).hex \
465                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).bdf.gz \
466                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).pcf.gz \
467                           $(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf \
468            precompiled
469
470 #
471 # This is set up for Debian.  Solaris places fonts in
472 # "/usr/share/fonts/TrueType".  Other unices use other directories.
473 # The original font format was BDF, but Debian doesn't use that and
474 # xfs should only need TrueType, so the BDF font isn't installed.
475 #
476 # The TrueType font is about 16 Megabytes.  To avoid duplication,
477 # the fonts are installed as symbolic links back to the original package.
478 # Alternatively, the fonts can be copied to the destination directory
479 # with "install -m0644" or moved there (but "mv" is a destructive
480 # one-time operation).
481 #
482 # After installing the new fonts, register them with X Window System using:
483 #
484 #      xset fp rehash
485 #
486 install:
487         if [ x$(CURDIR) = x ] ; \
488         then \
489            echo "Fatal Error: CURDIR not defined -- define in Makefile." ; \
490            exit 1 ; \
491         fi
492         $(INSTALL) -m0755 -d $(CONSOLEDEST)
493         $(INSTALL) -m0755 -d $(PCFDEST)
494         $(INSTALL) -m0755 -d $(TTFDEST)
495         if [ ! -d $(COMPILED_DIR) ] ; then \
496            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/Unifont-APL8x16-$(VERSION).psf.gz $(CONSOLEDEST)/Unifont-APL8x16.psf.gz ; \
497            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont-$(VERSION).pcf.gz $(PCFDEST)/unifont.pcf.gz ; \
498            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_sample-$(VERSION).pcf.gz $(PCFDEST)/unifont_sample.pcf.gz ; \
499            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_csur-$(VERSION).pcf.gz     $(PCFDEST)/unifont_csur.pcf.gz ; \
500            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont-$(VERSION).ttf             $(TTFDEST)/unifont.ttf ; \
501            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_sample-$(VERSION).ttf      $(TTFDEST)/unifont_sample.ttf ; \
502            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_csur-$(VERSION).ttf        $(TTFDEST)/unifont_csur.ttf ; \
503            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_upper-$(VERSION).ttf       $(TTFDEST)/unifont_upper.ttf ; \
504            $(INSTALL) -m0644 -p $(CURDIR)/precompiled/unifont_upper_csur-$(VERSION).ttf  $(TTFDEST)/unifont_upper_csur.ttf ; \
505         else \
506            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/Unifont-APL8x16-$(VERSION).psf.gz $(CONSOLEDEST)/Unifont-APL8x16.psf.gz ; \
507            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont-$(VERSION).pcf.gz $(PCFDEST)/unifont.pcf.gz ; \
508            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_sample-$(VERSION).pcf.gz    $(PCFDEST)/unifont_sample.pcf.gz ; \
509            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_csur-$(VERSION).pcf.gz      $(PCFDEST)/unifont_csur.pcf.gz ; \
510            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont-$(VERSION).ttf              $(TTFDEST)/unifont.ttf ; \
511            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_sample-$(VERSION).ttf       $(TTFDEST)/unifont_sample.ttf ; \
512            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_csur-$(VERSION).ttf         $(TTFDEST)/unifont_csur.ttf ; \
513            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_upper-$(VERSION).ttf        $(TTFDEST)/unifont_upper.ttf ; \
514            $(INSTALL) -m0644 -p $(CURDIR)/$(COMPILED_DIR)/unifont_upper_csur-$(VERSION).ttf   $(TTFDEST)/unifont_upper_csur.ttf ; \
515         fi
516
517 clean:
518         \rm -rf $(COMPILED_DIR)/png
519         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).hex
520         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).bdf
521         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).bdf.gz
522         \rm -f $(COMPILED_DIR)/unifont-$(VERSION).sfd.gz
523         \rm -f *~
524
525 #
526 # Note that distclean leaves precompiled/ alone.  This is intentional.
527 # The .DS files are created under Mac OS X.
528 #
529 distclean:
530         \rm -rf $(COMPILED_DIR)
531         $(MAKE) -C plane01 distclean
532         $(MAKE) -C ttfsrc distclean
533         \rm -f *~
534         \rm -rf .DS* ._.DS*
535
536 .PHONY: all hex bdf pcf coverage pagecount png bigpic csurttf upper ttf \
537         precompiled install clean distclean