2 # unifoundry.com utilities for the GNU Unifont
4 # Typing "make && make install" will make and
5 # install the binary programs and man pages.
6 # To build only the font from scratch, use
14 VERSION = $(MAJORVERSION).$(DATE)
17 # The settings below will install software, man pages, and documentation
18 # in /usr/local. To install in a different location, modify USRDIR to
23 PREFIX = $(DESTDIR)/$(USRDIR)
24 PKGDEST = $(PREFIX)/share/unifont
26 VPATH = lib font/hexsrc font/ttfsrc
28 HEXFILES = hangul-syllables.hex nonprinting.hex pua.hex spaces.hex \
29 unassigned.hex unifont-base.hex wqy.hex
31 COMBINING = font/ttfsrc/combining.txt
33 TEXTFILES = ChangeLog INSTALL NEWS README
36 # Whether to build the font or not (default is not).
37 # Set to non-null value to build font.
42 # Whether to install man pages uncompressed (COMPRESS = 0) or
43 # compressed (COMPRESS != 0).
47 all: bindir libdir docdir buildfont
51 set -e ; $(MAKE) -C src
54 # Conditionally build the font, depending on the value of BUILDFONT.
55 # To build the font unconditionally, use the "fontdir" target below.
58 if [ x$(BUILDFONT) != x ] ; \
60 set -e ; make -C font ; \
64 # Not invoked automatically; the font files are taken from
65 # font/precompiled by default.
68 set -e ; $(MAKE) -C font
70 libdir: lib/wchardata.c
73 set -e ; $(MAKE) -C doc
76 set -e ; $(MAKE) -C man
79 set -e ; $(MAKE) precompiled -C font
82 # Create lib/wchardata.c. If you want to also build the object file
83 # wchardata.o, uncomment the last line
85 lib/wchardata.c: $(HEXFILES) combining.txt
86 $(INSTALL) -m0755 -d lib
87 (cd font/hexsrc && sort $(HEXFILES) > ../../unifonttemp.hex)
88 bin/unigenwidth unifonttemp.hex $(COMBINING) > lib/wchardata.c
89 \rm -f unifonttemp.hex
90 # (cd lib && $(CC) $(CFLAGS) -c wchardata.c && chmod 644 wchardata.o )
92 install: bindir libdir docdir
93 $(MAKE) -C src install PREFIX=$(PREFIX)
94 $(MAKE) -C man install PREFIX=$(PREFIX) COMPRESS=$(COMPRESS)
95 $(MAKE) -C font install PREFIX=$(PREFIX) DESTDIR=$(DESTDIR)
96 $(INSTALL) -m0755 -d $(PKGDEST)
97 $(INSTALL) -m0644 -p $(TEXTFILES) doc/unifont.txt doc/unifont.info $(PKGDEST)
98 for i in $(TEXTFILES) unifont.txt unifont.info ; do \
99 gzip -f -9 $(PKGDEST)/$$i ; \
101 $(INSTALL) -m0644 -p lib/wchardata.c $(PKGDEST)
102 $(INSTALL) -m0644 -p font/ttfsrc/combining.txt $(PKGDEST)
103 # If "make" wasn't run before, font/compiled won't exist.
104 if [ ! -d font/compiled ] ; then \
105 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex ; \
106 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
108 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex ; \
109 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
116 $(MAKE) -C font clean
120 # The .DS files are created under Mac OS X
123 $(MAKE) -C src distclean
124 $(MAKE) -C doc distclean
125 $(MAKE) -C man distclean
126 $(MAKE) -C font distclean
128 \rm -f unifonttemp.hex
132 .PHONY: all bindir docdir mandir fontdir precompiled install clean distclean