Sweden-Number/dlls/Makedll.rules.in

97 lines
3.5 KiB
Plaintext
Raw Normal View History

# Global rules for building dlls -*-Makefile-*-
#
# Each individual makefile should define the following variables:
# MODULE : name of the main module being built
# ALTNAMES : alternate names for this dll (optional)
# EXTRALIBS : extra libraries to link in (optional)
# SPEC_SRCS16 : interface definition files for 16-bit dlls (optional)
# DLLMODE : (optional) subsystem mode (for native dlls)
#
# plus all variables required by the global Make.rules.in
#
DEFS = -D__WINESRC__ $(EXTRADEFS)
DLLFLAGS = @DLLFLAGS@
DLLEXT = @DLLEXT@
MAINSPEC = $(MODULE:%.dll=%).spec
SPEC_DEF = $(MAINSPEC).def
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
2002-12-13 21:45:39 +01:00
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
@MAKE_RULES@
# Rules for .so files
2004-03-24 04:34:00 +01:00
$(MODULE).so: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(RC_SRCS:.rc=.res) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(IMPORTS:%=-l%) $(ALL_LIBS)
# Rules for .dll files
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) $(IMPORTLIBS) Makefile.in
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(SPEC_DEF): $(WINEBUILD)
# Rules for checking that no imports are missing
.PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%)
$(WIN16_FILES:%=__checklink16__%): checklink16
checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_LIBS) -lm && $(RM) checklink $(MAINSPEC).c $(MAINSPEC).o
checklink:: $(WIN16_FILES:%=__checklink16__%)
2002-01-10 04:30:21 +01:00
# Rules for testing
check test:: $(SUBDIRS:%=%/__test__)
crosstest:: $(SUBDIRS:%=%/__crosstest__)
2004-03-24 04:34:00 +01:00
# Rule to explicitly generate the .spec.c for debugging
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) $(WINEBUILD)
$(WINEBUILD) $(DEFS) $(DLLFLAGS) -o $@ --dll $(SRCDIR)/$(MAINSPEC) $(DLLMODE:%=--mode %) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
# Rules for auto documentation
man: $(C_SRCS)
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
doc-html: $(C_SRCS)
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
doc-sgml: $(C_SRCS)
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
.PHONY: man doc-html doc-sgml
# Rules for installation
WIN16_INSTALL = $(ALTNAMES:%=_install_/%$(DLLEXT))
.PHONY: install_lib $(WIN16_INSTALL)
$(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
install_lib: $(MODULE)$(DLLEXT)
$(MKINSTALLDIRS) $(dlldir)
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
install:: install_lib @WIN16_INSTALL@
uninstall::
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
# Misc. rules
$(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD)
# End of global dll rules