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 # ALTNAMES : alternate names for this dll (optional)
6 # IMPORTS : dlls to import (optional)
7 # EXTRALIBS : extra libraries to link in (optional)
9 # plus all variables required by the global Make.rules.in
12 DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
14 SONAME = lib$(MODULE).so
15 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
16 SPEC_SRCS = $(ALTNAMES:%=%.spec)
17 ALL_OBJS = $(MODULE).spec.o $(OBJS)
18 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
20 all: lib$(MODULE).$(LIBEXT)
26 lib$(MODULE).so: $(ALL_OBJS) Makefile.in
27 $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
29 # Rules for .dll files
31 lib$(MODULE).dll: $(ALL_OBJS) Makefile.in
32 $(DLLWRAP) $(DLLWRAPFLAGS) --implib lib$(MODULE).a -o lib$(MODULE).dll $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
34 # Rules for checking that no imports are missing
36 checklink:: lib$(MODULE).$(LIBEXT)
37 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) $(ALL_LIBS) && $(RM) checklink
41 $(TESTRESULTS): lib$(MODULE).$(LIBEXT)
43 # Rules for debug channels
46 $(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS) $(SUBDIRS:%=%/*.c)
50 Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
51 @echo $? is newer than 'Makedll.rules', please rerun ./configure!
54 # Rules for installation
56 .PHONY: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
58 $(ALTNAMES:%=_install_/lib%.$(LIBEXT)): install_lib
59 cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
61 install_lib: lib$(MODULE).$(LIBEXT)
62 [ -d $(libdir) ] || $(MKDIR) $(libdir)
63 $(INSTALL_PROGRAM) lib$(MODULE).$(LIBEXT) $(libdir)/lib$(MODULE).$(LIBEXT)
65 install:: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
68 cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
70 # End of global dll rules