update.
[chise/libchise.git] / Makefile.in
index e3aee96..c18b01e 100644 (file)
@@ -1,10 +1,12 @@
 CC = @CC@
 DEFS = @DEFS@
 LIBS = @LIBS@ -ldb
+CFLAGS = @CFLAGS@ -c
+
+LIBTOOL = @LIBTOOL@
+
+RM     = /bin/rm -f
 
-#CC            = gcc
-CFLAGS         = $(DEFS) -g -O2 -c
-LINKER         = $(CC) $(LIBS) -shared -o
 
 ## The default location for installation.  Everything is placed in
 ## subdirectories of this directory.  The default values for many of
@@ -28,34 +30,35 @@ DB_INSTALLDIR       = ${libdir}/chise
 
 VERSION                = @PACKAGE_VERSION@
 
-RM     = /bin/rm -f
-
 
-all:   libchise.so
+all:   libchise.la
 
-libchise.so:   chise.o
-       $(LINKER) libchise.so chise.o
+libchise.la:   chise.lo
+       $(LIBTOOL) $(CC) -o libchise.la chise.lo $(LIBS) -rpath ${libdir}
 
-chise.o:       chise.c chise.h
-       $(CC) $(CFLAGS) chise.c
+chise.lo:      chise.c chise.h
+       $(LIBTOOL) $(CC) $(CFLAGS) chise.c
 
 
-install:       install.h install.so install.db
+install:       install.h install.libs install.db
 
 install.h:
        install -c chise.h $(INCLUDE_INSTALLDIR)
 
-install.so:    libchise.so
-       install -c libchise.so $(LIB_INSTALLDIR)/libchise.so.$(VERSION)
-       (cd $(LIB_INSTALLDIR); ln -sf libchise.so.$(VERSION) libchise.so)
+install.libs:  libchise.la
+       $(LIBTOOL) install -c libchise.la $(LIB_INSTALLDIR)
 
 install.db:
        -mkdir -p $(DB_INSTALLDIR)
        ln -sf `xemacs -q -batch -eval '(princ (file-name-as-directory exec-directory))'`char-db $(DB_INSTALLDIR)
 
-clean:
-       -$(RM) *.o *.so sample
 
-
-sample:        sample.c libchise.so
+sample:        sample.c libchise.la
        gcc -o sample sample.c -lchise
+
+
+clean:
+       -$(RM) -r *.o *.lo *.so *.la .libs sample
+
+distclean: clean
+       -$(RM) Makefile config.h config.status config.log