e3aee961245badbe7e2218041881e55ba5b000c4
[chise/libchise.git] / Makefile.in
1 CC = @CC@
2 DEFS = @DEFS@
3 LIBS = @LIBS@ -ldb
4
5 #CC             = gcc
6 CFLAGS          = $(DEFS) -g -O2 -c
7 LINKER          = $(CC) $(LIBS) -shared -o
8
9 ## The default location for installation.  Everything is placed in
10 ## subdirectories of this directory.  The default values for many of
11 ## the variables below are expressed in terms of this one, so you may
12 ## not need to change them.  This defaults to /usr/local.
13 prefix=/usr/local
14
15 ## Like `prefix', but used for architecture-specific files.
16 exec_prefix=${prefix}
17
18 ## Where to install and expect executable files to be run by XEmacs
19 ## rather than directly by users, and other architecture-dependent data
20 ## ${archlibdir} is a subdirectory of this.
21 libdir=${exec_prefix}/lib
22
23
24 INCLUDE_INSTALLDIR = ${prefix}/include
25 LIB_INSTALLDIR  = ${libdir}
26 DB_INSTALLDIR   = ${libdir}/chise
27
28
29 VERSION         = @PACKAGE_VERSION@
30
31 RM      = /bin/rm -f
32
33
34 all:    libchise.so
35
36 libchise.so:    chise.o
37         $(LINKER) libchise.so chise.o
38
39 chise.o:        chise.c chise.h
40         $(CC) $(CFLAGS) chise.c
41
42
43 install:        install.h install.so install.db
44
45 install.h:
46         install -c chise.h $(INCLUDE_INSTALLDIR)
47
48 install.so:     libchise.so
49         install -c libchise.so $(LIB_INSTALLDIR)/libchise.so.$(VERSION)
50         (cd $(LIB_INSTALLDIR); ln -sf libchise.so.$(VERSION) libchise.so)
51
52 install.db:
53         -mkdir -p $(DB_INSTALLDIR)
54         ln -sf `xemacs -q -batch -eval '(princ (file-name-as-directory exec-directory))'`char-db $(DB_INSTALLDIR)
55
56 clean:
57         -$(RM) *.o *.so sample
58
59
60 sample: sample.c libchise.so
61         gcc -o sample sample.c -lchise