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 # EXTRALIBS : extra libraries to link in (optional)
8 # plus all variables required by the global Make.rules.in
11 DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
13 ALTSPECS = $(ALTNAMES:%.dll=%)
14 SPEC_SRCS = $(ALTSPECS:%=%.spec)
15 ALL_OBJS = $(MODULE:%.dll=%).spec.o $(OBJS)
16 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
17 SPEC_DEF = $(MODULE:%.dll=%).spec.def
18 TESTIMPORTS = $(MODULE) $(DELAYIMPORTS) $(IMPORTS)
20 all: $(MODULE)$(DLLEXT)
26 $(MODULE).so: $(ALL_OBJS) Makefile.in
27 $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
29 # Rules for .dll files
31 $(MODULE): $(ALL_OBJS) $(SPEC_DEF) Makefile.in
32 $(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
34 # Rules for checking that no imports are missing
36 checklink:: $(MODULE)$(DLLEXT)
37 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
41 $(TESTRESULTS): $(MODULE)$(DLLEXT)
43 # Rules for debug channels
46 $(TOPSRCDIR)/tools/make_debug $(MAINSPEC) $(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_/%$(DLLEXT))
58 $(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
59 cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
61 install_lib: $(MODULE)$(DLLEXT)
62 $(MKINSTALLDIRS) $(dlldir)
63 $(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
65 install:: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
68 $(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
70 # Extra install rules for dlls not yet properly separated
72 install_libdir:: install_lib
73 cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) && if [ "$(dlldir)" = "$(libdir)/wine" ]; \
74 then $(LN_S) wine/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); \
75 else $(LN_S) $(dlldir)/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); fi
78 $(RM) $(libdir)/lib$(MODULE).$(LIBEXT)
80 # End of global dll rules