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
16 VERSION = $(UNICODE_VERSION).$(PKG_REV)
19 # The settings below will install software, man pages, and documentation
20 # in /usr/local. To install in a different location, modify USRDIR to
25 PREFIX = $(DESTDIR)/$(USRDIR)
26 PKGDEST = $(PREFIX)/share/unifont
28 VPATH = lib font/plane00 font/ttfsrc
30 HEXFILES = hangul-syllables.hex nonprinting.hex pua.hex spaces.hex \
31 unassigned.hex unifont-base.hex wqy.hex
33 COMBINING = font/plane00/bmp-combining.txt
35 TEXTFILES = ChangeLog INSTALL NEWS README
38 # Whether to build the font or not (default is not).
39 # Set to non-null value to build font.
44 # Whether to install man pages uncompressed (COMPRESS = 0) or
45 # compressed (COMPRESS != 0).
49 all: bindir libdir docdir buildfont
53 # Build a distribution tarball.
56 (cd .. && tar cf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) && \
57 gzip $(GZFLAGS) $(PACKAGE)-$(VERSION).tar)
60 set -e && $(MAKE) -C src
63 # Conditionally build the font, depending on the value of BUILDFONT.
64 # To build the font unconditionally, use the "fontdir" target below.
67 if [ x$(BUILDFONT) != x ] ; \
69 set -e && $(MAKE) -C font ; \
73 # Not invoked automatically; the font files are taken from
74 # font/precompiled by default.
77 set -e && $(MAKE) -C font
79 libdir: lib/wchardata.c
82 set -e && $(MAKE) -C doc
85 set -e && $(MAKE) -C man
88 set -e && $(MAKE) precompiled -C font
91 # Create lib/wchardata.c. If you want to also build the object file
92 # wchardata.o, uncomment the last line
94 lib/wchardata.c: $(HEXFILES) $(COMBINING)
95 $(INSTALL) -m0755 -d lib
96 (cd font/plane00 && sort $(HEXFILES) > ../../unifonttemp.hex)
97 bin/unigenwidth unifonttemp.hex $(COMBINING) > lib/wchardata.c
98 \rm -f unifonttemp.hex
99 # (cd lib && $(CC) $(CFLAGS) -c wchardata.c && chmod 644 wchardata.o )
101 install: bindir libdir docdir
102 $(MAKE) -C src install PREFIX=$(PREFIX)
103 $(MAKE) -C man install PREFIX=$(PREFIX) COMPRESS=$(COMPRESS)
104 $(MAKE) -C font install PREFIX=$(PREFIX) DESTDIR=$(DESTDIR)
105 $(INSTALL) -m0755 -d $(PKGDEST)
106 $(INSTALL) -m0644 -p $(TEXTFILES) doc/unifont.txt doc/unifont.info $(PKGDEST)
107 for i in $(TEXTFILES) unifont.txt unifont.info ; do \
108 gzip $(GZFLAGS) $(PKGDEST)/$$i ; \
110 $(INSTALL) -m0644 -p lib/wchardata.c $(PKGDEST)
111 $(INSTALL) -m0644 -p font/plane00/bmp-combining.txt $(PKGDEST)
112 # If "make" wasn't run before, font/compiled won't exist.
113 if [ ! -d font/compiled ] ; then \
114 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex && \
115 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
117 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex && \
118 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
125 $(MAKE) -C font clean
129 # The .DS files are created under Mac OS X
132 $(MAKE) -C src distclean
133 $(MAKE) -C doc distclean
134 $(MAKE) -C man distclean
135 $(MAKE) -C font distclean
137 \rm -f unifonttemp.hex
141 .PHONY: all dist bindir buildfont fontdir libdir docdir mandir precompiled install clean distclean