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-03-05 13:08:24 +00:00
|
|
|
# ALTNAMES : alternate names for this dll (optional)
|
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
|
|
|
|
#
|
|
|
|
|
2002-05-09 00:05:48 +00:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINE__ $(EXTRADEFS)
|
|
|
|
DLLEXT = @DLLEXT@
|
|
|
|
ALTSPECS = $(ALTNAMES:%.dll=%)
|
|
|
|
SPEC_SRCS = $(ALTSPECS:%=%.spec)
|
2002-05-11 23:06:32 +00:00
|
|
|
MAINSPEC = $(MODULE:%.dll=%).spec
|
|
|
|
SPEC_DEF = $(MAINSPEC).def
|
2002-05-14 20:54:58 +00:00
|
|
|
ALL_OBJS = $(MAINSPEC).o $(SPEC_SRCS:.spec=.spec.o) $(OBJS) $(MODULE).dbg.o
|
2002-05-09 00:05:48 +00:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
2002-05-17 03:31:08 +00:00
|
|
|
TESTIMPORTS = $(MODULE:%.dll=%) $(DELAYIMPORTS) $(IMPORTS)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
all: $(MODULE)$(DLLEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-05-11 23:06:32 +00:00
|
|
|
# Rule for main module spec file
|
|
|
|
|
|
|
|
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
|
2002-05-14 20:54:58 +00:00
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
|
2002-05-11 23:06:32 +00:00
|
|
|
|
2000-03-05 13:08:24 +00:00
|
|
|
# Rules for .so files
|
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
$(MODULE).so: $(ALL_OBJS) Makefile.in
|
2002-05-09 00:05:48 +00:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2000-12-22 22:28:00 +00:00
|
|
|
# Rules for .dll files
|
2001-09-17 20:09:08 +00:00
|
|
|
|
2002-05-14 20:54:58 +00:00
|
|
|
$(MODULE): $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
|
2002-06-20 22:43:06 +00:00
|
|
|
$(DLLWRAP) $(DLLWRAPFLAGS) --def $(SPEC_DEF) --implib lib$(MODULE:.dll=.a) -o $@ $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2002-05-11 23:06:32 +00:00
|
|
|
|
|
|
|
$(SPEC_DEF): $(WINEBUILD)
|
2000-12-22 22:28:00 +00:00
|
|
|
|
2000-03-04 22:31:27 +00:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
CHECKLINK_RPATH = dlls library tsx11 unicode
|
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
checklink:: $(MODULE)$(DLLEXT)
|
2002-05-22 21:32:49 +00:00
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/library/checklink.c $(MODULE)$(DLLEXT) && $(RM) checklink
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-01-10 03:30:21 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
2002-01-10 03:30:21 +00:00
|
|
|
|
2001-05-07 18:22:43 +00:00
|
|
|
# Sanity check
|
|
|
|
|
|
|
|
Makedll.rules: $(TOPSRCDIR)/Makedll.rules.in $(TOPSRCDIR)/configure
|
|
|
|
@echo $? is newer than 'Makedll.rules', please rerun ./configure!
|
2002-06-01 02:55:48 +00:00
|
|
|
@exit 1
|
2001-05-07 18:22:43 +00:00
|
|
|
|
2000-03-04 22:31:27 +00:00
|
|
|
# Rules for installation
|
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
.PHONY: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
$(ALTNAMES:%=_install_/%$(DLLEXT)): install_lib
|
|
|
|
cd $(dlldir) && $(RM) `basename $@` && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`
|
2000-11-10 20:35:39 +00:00
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
install_lib: $(MODULE)$(DLLEXT)
|
2002-05-09 04:31:39 +00:00
|
|
|
$(MKINSTALLDIRS) $(dlldir)
|
2002-03-20 22:19:06 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(dlldir)/$(MODULE)$(DLLEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-03-20 22:19:06 +00:00
|
|
|
install:: install_lib $(ALTNAMES:%=_install_/%$(DLLEXT))
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
uninstall::
|
2002-03-20 22:19:06 +00:00
|
|
|
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
|
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
# End of global dll rules
|