2000-03-04 23:31:27 +01:00
|
|
|
# Global rules for building dlls -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# MODULE : name of the main module being built
|
2000-04-24 19:17:49 +02:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
2000-03-04 23:31:27 +01:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 21:01:44 +02:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-04-17 11:17:18 +02:00
|
|
|
DEFS = -D__WINESRC__ $(EXTRADEFS)
|
2005-05-07 14:39:52 +02:00
|
|
|
BASEMODULE = $(MODULE:%.dll=%)
|
|
|
|
MAINSPEC = $(BASEMODULE).spec
|
2008-12-22 17:36:18 +01:00
|
|
|
ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2005-05-09 16:42:30 +02:00
|
|
|
IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
|
2009-12-30 12:56:16 +01:00
|
|
|
IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS)
|
2009-02-26 12:12:55 +01:00
|
|
|
IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@)
|
2008-03-04 16:52:54 +01:00
|
|
|
STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a)
|
2006-09-09 22:28:53 +02:00
|
|
|
DLL_LDPATH = -L$(DLLDIR) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(IMPORTS:%=-L$(DLLDIR)/%)
|
2009-08-18 11:33:26 +02:00
|
|
|
INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(datadir)/wine
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2009-08-18 11:29:35 +02:00
|
|
|
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT) $(SUBDIRS)
|
|
|
|
|
2009-12-29 12:45:37 +01:00
|
|
|
$(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(OBJS) Makefile.in
|
|
|
|
$(WINEGCC) -shared $(SRCDIR)/$(MAINSPEC) $(OBJS) $(EXTRADLLFLAGS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
|
2000-03-05 14:08:24 +01:00
|
|
|
|
2005-05-09 16:42:30 +02:00
|
|
|
# Rules for import libraries
|
|
|
|
|
2010-01-23 20:26:49 +01:00
|
|
|
IMPLIB_CROSSOBJS = $(IMPLIB_OBJS:.o=.cross.o)
|
|
|
|
|
2006-09-09 22:28:53 +02:00
|
|
|
.PHONY: implib $(IMPLIB_SRCS:%=__static_implib__%)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2008-03-04 16:52:54 +01:00
|
|
|
all implib: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2006-09-09 22:28:53 +02:00
|
|
|
$(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2009-12-30 12:56:16 +01:00
|
|
|
$(IMPORTLIB:%=lib%.def): $(MAINSPEC)
|
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2008-03-06 11:54:03 +01:00
|
|
|
$(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS)
|
2005-05-09 16:42:30 +02:00
|
|
|
$(RM) $@
|
2008-03-04 16:53:41 +01:00
|
|
|
$(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS)
|
2005-05-09 16:42:30 +02:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
2009-12-30 12:56:16 +01:00
|
|
|
$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS)
|
2010-01-23 20:26:49 +01:00
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_OBJS)
|
|
|
|
|
|
|
|
$(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_CROSSOBJS)
|
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) $(CROSSTARGET:%=-b %) -w --implib -o $@ --export $(SRCDIR)/$(MAINSPEC) $(IMPLIB_CROSSOBJS)
|
2000-12-22 23:28:00 +01:00
|
|
|
|
2005-09-28 12:13:39 +02:00
|
|
|
$(SUBDIRS): implib
|
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2009-03-03 16:23:16 +01:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__) dummy
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2009-03-03 16:23:16 +01:00
|
|
|
crosstest:: $(SUBDIRS:%=%/__crosstest__) dummy
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2003-03-23 21:00:02 +01:00
|
|
|
# Rules for auto documentation
|
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
man: $(C_SRCS) dummy
|
2009-12-29 12:45:37 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -C$(SRCDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
doc-html: $(C_SRCS) dummy
|
2009-12-29 12:45:37 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
doc-sgml: $(C_SRCS) dummy
|
2009-12-29 12:45:37 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2009-06-06 04:57:24 +02:00
|
|
|
doc-xml: $(C_SRCS) dummy
|
2009-12-29 12:45:37 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide-xml -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
|
2009-06-06 04:57:24 +02:00
|
|
|
|
|
|
|
.PHONY: man doc-html doc-sgml doc-xml
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
.PHONY: install_static_implib_def install_static_implib_a
|
2008-03-03 15:18:57 +01:00
|
|
|
.PHONY: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%)
|
2004-08-12 01:59:06 +02:00
|
|
|
|
2008-03-04 16:52:54 +01:00
|
|
|
$(IMPORTLIB:%=_install_/%): $(IMPORTLIBFILE) $(DESTDIR)$(dlldir) dummy
|
|
|
|
$(INSTALL_DATA) $(IMPORTLIBFILE) $(DESTDIR)$(dlldir)/$(IMPORTLIBFILE)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
install_static_implib_def: $(STATICIMPLIB) $(DESTDIR)$(dlldir) dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(INSTALL_DATA) $(STATICIMPLIB) $(DESTDIR)$(dlldir)/$(STATICIMPLIB)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
|
|
|
install_static_implib_a:
|
|
|
|
|
2006-09-09 22:28:53 +02:00
|
|
|
$(IMPLIB_SRCS:%=_install_static_implib_/%): install_static_implib_$(IMPLIBEXT)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2009-08-18 11:33:26 +02:00
|
|
|
.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)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2009-03-03 16:23:16 +01:00
|
|
|
install install-dev:: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%) dummy
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2005-05-09 16:42:30 +02:00
|
|
|
uninstall::
|
2008-03-04 16:52:54 +01:00
|
|
|
-cd $(DESTDIR)$(dlldir) && $(RM) $(MODULE)$(DLLEXT) $(IMPORTLIBFILE) $(STATICIMPLIB)
|
2009-08-18 11:33:26 +02:00
|
|
|
$(RM) $(DESTDIR)$(fakedlldir)/$(MODULE)
|
2002-03-20 23:19:06 +01:00
|
|
|
|
2003-03-23 21:00:02 +01:00
|
|
|
# Misc. rules
|
|
|
|
|
2005-05-07 14:39:52 +02:00
|
|
|
clean::
|
2009-12-30 12:56:16 +01:00
|
|
|
$(RM) $(IMPORTLIBFILE)
|
2005-05-07 14:39:52 +02:00
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
# End of global dll rules
|