Sweden-Number/dlls/Makedll.rules.in

84 lines
2.7 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)
#
# plus all variables required by the global Make.rules.in
#
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
DLLEXT = @DLLEXT@
ALTSPECS = $(ALTNAMES:%.dll=%)
SPEC_SRCS = $(ALTSPECS:%=%.spec)
MAINSPEC = $(MODULE:%.dll=%).spec
SPEC_DEF = $(MAINSPEC).def
ALL_OBJS = $(MAINSPEC).o $(SPEC_SRCS:.spec=.spec.o) $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
TESTIMPORTS = $(MODULE) $(DELAYIMPORTS) $(IMPORTS)
all: $(MODULE)$(DLLEXT)
@MAKE_RULES@
# Rule for main module spec file
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
# Rules for .so files
$(MODULE).so: $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
# Rules for .dll files
$(MODULE): $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(IMPORTS:%=-l%) $(ALL_LIBS)
$(SPEC_DEF): $(WINEBUILD)
# Rules for checking that no imports are missing
checklink:: $(MODULE)$(DLLEXT)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
2002-01-10 04:30:21 +01:00
# Rules for testing
$(TESTRESULTS): $(MODULE)$(DLLEXT)
2002-01-10 04:30:21 +01:00
# Sanity check
Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
@echo $? is newer than 'Makedll.rules', please rerun ./configure!
@exit 1
# Rules for installation
.PHONY: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
$(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 $(ALTNAMES:%=_install_/%$(DLLEXT))
uninstall::
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
# Extra install rules for dlls not yet properly separated
install_libdir:: install_lib
cd $(libdir) && $(RM) lib$(MODULE).$(LIBEXT) && if [ "$(dlldir)" = "$(libdir)/wine" ]; \
then $(LN_S) wine/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); \
else $(LN_S) $(dlldir)/$(MODULE)$(DLLEXT) lib$(MODULE).$(LIBEXT); fi
uninstall_libdir::
$(RM) $(libdir)/lib$(MODULE).$(LIBEXT)
# End of global dll rules