11b6634318376b8a59c16d1b3cfd2c7a7d3824a3
[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 unifontchojung unifontksx unihex2png unipng2hex
30
31 PROGS = $(CPROGS) $(PPROGS)
32
33
34 all: $(CPROGS) bin
35
36 .c:
37
38 bin: bin-stamp
39
40 bin-stamp: $(CPROGS) $(PPROGS)
41         install    -m0755 -d $(LOCALBINDIR)
42         install    -m0755 $? $(LOCALBINDIR)
43         \rm -f $(CPROGS)
44         touch $@
45 #       install -s -m0755 $(CPROGS) $(LOCALBINDIR)
46 #       install    -m0755 $(PPROGS) $(LOCALBINDIR)
47
48 install:
49         if [ x$(PREFIX) = x ] ; \
50         then \
51            echo "Fatal error: PREFIX directory is not defined." ; \
52            echo "Run 'make install' from top-level directory" ; \
53            exit 1 ; \
54         fi
55         install -m0755 -d $(INSTALLDIR)
56         set -e ; \
57            cd $(LOCALBINDIR) ; \
58            install -s -m0755 $(CPROGS) $(INSTALLDIR)
59         set -e ; \
60            cd ../bin ; \
61            install    -m0755 $(PPROGS) $(INSTALLDIR)
62
63 #
64 # The *.exe is for cygwin; it does nothing elsewhere.
65 # The *.dSYM is for Mac OS X.
66 #
67 clean:
68         \rm -f $(CPROGS) *.o
69         \rm -f *~
70         \rm -f *.exe
71         \rm -rf *.dSYM
72
73 distclean: clean
74         \rm -f bin-stamp *~
75
76 .PHONY: all bin install clean distclean