Add comments.
[chise/libchise.git] / Makefile
1 CC              = gcc
2 CFLAGS          = -g -O2 -c
3 LINKER          = $(CC) -shared -o
4
5 INCLUDE_INSTALLDIR = /usr/local/include
6 LIB_INSTALLDIR  = /usr/local/lib
7 DB_INSTALLDIR   = /usr/local/lib/chise
8
9 VERSION         = 0.1
10
11 RM      = /bin/rm -f
12
13
14 all:    libchise.so
15
16 libchise.so:    chise.o
17         $(LINKER) libchise.so chise.o -ldb
18
19 chise.o:        chise.c chise.h
20         $(CC) $(CFLAGS) chise.c
21
22
23 install:        install.h install.so install.db
24
25 install.h:
26         install -c chise.h $(INCLUDE_INSTALLDIR)
27
28 install.so:     libchise.so
29         install -c libchise.so $(LIB_INSTALLDIR)/libchise.so.$(VERSION)
30         (cd $(LIB_INSTALLDIR); ln -sf libchise.so.$(VERSION) libchise.so)
31
32 install.db:
33         -mkdir -p $(DB_INSTALLDIR)
34         ln -sf `xemacs -q -batch -eval '(princ (file-name-as-directory exec-directory))'`char-db $(DB_INSTALLDIR)
35
36 clean:
37         -$(RM) *.o *.so sample
38
39
40 sample: sample.c libchise.so
41         gcc -o sample sample.c -lchise