unifont-6.3.20131020.tar.gz
[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
11 DATE = 20131020
12 MAJORVERSION = 6.3
13 VERSION = $(MAJORVERSION).$(DATE)
14 #
15 # The settings below will install software, man pages, and documentation
16 # in /usr/local.  To install in a different location, modify USRDIR to
17 # your liking.
18 #
19 # USRDIR = usr
20 USRDIR = usr/local
21 PREFIX = $(DESTDIR)/$(USRDIR)
22 PKGDEST = $(PREFIX)/share/unifont
23
24 #
25 # Whether to install man pages uncompressed (COMPRESS = 0) or
26 # compressed (COMPRESS != 0).
27 #
28 COMPRESS = 1
29
30 DIRS = bin man font
31
32 all: bindir fontdir libdir
33         echo "Make is done."
34
35 bindir:
36         set -e ; $(MAKE) -C src
37
38 mandir:
39         set -e ; $(MAKE) -C man
40
41 fontdir:
42         set -e ; $(MAKE) -C font
43
44 precompiled:
45         set -e ; $(MAKE) precompiled -C font
46
47 #
48 # Create lib/wchardata.c.  If you want to also build the object file
49 # wchardata.o, uncomment the last line
50 libdir:
51         install -m0755 -d lib
52         (cd font/hexsrc ; \
53                 sort hangul-syllables.hex pua.hex spaces.hex \
54                         unassigned.hex unifont-base.hex wqy.hex \
55                         > ../../unifonttemp.hex)
56         bin/unigenwidth unifonttemp.hex font/ttfsrc/combining.txt \
57                 > lib/wchardata.c
58         \rm -f unifonttemp.hex
59 #       (cd lib ; $(CC) -c wchardata.c ; chmod 644 wchardata.o )
60
61 install: bindir libdir
62         $(MAKE) -C src install PREFIX=$(PREFIX)
63         $(MAKE) -C man install PREFIX=$(PREFIX) COMPRESS=$(COMPRESS)
64         $(MAKE) -C font install PREFIX=$(PREFIX) DESTDIR=$(DESTDIR)
65         install -m0755 -d $(PKGDEST)
66         install -m0644 -p README TUTORIAL LICENSE $(PKGDEST)
67         gzip -f -9 $(PKGDEST)/README
68         gzip -f -9 $(PKGDEST)/TUTORIAL
69         gzip -f -9 $(PKGDEST)/LICENSE
70         install -m0644 -p lib/wchardata.c $(PKGDEST)
71         install -m0644 -p font/ttfsrc/combining.txt $(PKGDEST)
72         # If "make" wasn't run before, font/compiled won't exist.
73         if [ ! -d font/compiled ] ; then \
74            install -m0644 -p font/precompiled/unifont-$(VERSION).hex   $(PKGDEST)/unifont.hex ; \
75            install -m0644 -p font/precompiled/unifont-$(VERSION).bmp $(PKGDEST) ; \
76         else \
77            install -m0644 -p font/compiled/unifont-$(VERSION).hex   $(PKGDEST)/unifont.hex ; \
78            install -m0644 -p font/compiled/unifont-$(VERSION).bmp $(PKGDEST) ; \
79         fi
80
81 clean:
82         $(MAKE) -C src clean
83         $(MAKE) -C man clean
84         $(MAKE) -C font clean
85
86 #
87 # The .DS files are created under Mac OS X
88 # The build-stamp file is created under Debian
89 #
90 distclean:
91         $(MAKE) -C src distclean
92         $(MAKE) -C man distclean
93         $(MAKE) -C font distclean
94         \rm -rf bin lib
95         \rm -f unifonttemp.hex
96         \rm -rf .DS* ._.DS*
97         \rm -f build-stamp
98
99 .PHONY: all bindir mandir fontdir precompiled install clean distclean