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
15 VERSION = $(UNICODE_VERSION).$(PKG_REV)
18 # The settings below will install software, man pages, and documentation
19 # in /usr/local. To install in a different location, modify USRDIR to
24 PREFIX = $(DESTDIR)/$(USRDIR)
25 PKGDEST = $(PREFIX)/share/unifont
27 VPATH = lib font/plane00 font/ttfsrc
29 HEXFILES = hangul-syllables.hex nonprinting.hex pua.hex spaces.hex \
30 unassigned.hex unifont-base.hex wqy.hex
32 COMBINING = font/plane00/bmp-combining.txt
34 TEXTFILES = ChangeLog INSTALL NEWS README
37 # Whether to build the font or not (default is not).
38 # Set to non-null value to build font.
43 # Whether to install man pages uncompressed (COMPRESS = 0) or
44 # compressed (COMPRESS != 0).
48 all: bindir libdir docdir buildfont
52 # Build a distribution tarball.
55 (cd .. ; tar cf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) && \
56 gzip -f -9 $(PACKAGE)-$(VERSION).tar)
59 set -e ; $(MAKE) -C src
62 # Conditionally build the font, depending on the value of BUILDFONT.
63 # To build the font unconditionally, use the "fontdir" target below.
66 if [ x$(BUILDFONT) != x ] ; \
68 set -e ; $(MAKE) -C font ; \
72 # Not invoked automatically; the font files are taken from
73 # font/precompiled by default.
76 set -e ; $(MAKE) -C font
78 libdir: lib/wchardata.c
81 set -e ; $(MAKE) -C doc
84 set -e ; $(MAKE) -C man
87 set -e ; $(MAKE) precompiled -C font
90 # Create lib/wchardata.c. If you want to also build the object file
91 # wchardata.o, uncomment the last line
93 lib/wchardata.c: $(HEXFILES) $(COMBINING)
94 $(INSTALL) -m0755 -d lib
95 (cd font/plane00 && sort $(HEXFILES) > ../../unifonttemp.hex)
96 bin/unigenwidth unifonttemp.hex $(COMBINING) > lib/wchardata.c
97 \rm -f unifonttemp.hex
98 # (cd lib && $(CC) $(CFLAGS) -c wchardata.c && chmod 644 wchardata.o )
100 install: bindir libdir docdir
101 $(MAKE) -C src install PREFIX=$(PREFIX)
102 $(MAKE) -C man install PREFIX=$(PREFIX) COMPRESS=$(COMPRESS)
103 $(MAKE) -C font install PREFIX=$(PREFIX) DESTDIR=$(DESTDIR)
104 $(INSTALL) -m0755 -d $(PKGDEST)
105 $(INSTALL) -m0644 -p $(TEXTFILES) doc/unifont.txt doc/unifont.info $(PKGDEST)
106 for i in $(TEXTFILES) unifont.txt unifont.info ; do \
107 gzip -f -9 $(PKGDEST)/$$i ; \
109 $(INSTALL) -m0644 -p lib/wchardata.c $(PKGDEST)
110 $(INSTALL) -m0644 -p font/plane00/bmp-combining.txt $(PKGDEST)
111 # If "make" wasn't run before, font/compiled won't exist.
112 if [ ! -d font/compiled ] ; then \
113 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex ; \
114 $(INSTALL) -m0644 -p font/precompiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
116 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).hex $(PKGDEST)/unifont.hex ; \
117 $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
124 $(MAKE) -C font clean
128 # The .DS files are created under Mac OS X
131 $(MAKE) -C src distclean
132 $(MAKE) -C doc distclean
133 $(MAKE) -C man distclean
134 $(MAKE) -C font distclean
136 \rm -f unifonttemp.hex
140 .PHONY: all bindir docdir mandir fontdir precompiled install clean distclean