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__
15 SONAME = lib$(MODULE).so
16 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
17 ALLNAMES = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
18 SPEC_SRCS = $(MODULE).spec $(ALTNAMES:%=%.spec)
20 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
26 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
27 $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) -L$(TOPOBJDIR) -lwine $(EXTRALIBS)
29 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
30 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
34 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
39 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
40 $(RM) $@ && $(LN_S) lib$(MODULE).a $@
42 # Rules for checking that no imports are missing
44 checklink:: lib$(MODULE).$(LIBEXT)
45 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
47 # Rules for debug channels
50 $(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS) $(SUBDIRS:%=%/*.c)
52 # Rules for installation
54 .PHONY: install_so install_a
56 install_so: lib$(MODULE).so.$(SOVERSION)
57 [ -d $(libdir) ] || $(MKDIR) $(libdir)
58 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
59 cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
61 install_a: lib$(MODULE).a
62 [ -d $(libdir) ] || $(MKDIR) $(libdir)
63 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
65 install:: $(LIBEXT:%=install_%)
68 cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
71 $(RM) lib$(MODULE).so.$(SOVERSION)