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)
|
2003-03-23 20:00:02 +00:00
|
|
|
# SPEC_SRCS16 : interface definition files for 16-bit dlls (optional)
|
2000-03-04 22:31:27 +00:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-01-04 00:52:18 +00:00
|
|
|
DEFS = @DLLFLAGS@ -D__WINESRC__ $(EXTRADEFS)
|
2002-05-09 00:05:48 +00:00
|
|
|
DLLEXT = @DLLEXT@
|
2002-05-11 23:06:32 +00:00
|
|
|
MAINSPEC = $(MODULE:%.dll=%).spec
|
|
|
|
SPEC_DEF = $(MAINSPEC).def
|
2003-03-23 20:00:02 +00:00
|
|
|
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
2002-10-02 02:34:09 +00:00
|
|
|
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
|
2003-03-19 22:09:16 +00:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LIBS)
|
2002-12-13 20:45:39 +00:00
|
|
|
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-12-12 22:03:14 +00:00
|
|
|
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-08-01 18:36:58 +00:00
|
|
|
# Rules for .so files
|
2002-05-11 23:06:32 +00:00
|
|
|
|
2002-12-12 22:03:14 +00:00
|
|
|
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(IMPORTLIBS) $(WINEBUILD)
|
2003-04-21 23:54:05 +00:00
|
|
|
$(WINEBUILD) $(DEFS) -o $@ --spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(DLLMAIN:%=--entry %) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
|
2002-05-11 23:06:32 +00:00
|
|
|
|
2002-08-01 18:36:58 +00:00
|
|
|
$(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in
|
2002-11-21 03:47:45 +00:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MAINSPEC).o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) -lc
|
2000-03-05 13:08:24 +00:00
|
|
|
|
2002-08-01 18:36:58 +00:00
|
|
|
$(MODULE).tmp.o: $(ALL_OBJS) Makefile.in
|
|
|
|
$(LDCOMBINE) $(ALL_OBJS) -o $@
|
|
|
|
-$(STRIP) --strip-unneeded $@
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-10-02 02:34:09 +00:00
|
|
|
# Rule for 16-bit glue
|
|
|
|
|
|
|
|
$(MODULE).glue.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD)
|
2003-04-21 23:54:05 +00:00
|
|
|
$(WINEBUILD) $(DEFS) -o $@ --glue -C$(SRCDIR) $(C_SRCS) $(C_SRCS16)
|
2002-10-02 02:34:09 +00:00
|
|
|
|
2000-12-22 22:28:00 +00:00
|
|
|
# Rules for .dll files
|
2001-09-17 20:09:08 +00:00
|
|
|
|
2002-12-12 22:03:14 +00:00
|
|
|
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) $(IMPORTLIBS) Makefile.in
|
2003-04-01 00:08:32 +00:00
|
|
|
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(DLLMAIN:%=--entry _%) -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
|
|
|
|
|
2003-03-22 20:40:48 +00:00
|
|
|
CHECKLINK_RPATH = dlls libs/unicode libs/wine
|
2002-05-22 21:32:49 +00:00
|
|
|
|
2002-10-29 23:14:11 +00:00
|
|
|
.PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%)
|
|
|
|
|
|
|
|
$(WIN16_FILES:%=__checklink16__%): checklink16
|
|
|
|
|
|
|
|
checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
|
2003-03-22 20:40:48 +00:00
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) && $(RM) checklink
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2002-11-30 19:19:44 +00:00
|
|
|
checklink:: $(WIN16_FILES:%=__checklink16__%)
|
2002-10-29 23:14:11 +00:00
|
|
|
|
2002-01-10 03:30:21 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-09-06 19:46:00 +00:00
|
|
|
crosstest:: $(SUBDIRS:%=%/__crosstest__)
|
|
|
|
|
2003-03-23 20:00:02 +00:00
|
|
|
# Rules for auto documentation
|
|
|
|
|
2003-04-12 00:05:27 +00:00
|
|
|
man: $(C_SRCS)
|
2003-04-14 21:46:41 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -S$(api_manext) $(INCLUDES) $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2003-04-12 00:05:27 +00:00
|
|
|
doc-html: $(C_SRCS)
|
2003-04-14 21:46:41 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2003-04-12 00:05:27 +00:00
|
|
|
doc-sgml: $(C_SRCS)
|
2003-04-14 21:46:41 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2003-04-12 00:05:27 +00:00
|
|
|
.PHONY: man doc-html doc-sgml
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2001-05-07 18:22:43 +00:00
|
|
|
# Sanity check
|
|
|
|
|
2002-12-13 20:45:39 +00:00
|
|
|
Makedll.rules: $(TOPSRCDIR)/dlls/Makedll.rules.in $(TOPSRCDIR)/configure
|
2001-05-07 18:22:43 +00:00
|
|
|
@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-10-02 02:34:09 +00:00
|
|
|
WIN16_INSTALL = $(ALTNAMES:%=_install_/%$(DLLEXT))
|
|
|
|
|
|
|
|
.PHONY: install_lib $(WIN16_INSTALL)
|
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-10-02 02:34:09 +00:00
|
|
|
install:: install_lib @WIN16_INSTALL@
|
2000-03-04 22:31:27 +00:00
|
|
|
|
|
|
|
uninstall::
|
2002-03-20 22:19:06 +00:00
|
|
|
$(RM) $(dlldir)/$(MODULE)$(DLLEXT) $(ALTNAMES:%=$(dlldir)/%$(DLLEXT))
|
|
|
|
|
2003-03-23 20:00:02 +00:00
|
|
|
# Misc. rules
|
|
|
|
|
|
|
|
$(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD)
|
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
# End of global dll rules
|