# Global rules for building dlls -*-Makefile-*- # # Each individual makefile should define the following variables: # MODULE : name of the main module being built # EXTRALIBS : extra libraries to link in (optional) # SPEC_SRCS16 : interface definition files for 16-bit dlls (optional) # # plus all variables required by the global Make.rules.in # DLLFLAGS = @DLLFLAGS@ DEFS = -D__WINESRC__ $(EXTRADEFS) BASEMODULE = $(MODULE:%.dll=%) MAINSPEC = $(BASEMODULE).spec WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16) ALL_OBJS = @WIN16_FILES@ $(OBJS) ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS) IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o) IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS) IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@) STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a) DLL_LDPATH = -L$(DLLDIR) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(IMPORTS:%=-L$(DLLDIR)/%) INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(datadir)/wine @MAKE_RULES@ all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT) $(SUBDIRS) $(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(ALL_OBJS) Makefile.in $(WINEGCC) -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(EXTRADLLFLAGS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS) # Rules for import libraries .PHONY: implib $(IMPLIB_SRCS:%=__static_implib__%) all implib: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) $(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB) $(IMPORTLIB:%=lib%.def): $(MAINSPEC) $(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS) $(RM) $@ $(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS) $(RANLIB) $@ $(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS) $(WINEBUILD) $(IMPLIBFLAGS) @CROSSTARGETFLAGS@ -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_OBJS) $(SUBDIRS): implib # Rules for testing check test:: $(SUBDIRS:%=%/__test__) dummy crosstest:: $(SUBDIRS:%=%/__crosstest__) dummy # Rules for auto documentation man: $(C_SRCS) dummy $(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -C$(SRCDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) doc-html: $(C_SRCS) dummy $(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) doc-sgml: $(C_SRCS) dummy $(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) doc-xml: $(C_SRCS) dummy $(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide-xml -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16) .PHONY: man doc-html doc-sgml doc-xml # Rules for installation .PHONY: install_static_implib_def install_static_implib_a .PHONY: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%) $(IMPORTLIB:%=_install_/%): $(IMPORTLIBFILE) $(DESTDIR)$(dlldir) dummy $(INSTALL_DATA) $(IMPORTLIBFILE) $(DESTDIR)$(dlldir)/$(IMPORTLIBFILE) install_static_implib_def: $(STATICIMPLIB) $(DESTDIR)$(dlldir) dummy $(INSTALL_DATA) $(STATICIMPLIB) $(DESTDIR)$(dlldir)/$(STATICIMPLIB) install_static_implib_a: $(IMPLIB_SRCS:%=_install_static_implib_/%): install_static_implib_$(IMPLIBEXT) .PHONY: install_dll install_dll.so install_dll.fake install_dll: $(MODULE) $(DESTDIR)$(dlldir) dummy $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(dlldir)/$(MODULE) install_dll.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so install_dll.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE) install install-lib:: install_dll$(DLLEXT) install_dll$(FAKEEXT) install install-dev:: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%) dummy uninstall:: -cd $(DESTDIR)$(dlldir) && $(RM) $(MODULE)$(DLLEXT) $(IMPORTLIBFILE) $(STATICIMPLIB) $(RM) $(DESTDIR)$(fakedlldir)/$(MODULE) # Misc. rules clean:: $(RM) $(IMPORTLIBFILE) $(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.o): $(WINEBUILD) # End of global dll rules