2000-03-04 22:31:27 +00: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 17:17:49 +00:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
2000-03-04 22:31:27 +00:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 19:01:44 +00:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-04-17 09:17:18 +00:00
|
|
|
DEFS = -D__WINESRC__ $(EXTRADEFS)
|
2005-05-07 12:39:52 +00:00
|
|
|
BASEMODULE = $(MODULE:%.dll=%)
|
|
|
|
MAINSPEC = $(BASEMODULE).spec
|
2008-12-22 16:36:18 +00:00
|
|
|
ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2005-05-09 14:42:30 +00:00
|
|
|
IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
|
2009-12-30 11:56:16 +00:00
|
|
|
IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS)
|
2009-02-26 11:12:55 +00:00
|
|
|
IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@)
|
2008-03-04 15:52:54 +00:00
|
|
|
STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a)
|
2009-08-18 09:33:26 +00:00
|
|
|
INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(datadir)/wine
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2010-02-10 19:27:52 +00:00
|
|
|
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
|
2009-08-18 09:29:35 +00:00
|
|
|
|
2009-12-29 11:45:37 +00: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 13:08:24 +00:00
|
|
|
|
2005-05-09 14:42:30 +00:00
|
|
|
# Rules for import libraries
|
|
|
|
|
2010-01-23 19:26:49 +00:00
|
|
|
IMPLIB_CROSSOBJS = $(IMPLIB_OBJS:.o=.cross.o)
|
|
|
|
|
2010-02-10 19:27:52 +00:00
|
|
|
.PHONY: $(IMPLIB_SRCS:%=__static_implib__%)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2010-07-26 10:38:11 +00:00
|
|
|
all: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) @CROSSTEST_DISABLE@ $(IMPORTLIB:%=lib%.cross.a)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2006-09-09 20:28:53 +00:00
|
|
|
$(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2009-12-30 11:56:16 +00:00
|
|
|
$(IMPORTLIB:%=lib%.def): $(MAINSPEC)
|
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2008-03-06 10:54:03 +00:00
|
|
|
$(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS)
|
2005-05-09 14:42:30 +00:00
|
|
|
$(RM) $@
|
2008-03-04 15:53:41 +00:00
|
|
|
$(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS)
|
2005-05-09 14:42:30 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
2009-12-30 11:56:16 +00:00
|
|
|
$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS)
|
2010-01-23 19:26:49 +00: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 22:28:00 +00:00
|
|
|
|
2003-03-23 20:00:02 +00:00
|
|
|
# Rules for auto documentation
|
|
|
|
|
2010-03-25 11:05:44 +00:00
|
|
|
manpages:: $(C_SRCS) dummy
|
2009-12-29 11:45:37 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -C$(SRCDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2010-03-25 11:05:44 +00:00
|
|
|
htmlpages:: $(C_SRCS) dummy
|
2009-12-29 11:45:37 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2010-03-25 11:05:44 +00:00
|
|
|
sgmlpages:: $(C_SRCS) dummy
|
2009-12-29 11:45:37 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2010-03-25 11:05:44 +00:00
|
|
|
xmlpages:: $(C_SRCS) dummy
|
2009-12-29 11:45:37 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide-xml -R$(TOPOBJDIR) -C$(SRCDIR) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
|
2009-06-06 02:57:24 +00:00
|
|
|
|
2000-03-04 22:31:27 +00:00
|
|
|
# Rules for installation
|
|
|
|
|
2006-09-09 21:09:04 +00:00
|
|
|
.PHONY: install_static_implib_def install_static_implib_a
|
2008-03-03 14:18:57 +00:00
|
|
|
.PHONY: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%)
|
2004-08-11 23:59:06 +00:00
|
|
|
|
2008-03-04 15:52:54 +00:00
|
|
|
$(IMPORTLIB:%=_install_/%): $(IMPORTLIBFILE) $(DESTDIR)$(dlldir) dummy
|
|
|
|
$(INSTALL_DATA) $(IMPORTLIBFILE) $(DESTDIR)$(dlldir)/$(IMPORTLIBFILE)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2006-09-09 21:09:04 +00:00
|
|
|
install_static_implib_def: $(STATICIMPLIB) $(DESTDIR)$(dlldir) dummy
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_DATA) $(STATICIMPLIB) $(DESTDIR)$(dlldir)/$(STATICIMPLIB)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
|
|
|
install_static_implib_a:
|
|
|
|
|
2006-09-09 20:28:53 +00:00
|
|
|
$(IMPLIB_SRCS:%=_install_static_implib_/%): install_static_implib_$(IMPLIBEXT)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2009-08-18 09:33:26 +00: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 14:42:30 +00:00
|
|
|
|
2009-03-03 15:23:16 +00:00
|
|
|
install install-dev:: $(IMPORTLIB:%=_install_/%) $(IMPLIB_SRCS:%=_install_static_implib_/%) dummy
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2005-05-09 14:42:30 +00:00
|
|
|
uninstall::
|
2008-03-04 15:52:54 +00:00
|
|
|
-cd $(DESTDIR)$(dlldir) && $(RM) $(MODULE)$(DLLEXT) $(IMPORTLIBFILE) $(STATICIMPLIB)
|
2009-08-18 09:33:26 +00:00
|
|
|
$(RM) $(DESTDIR)$(fakedlldir)/$(MODULE)
|
2002-03-20 22:19:06 +00:00
|
|
|
|
2003-03-23 20:00:02 +00:00
|
|
|
# Misc. rules
|
|
|
|
|
2005-05-07 12:39:52 +00:00
|
|
|
clean::
|
2009-12-30 11:56:16 +00:00
|
|
|
$(RM) $(IMPORTLIBFILE)
|
2005-05-07 12:39:52 +00:00
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
# End of global dll rules
|