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)
|
2011-08-01 22:14:36 +02:00
|
|
|
IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
|
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)
|
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@
|
|
|
|
|
2010-02-10 20:27:52 +01:00
|
|
|
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
|
2009-08-18 11:29:35 +02:00
|
|
|
|
2009-12-29 12:45:37 +01:00
|
|
|
$(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(OBJS) Makefile.in
|
2010-09-19 12:40:12 +02:00
|
|
|
$(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)
|
|
|
|
|
2010-02-10 20:27:52 +01:00
|
|
|
.PHONY: $(IMPLIB_SRCS:%=__static_implib__%)
|
2005-05-09 16:42:30 +02:00
|
|
|
|
2010-07-26 12:38:11 +02:00
|
|
|
all: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) @CROSSTEST_DISABLE@ $(IMPORTLIB:%=lib%.cross.a)
|
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)
|
2010-09-19 12:40:12 +02:00
|
|
|
$(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-09-19 12:40:12 +02:00
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) -w --implib -o $@ --export $(srcdir)/$(MAINSPEC) $(IMPLIB_OBJS)
|
2010-01-23 20:26:49 +01:00
|
|
|
|
|
|
|
$(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_CROSSOBJS)
|
2010-09-19 12:40:12 +02:00
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) $(CROSSTARGET:%=-b %) -w --implib -o $@ --export $(srcdir)/$(MAINSPEC) $(IMPLIB_CROSSOBJS)
|
2000-12-22 23:28:00 +01:00
|
|
|
|
2003-03-23 21:00:02 +01:00
|
|
|
# Rules for auto documentation
|
|
|
|
|
2010-03-25 12:05:44 +01:00
|
|
|
manpages:: $(C_SRCS) dummy
|
2010-09-19 12:40:12 +02:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/man$(api_manext) -R$(top_builddir) -C$(srcdir) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2010-03-25 12:05:44 +01:00
|
|
|
htmlpages:: $(C_SRCS) dummy
|
2010-09-19 12:40:12 +02:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2010-03-25 12:05:44 +01:00
|
|
|
sgmlpages:: $(C_SRCS) dummy
|
2010-09-19 12:40:12 +02:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2010-03-25 12:05:44 +01:00
|
|
|
xmlpages:: $(C_SRCS) dummy
|
2010-09-19 12:40:12 +02:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
|
2009-06-06 04:57:24 +02:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
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
|
|
|
|
|
|
|
uninstall::
|
2011-07-09 18:01:42 +02:00
|
|
|
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(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
|