font: lower and larger degree sign
[unifont.git] / Makefile
1 #
2 # unifoundry.com utilities for the GNU Unifont
3 #
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
7 # "cd font ; make"
8 #
9 SHELL = /bin/sh
10 INSTALL = install
11 GZFLAGS = -f -9 -n
12
13 PACKAGE = "unifont"
14 UNICODE_VERSION = 8.0
15 PKG_REV = 01
16 VERSION = $(UNICODE_VERSION).$(PKG_REV)
17
18 #
19 # The settings below will install software, man pages, and documentation
20 # in /usr/local.  To install in a different location, modify USRDIR to
21 # your liking.
22 #
23 USRDIR = usr
24 # USRDIR = usr/local
25 PREFIX = $(DESTDIR)/$(USRDIR)
26 PKGDEST = $(PREFIX)/share/unifont
27
28 VPATH = lib font/plane00 font/ttfsrc
29
30 HEXFILES = hangul-syllables.hex nonprinting.hex pua.hex spaces.hex \
31            unassigned.hex unifont-base.hex wqy.hex
32
33 COMBINING = font/plane00/bmp-combining.txt
34
35 TEXTFILES = ChangeLog INSTALL NEWS README
36
37 #
38 # Whether to build the font or not (default is not).
39 # Set to non-null value to build font.
40 #
41 BUILDFONT=
42
43 #
44 # Whether to install man pages uncompressed (COMPRESS = 0) or
45 # compressed (COMPRESS != 0).
46 #
47 COMPRESS = 1
48
49 all: bindir libdir docdir buildfont
50         echo "Make is done."
51
52 #
53 # Build a distribution tarball.
54 #
55 dist: distclean
56         (cd .. && tar cf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION) && \
57                 gzip $(GZFLAGS) $(PACKAGE)-$(VERSION).tar)
58
59 bindir:
60         set -e && $(MAKE) -C src
61
62 #
63 # Conditionally build the font, depending on the value of BUILDFONT.
64 # To build the font unconditionally, use the "fontdir" target below.
65 #
66 buildfont:
67         if [ x$(BUILDFONT) != x ] ; \
68         then \
69            set -e && $(MAKE) -C font ; \
70         fi
71
72 #
73 # Not invoked automatically; the font files are taken from
74 # font/precompiled by default.
75 #
76 fontdir:
77         set -e && $(MAKE) -C font
78
79 libdir: lib/wchardata.c
80
81 docdir:
82         set -e && $(MAKE) -C doc
83
84 mandir:
85         set -e && $(MAKE) -C man
86
87 precompiled:
88         set -e && $(MAKE) precompiled -C font
89
90 #
91 # Create lib/wchardata.c.  If you want to also build the object file
92 # wchardata.o, uncomment the last line
93 #
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 )
100
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 ; \
109         done
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 ; \
116         else \
117            $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).hex   $(PKGDEST)/unifont.hex && \
118            $(INSTALL) -m0644 -p font/compiled/unifont-$(VERSION).bmp $(PKGDEST)/unifont.bmp ; \
119         fi
120
121 clean:
122         $(MAKE) -C src  clean
123         $(MAKE) -C doc  clean
124         $(MAKE) -C man  clean
125         $(MAKE) -C font clean
126         \rm -rf *~
127
128 #
129 # The .DS files are created under Mac OS X
130 #
131 distclean:
132         $(MAKE) -C src  distclean
133         $(MAKE) -C doc  distclean
134         $(MAKE) -C man  distclean
135         $(MAKE) -C font distclean
136         \rm -rf bin lib
137         \rm -f unifonttemp.hex
138         \rm -rf *~
139         \rm -rf .DS* ._.DS*
140
141 .PHONY: all dist bindir buildfont fontdir libdir docdir mandir precompiled install clean distclean