1 # Global rules for building dlls -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # MODULE : name of the main module being built
5 # SOVERSION : version of the .so file
6 # IMPORTS : dlls to import (optional)
8 # plus all variables required by the global Make.rules.in
11 DEFS = @DLLFLAGS@ -D__WINE__
14 SONAME = lib$(MODULE).so
15 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
17 all: lib$(MODULE).$(LIBEXT)
21 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
22 $(LDSHARED) $(OBJS) -o $@
24 lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
25 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
27 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
32 # Rules for checking that no imports are missing
34 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
36 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
37 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(DLLDIR) $(IMPORTS:%=-l%) -L$(TOPOBJDIR) -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
40 @cd $(DLLDIR) && $(MAKE) `basename $@`
42 # Rules for installation
44 .PHONY: install_so install_a
46 install_so: lib$(MODULE).so.$(SOVERSION)
47 [ -d $(libdir) ] || $(MKDIR) $(libdir)
48 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
49 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
51 install_a: lib$(MODULE).a
52 [ -d $(libdir) ] || $(MKDIR) $(libdir)
53 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
55 install:: $(LIBEXT:%=install_%)
58 cd $(libdir) && $(RM) lib$(MODULE).so lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
61 $(RM) lib$(MODULE).so.$(SOVERSION)