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@
|
|
|
|
|
|
|
|
$(LIBNAME).so.$(SOVERSION): $(OBJS) 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
|
|
|
|
$(LDSHARED) $(OBJS) $(EXTRALIBS) $(LDFLAGS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
$(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
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
$(INSTALL_PROGRAM) $(LIBNAME).so.$(SOVERSION) $(libdir)/$(LIBNAME).so.$(SOVERSION)
|
|
|
|
|
|
|
|
install-lib-dll: $(LIBNAME).dll dummy
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
$(INSTALL_DATA) $(LIBNAME).dll $(libdir)/$(LIBNAME).dll
|
|
|
|
|
2003-11-25 04:31:26 +01:00
|
|
|
install-lib-dylib: $(LIBNAME).$(SOVERSION).dylib dummy
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
$(INSTALL_PROGRAM) $(LIBNAME).$(SOVERSION).dylib $(libdir)/$(LIBNAME).$(SOVERSION).dylib
|
|
|
|
|
2003-05-01 02:39:29 +02:00
|
|
|
install-dev-so: dummy
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
cd $(libdir) && $(RM) $(LIBNAME).so && $(LN_S) $(LIBNAME).so.$(SOVERSION) $(LIBNAME).so
|
|
|
|
|
|
|
|
install-dev-dll: $(LIBNAME).a dummy
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
$(INSTALL_DATA) $(LIBNAME).a $(libdir)/$(LIBNAME).a
|
|
|
|
|
2003-11-25 04:31:26 +01:00
|
|
|
install-dev-dylib: dummy
|
|
|
|
$(MKINSTALLDIRS) $(libdir)
|
|
|
|
cd $(libdir) && $(RM) $(LIBNAME).dylib && $(LN_S) $(LIBNAME).$(SOVERSION).dylib $(LIBNAME).dylib
|
|
|
|
|
2003-05-01 02:39:29 +02:00
|
|
|
install install-lib:: $(LIBEXT:%=install-lib-%)
|
|
|
|
install install-dev:: $(LIBEXT:%=install-dev-%)
|
|
|
|
|
|
|
|
uninstall::
|
2003-11-25 04:31:26 +01:00
|
|
|
$(RM) $(libdir)/$(LIBNAME).a $(libdir)/$(LIBNAME).dll $(libdir)/$(LIBNAME).so $(libdir)/$(LIBNAME).so.$(SOVERSION) $(libdir)/$(LIBNAME).dylib $(libdir)/$(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
|