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