2003-05-01 02:39:29 +02:00
|
|
|
# Global rules for building shared libraries -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# LIBRARY : name of the library being built (without the lib prefix)
|
|
|
|
# SOVERSION : the .so file version
|
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 21:01:44 +02:00
|
|
|
DEFS = $(EXTRADEFS)
|
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2003-05-01 02:39:29 +02:00
|
|
|
LIBEXT = @LIBEXT@
|
|
|
|
LIBNAME = lib$(LIBRARY)
|
|
|
|
DEFNAME = $(LIBRARY).def
|
|
|
|
SONAME = $(LIBNAME).so.$(SOVERSION)
|
|
|
|
MODULE = $(LIBNAME).$(LIBEXT)
|
|
|
|
|
|
|
|
all: $(MODULE) $(MODULE:.dll=.a)
|
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2004-02-12 23:54:00 +01:00
|
|
|
$(LIBNAME).so.$(SOVERSION): $(OBJS) $(VERSCRIPT) Makefile.in
|
2003-06-14 01:26:01 +02:00
|
|
|
$(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
|
2003-05-01 02:39:29 +02:00
|
|
|
|
|
|
|
$(LIBNAME).so: $(LIBNAME).so.$(SOVERSION)
|
|
|
|
$(RM) $@ && $(LN_S) $(LIBNAME).so.$(SOVERSION) $@
|
|
|
|
|
|
|
|
$(LIBNAME).a: $(DEFNAME)
|
|
|
|
$(DLLTOOL) -l $@ -d $(SRCDIR)/$(DEFNAME)
|
|
|
|
|
|
|
|
$(LIBNAME).dll: $(OBJS) $(DEFNAME) Makefile.in
|
|
|
|
$(DLLWRAP) --def $(SRCDIR)/$(DEFNAME) -o $@ $(OBJS) $(EXTRALIBS)
|
|
|
|
|
2003-11-25 04:31:26 +01:00
|
|
|
$(LIBNAME).$(SOVERSION).dylib: $(OBJS) Makefile.in
|
2004-08-12 22:02:11 +02:00
|
|
|
$(LDSHARED) -install_name $(libdir)/$(LIBNAME).$(SOVERSION).dylib $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
|
2003-11-25 04:31:26 +01:00
|
|
|
|
|
|
|
$(LIBNAME).dylib: $(LIBNAME).$(SOVERSION).dylib
|
|
|
|
$(RM) $@ && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $@
|
|
|
|
|
|
|
|
.PHONY: install-lib-so install-lib-dll install-lib-dylib install-dev-so install-dev-dll install-dev-dylib
|
2003-05-01 02:39:29 +02:00
|
|
|
|
|
|
|
install-lib-so: $(LIBNAME).so.$(SOVERSION) dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
$(INSTALL_PROGRAM) $(LIBNAME).so.$(SOVERSION) $(DESTDIR)$(libdir)/$(LIBNAME).so.$(SOVERSION)
|
2003-05-01 02:39:29 +02:00
|
|
|
|
|
|
|
install-lib-dll: $(LIBNAME).dll dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
$(INSTALL_DATA) $(LIBNAME).dll $(DESTDIR)$(libdir)/$(LIBNAME).dll
|
2003-05-01 02:39:29 +02:00
|
|
|
|
2003-11-25 04:31:26 +01:00
|
|
|
install-lib-dylib: $(LIBNAME).$(SOVERSION).dylib dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
$(INSTALL_PROGRAM) $(LIBNAME).$(SOVERSION).dylib $(DESTDIR)$(libdir)/$(LIBNAME).$(SOVERSION).dylib
|
2003-11-25 04:31:26 +01:00
|
|
|
|
2003-05-01 02:39:29 +02:00
|
|
|
install-dev-so: dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).so && $(LN_S) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).so
|
2003-05-01 02:39:29 +02:00
|
|
|
|
|
|
|
install-dev-dll: $(LIBNAME).a dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
$(INSTALL_DATA) $(LIBNAME).a $(DESTDIR)$(libdir)/$(LIBNAME).a
|
2003-05-01 02:39:29 +02:00
|
|
|
|
2003-11-25 04:31:26 +01:00
|
|
|
install-dev-dylib: dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
|
|
|
|
cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).dylib && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $(LIBNAME).dylib
|
2003-11-25 04:31:26 +01:00
|
|
|
|
2003-05-01 02:39:29 +02:00
|
|
|
install install-lib:: $(LIBEXT:%=install-lib-%)
|
|
|
|
install install-dev:: $(LIBEXT:%=install-dev-%)
|
|
|
|
|
|
|
|
uninstall::
|
2006-02-14 13:51:38 +01:00
|
|
|
-cd $(DESTDIR)$(libdir) && $(RM) $(LIBNAME).a $(LIBNAME).dll $(LIBNAME).so $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dylib $(LIBNAME).$(SOVERSION).dylib
|
2003-05-01 02:39:29 +02:00
|
|
|
|
|
|
|
clean::
|
2003-11-25 04:31:26 +01:00
|
|
|
$(RM) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).dll $(LIBNAME).$(SOVERSION).dylib
|