Use libtool.
authortomo <tomo>
Tue, 8 Jul 2003 07:26:08 +0000 (07:26 +0000)
committertomo <tomo>
Tue, 8 Jul 2003 07:26:08 +0000 (07:26 +0000)
Makefile.in

index e3aee96..37b1d66 100644 (file)
@@ -2,9 +2,7 @@ CC = @CC@
 DEFS = @DEFS@
 LIBS = @LIBS@ -ldb
 
-#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
@@ -31,30 +29,29 @@ 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
+       -$(RM) -r *.o *.lo *.so *.la .libs sample
 
 
 sample:        sample.c libchise.so