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 # ALTNAMES : alternate names for this dll (optional)
7 # IMPORTS : dlls to import (optional)
8 # EXTRALIBS : extra libraries to link in (optional)
10 # plus all variables required by the global Make.rules.in
13 DEFS = @DLLFLAGS@ -D__WINE__
16 SONAME = lib$(MODULE).so
17 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
18 ALLNAMES = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
19 SPEC_SRCS = $(MODULE).spec $(ALTNAMES:%=%.spec)
21 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
27 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
28 $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
30 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
31 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
35 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
40 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
41 $(RM) $@ && $(LN_S) lib$(MODULE).a $@
43 # Rules for checking that no imports are missing
45 checklink:: lib$(MODULE).$(LIBEXT)
46 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine -lwine_unicode $(EXTRALIBS) $(LIBS) && $(RM) checklink
48 # Rules for installation
50 .PHONY: install_so install_a
52 install_so: lib$(MODULE).so.$(SOVERSION)
53 [ -d $(libdir) ] || $(MKDIR) $(libdir)
54 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
55 cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
57 install_a: lib$(MODULE).a
58 [ -d $(libdir) ] || $(MKDIR) $(libdir)
59 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
61 install:: $(LIBEXT:%=install_%)
64 cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
67 $(RM) lib$(MODULE).so.$(SOVERSION)