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 SPEC_SRCS = $(ALTNAMES:.dll=.spec)
15 ALL_OBJS = $(MODULE:%.dll=%).spec.o $(OBJS)
16 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
18 all: $(MODULE)$(DLLEXT)
24 $(MODULE).so: $(ALL_OBJS) Makefile.in
25 $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
27 # Rules for .dll files
29 $(MODULE): $(ALL_OBJS) Makefile.in
30 $(DLLWRAP) $(DLLWRAPFLAGS) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
32 # Rules for checking that no imports are missing
34 checklink:: $(MODULE)$(DLLEXT)
35 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) $(ALL_LIBS) && $(RM) checklink
39 $(TESTRESULTS): $(MODULE)$(DLLEXT)
41 # Rules for debug channels
44 $(TOPSRCDIR)/tools/make_debug $(MAINSPEC) $(C_SRCS) $(SUBDIRS:%=%/*.c)
48 Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
49 @echo $? is newer than 'Makedll.rules', please rerun ./configure!
52 # Rules for installation
54 .PHONY: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
56 $(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
57 cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
59 install_lib: $(MODULE)$(DLLEXT)
60 [ -d $(dlldir) ] || $(MKDIR) $(dlldir)
61 $(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
63 install:: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
66 $(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
68 # Extra install rules for dlls not yet properly separated
70 install_libdir:: install_lib
71 cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) && if [ "$(dlldir)" = "$(libdir)/wine" ]; \
72 then $(LN_S) wine/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); \
73 else $(LN_S) $(dlldir)/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); fi
76 $(RM) $(libdir)/lib$(MODULE).$(LIBEXT)
78 # End of global dll rules