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)
|
2011-08-01 20:14:36 +00:00
|
|
|
IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
|
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
|
2010-09-19 10:40:12 +00:00
|
|
|
$(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)
|
2010-09-19 10:40:12 +00:00
|
|
|
$(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-09-19 10:40:12 +00:00
|
|
|
$(WINEBUILD) $(IMPLIBFLAGS) -w --implib -o $@ --export $(srcdir)/$(MAINSPEC) $(IMPLIB_OBJS)
|
2010-01-23 19:26:49 +00:00
|
|
|
|
|
|
|
$(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_CROSSOBJS)
|
2010-09-19 10:40:12 +00:00
|
|
|
$(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
|
2010-09-19 10:40:12 +00: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 20:00:02 +00:00
|
|
|
|
2010-03-25 11:05:44 +00:00
|
|
|
htmlpages:: $(C_SRCS) dummy
|
2010-09-19 10:40:12 +00:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -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
|
2010-09-19 10:40:12 +00:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -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
|
2010-09-19 10:40:12 +00:00
|
|
|
$(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -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
|
|
|
|
|
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
|
|
|
|
|
|
|
uninstall::
|
2011-07-09 16:01:42 +00:00
|
|
|
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(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
|