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)
|
2003-03-23 21:00:02 +01:00
|
|
|
# SPEC_SRCS16 : interface definition files for 16-bit dlls (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@
|
2007-01-01 13:44:45 +01:00
|
|
|
MINGWAR = @MINGWAR@
|
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-03-06 11:54:03 +01:00
|
|
|
SPEC_DEF = $(BASEMODULE).def
|
2003-03-23 21:00:02 +01:00
|
|
|
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
2009-06-02 15:50:57 +02:00
|
|
|
ALL_OBJS = @WIN16_FILES@ $(OBJS)
|
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-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)
|
|
|
|
|
|
|
|
$(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(ALL_OBJS) Makefile.in
|
2009-02-06 20:31:59 +01:00
|
|
|
$(WINEGCC) -shared $(SRCDIR)/$(MAINSPEC) $(ALL_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
|
|
|
|
|
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
|
|
|
|
2008-03-06 11:54:03 +01:00
|
|
|
$(SPEC_DEF) $(IMPORTLIB:%=lib%.def): $(MAINSPEC)
|
2009-01-14 12:53:42 +01:00
|
|
|
$(WINEBUILD) $(TARGETFLAGS) -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) $@
|
|
|
|
|
2008-03-06 11:54:03 +01:00
|
|
|
$(IMPORTLIB:%=lib%.a): $(SPEC_DEF) $(IMPLIB_OBJS)
|
2005-05-07 14:39:52 +02:00
|
|
|
$(DLLTOOL) -k -l $@ -d $(SPEC_DEF)
|
2007-01-01 13:44:45 +01:00
|
|
|
$(MINGWAR) rs $@ $(IMPLIB_OBJS)
|
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
|
2005-05-07 20:39:05 +02:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -C$(SRCDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
doc-html: $(C_SRCS) dummy
|
2005-05-07 20:39:05 +02:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2006-09-09 23:09:04 +02:00
|
|
|
doc-sgml: $(C_SRCS) dummy
|
2005-05-07 20:39:05 +02:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2009-06-06 04:57:24 +02:00
|
|
|
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
|
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::
|
2008-03-06 11:54:03 +01:00
|
|
|
$(RM) $(SPEC_DEF) $(IMPORTLIBFILE)
|
2005-05-07 14:39:52 +02:00
|
|
|
|
2005-09-21 16:23:54 +02:00
|
|
|
$(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.o): $(WINEBUILD)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
# End of global dll rules
|