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
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