5ac22066efb03909e042496f1f55477a736bce8f
[unifont.git] / src / Makefile
1
2 CFLAGS = -g -O -Wall
3
4 INSTALLBINDIR = ../bin
5
6 #
7 # $(PREFIX) is defined in top-level directory, so don't do a
8 # 'make install' within this directory -- do it from above.
9 #
10 INSTALLDIR = $(PREFIX)/bin
11
12 #
13 # Programs written in C.
14 #
15 CPROGS = unibmp2hex unicoverage unidup unibdf2hex unifontpic \
16          unigencircles unigenwidth unihex2bmp unihexgen unipagecount
17
18 #
19 # Programs written in Perl.
20 #
21 # The programs johab2ucs2, unifontchojung, and unifontksx are
22 # only used for generation of Hangul syllables.
23 #
24 PPROGS = bdfimplode hex2bdf hex2sfd hexbraille hexdraw hexmerge \
25          johab2ucs2 unifontchojung unifontksx
26
27 PROGS = $(CPROGS) $(PPROGS)
28
29
30 all: $(CPROGS)
31         install    -m0755 -d $(INSTALLBINDIR)
32         install -s -m0755 $(CPROGS) $(INSTALLBINDIR)
33         install    -m0755 $(PPROGS) $(INSTALLBINDIR)
34         \rm -f $(CPROGS)
35
36 install:
37         if [ x$(PREFIX) = x ] ; \
38         then \
39            echo "Fatal error: PREFIX directory is not defined." ; \
40            echo "Run 'make install' from top-level directory" ; \
41            exit 1 ; \
42         fi
43         install -m0755 -d $(INSTALLDIR)
44         set -e ; \
45            cd $(INSTALLBINDIR) ; \
46            install -s -m0755 $(CPROGS) $(INSTALLDIR)
47         set -e ; \
48            cd ../bin ; \
49            install    -m0755 $(PPROGS) $(INSTALLDIR)
50
51 #
52 # The *.exe is for cygwin; it does nothing elsewhere.
53 # The *.dSYM is for Mac OS X.
54 #
55 clean:
56         \rm -f $(CPROGS)
57         \rm -f *.exe
58         \rm -rf *.dSYM
59
60 distclean: clean
61
62 .PHONY: all install clean distclean