Sweden-Number/dlls/Makedll.rules.in

91 lines
3.2 KiB
Makefile

# Global rules for building dlls -*-Makefile-*-
#
# Each individual makefile should define the following variables:
# MODULE : name of the main module being built
# EXTRALIBS : extra libraries to link in (optional)
#
# plus all variables required by the global Make.rules.in
#
DLLFLAGS = @DLLFLAGS@
DEFS = -D__WINESRC__ $(EXTRADEFS)
BASEMODULE = $(MODULE:%.dll=%)
MAINSPEC = $(BASEMODULE).spec
ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
IMPLIBFLAGS = $(TARGETFLAGS) $(EXTRAIMPLIBFLAGS)
IMPORTLIBFILE = $(IMPORTLIB:%=lib%.@IMPLIBEXT@)
STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a)
INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(datadir)/wine
@MAKE_RULES@
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
$(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)
# Rules for import libraries
IMPLIB_CROSSOBJS = $(IMPLIB_OBJS:.o=.cross.o)
.PHONY: $(IMPLIB_SRCS:%=__static_implib__%)
all: $(IMPORTLIBFILE) $(IMPLIB_SRCS:%=__static_implib__%) @CROSSTEST_DISABLE@ $(IMPORTLIB:%=lib%.cross.a)
$(IMPLIB_SRCS:%=__static_implib__%): $(STATICIMPLIB)
$(IMPORTLIB:%=lib%.def): $(MAINSPEC)
$(WINEBUILD) $(IMPLIBFLAGS) -w --def -o $@ --export $(srcdir)/$(MAINSPEC)
$(IMPORTLIB:%=lib%.def.a): $(IMPLIB_OBJS)
$(RM) $@
$(AR) $(ARFLAGS) $@ $(IMPLIB_OBJS)
$(RANLIB) $@
$(IMPORTLIB:%=lib%.a): $(MAINSPEC) $(IMPLIB_OBJS)
$(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)
# Rules for auto documentation
manpages:: $(C_SRCS) dummy
$(C2MAN) -o $(top_builddir)/documentation/man$(api_manext) -R$(top_builddir) -C$(srcdir) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(C_SRCS)
htmlpages:: $(C_SRCS) dummy
$(C2MAN) -o $(top_builddir)/documentation/html -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(C_SRCS)
sgmlpages:: $(C_SRCS) dummy
$(C2MAN) -o $(top_builddir)/documentation/api-guide -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(C_SRCS)
xmlpages:: $(C_SRCS) dummy
$(C2MAN) -o $(top_builddir)/documentation/api-guide-xml -R$(top_builddir) -C$(srcdir) $(INCLUDES) -Tx $(MAINSPEC:%=-w %) $(C_SRCS)
# Rules for installation
.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)
uninstall::
$(RM) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)
# Misc. rules
clean::
$(RM) $(IMPORTLIBFILE)
# End of global dll rules