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-03-05 14:08:24 +01:00
|
|
|
# ALTNAMES : alternate names for this dll (optional)
|
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
|
|
|
|
#
|
|
|
|
|
2002-05-09 02:05:48 +02:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
|
|
|
|
DLLEXT = @DLLEXT@
|
|
|
|
ALTSPECS = $(ALTNAMES:%.dll=%)
|
|
|
|
SPEC_SRCS = $(ALTSPECS:%=%.spec)
|
|
|
|
ALL_OBJS = $(MODULE:%.dll=%).spec.o $(OBJS)
|
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
|
|
|
SPEC_DEF = $(MODULE:%.dll=%).spec.def
|
|
|
|
TESTIMPORTS = $(MODULE) $(DELAYIMPORTS) $(IMPORTS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
all: $(MODULE)$(DLLEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2000-03-05 14:08:24 +01:00
|
|
|
# Rules for .so files
|
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
$(MODULE).so: $(ALL_OBJS) Makefile.in
|
2002-05-09 02:05:48 +02:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2000-12-22 23:28:00 +01:00
|
|
|
# Rules for .dll files
|
2001-09-17 22:09:08 +02:00
|
|
|
|
2002-05-09 02:05:48 +02:00
|
|
|
$(MODULE): $(ALL_OBJS) $(SPEC_DEF) Makefile.in
|
|
|
|
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib $(MODULE:.dll=.a) -o $(MODULE) $(ALL_OBJS) -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
|
2000-12-22 23:28:00 +01:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
checklink:: $(MODULE)$(DLLEXT)
|
2002-05-09 02:05:48 +02:00
|
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
2002-01-10 04:30:21 +01:00
|
|
|
|
2000-11-05 05:53:07 +01:00
|
|
|
# Rules for debug channels
|
|
|
|
|
|
|
|
debug_channels: dummy
|
2002-03-20 23:58:11 +01:00
|
|
|
$(TOPSRCDIR)/tools/make_debug $(MAINSPEC) $(C_SRCS) $(SUBDIRS:%=%/*.c)
|
2000-11-05 05:53:07 +01:00
|
|
|
|
2001-05-07 20:22:43 +02:00
|
|
|
# Sanity check
|
|
|
|
|
|
|
|
Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
|
|
|
|
@echo $? is newer than 'Makedll.rules', please rerun ./configure!
|
|
|
|
@exit 1
|
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
.PHONY: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
$(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
|
|
|
|
cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
|
2000-11-10 21:35:39 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
install_lib: $(MODULE)$(DLLEXT)
|
2002-05-09 06:31:39 +02:00
|
|
|
$(MKINSTALLDIRS) $(dlldir)
|
2002-03-20 23:19:06 +01:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-03-20 23:19:06 +01:00
|
|
|
install:: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
uninstall::
|
2002-03-20 23:19:06 +01:00
|
|
|
$(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)
|
2001-09-17 22:09:08 +02:00
|
|
|
|
|
|
|
# End of global dll rules
|