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)
9 # plus all variables required by the global Make.rules.in
12 DEFS = @DLLFLAGS@ -D__WINE__
15 SONAME = lib$(MODULE).so
16 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
17 ALLNAMES = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
19 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
25 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
26 $(LDSHARED) $(OBJS) -o $@
28 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
29 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
33 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
38 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
39 $(RM) $@ && $(LN_S) lib$(MODULE).a $@
41 # Rules for checking that no imports are missing
43 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
45 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
46 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(DLLDIR) $(IMPORTS:%=-l%) -L$(TOPOBJDIR) -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
49 @cd $(DLLDIR) && $(MAKE) `basename $@`
51 # Rules for installation
53 .PHONY: install_so install_a
55 install_so: lib$(MODULE).so.$(SOVERSION)
56 [ -d $(libdir) ] || $(MKDIR) $(libdir)
57 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
58 cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
60 install_a: lib$(MODULE).a
61 [ -d $(libdir) ] || $(MKDIR) $(libdir)
62 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
64 install:: $(LIBEXT:%=install_%)
67 cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
70 $(RM) lib$(MODULE).so.$(SOVERSION)