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 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
15 SPEC_SRCS = $(ALTNAMES:%=%.spec)
16 ALL_OBJS = $(MODULE).spec.o $(OBJS)
17 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
19 all: lib$(MODULE).$(LIBEXT)
25 lib$(MODULE).so: $(ALL_OBJS) Makefile.in
26 $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
28 # Rules for .dll files
30 lib$(MODULE).dll: $(ALL_OBJS) Makefile.in
31 $(DLLWRAP) $(DLLWRAPFLAGS) --implib lib$(MODULE).a -o lib$(MODULE).dll $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
33 # Rules for checking that no imports are missing
35 checklink:: lib$(MODULE).$(LIBEXT)
36 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) $(ALL_LIBS) && $(RM) checklink
40 $(TESTRESULTS): lib$(MODULE).$(LIBEXT)
42 # Rules for debug channels
45 $(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS) $(SUBDIRS:%=%/*.c)
49 Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
50 @echo $? is newer than 'Makedll.rules', please rerun ./configure!
53 # Rules for installation
55 .PHONY: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
57 $(ALTNAMES:%=_install_/lib%.$(LIBEXT)): install_lib
58 cd $(libdir) && $(RM) `basename $@` && $(LN_S) lib$(MODULE).$(LIBEXT) `basename $@`
60 install_lib: lib$(MODULE).$(LIBEXT)
61 [ -d $(libdir) ] || $(MKDIR) $(libdir)
62 $(INSTALL_PROGRAM) lib$(MODULE).$(LIBEXT) $(libdir)/lib$(MODULE).$(LIBEXT)
64 install:: install_lib $(ALTNAMES:%=_install_/lib%.$(LIBEXT))
67 cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
69 # End of global dll rules