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 # EXTRALIBS : extra libraries to link in (optional)
7 # plus all variables required by the global Make.rules.in
11 DEFS = -D__WINESRC__ $(EXTRADEFS)
12 BASEMODULE = $(MODULE:%.dll=%)
13 MAINSPEC = $(BASEMODULE).spec
14 ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
15 IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
16 IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
17 IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS)
18 IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@)
19 STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a)
20 INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(datadir)/wine
24 all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
26 $(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(OBJS) Makefile.in
27 $(WINEGCC) -shared $(srcdir)/$(MAINSPEC) $(OBJS) $(EXTRADLLFLAGS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
29 # Rules for import libraries
31 IMPLIB_CROSSOBJS = $(IMPLIB_OBJS:.o=.cross.o)
33 .PHONY: $(IMPLIB_SRCS:%=__static_implib__%)
35 all: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) @CROSSTEST_DISABLE@ $(IMPORTLIB:%=lib%.cross.a)
37 $(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB)
39 $(IMPORTLIB:%=lib%.def): $(MAINSPEC)
40 $(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(srcdir)/$(MAINSPEC)
42 $(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS)
44 $(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS)
47 $(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS)
48 $(WINEBUILD) $(IMPLIBFLAGS) -w --implib -o $@ --export $(srcdir)/$(MAINSPEC) $(IMPLIB_OBJS)
50 $(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_CROSSOBJS)
51 $(WINEBUILD) $(IMPLIBFLAGS) $(CROSSTARGET:%=-b %) -w --implib -o $@ --export $(srcdir)/$(MAINSPEC) $(IMPLIB_CROSSOBJS)
53 # Rules for auto documentation
55 manpages:: $(C_SRCS) dummy
56 $(C2MAN) -o $(top_builddir)/documentation/man$(api_manext) -R$(top_builddir) -C$(srcdir) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(C_SRCS)
58 htmlpages:: $(C_SRCS) dummy
59 $(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS)
61 sgmlpages:: $(C_SRCS) dummy
62 $(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
64 xmlpages:: $(C_SRCS) dummy
65 $(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
67 # Rules for installation
69 .PHONY: install_dll install_dll.so install_dll.fake
71 install_dll: $(MODULE) $(DESTDIR)$(dlldir) dummy
72 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)
74 install_dll.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
75 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE).so
77 install_dll.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
78 $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)
80 install install-lib:: install_dll$(DLLEXT) install_dll$(FAKEEXT)
83 $(RM) $(DESTDIR)$(dlldir)/$(DLLPREFIX)$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
88 $(RM) $(IMPORTLIBFILE)
90 # End of global dll rules