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-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)
|
2004-04-19 19:25:05 +00:00
|
|
|
# SUBSYSTEM : (optional) subsystem (for native dlls)
|
2000-03-04 22:31:27 +00:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 19:01:44 +00:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2002-05-09 00:05:48 +00:00
|
|
|
DLLEXT = @DLLEXT@
|
2005-05-07 12:39:52 +00:00
|
|
|
IMPLIBEXT = @IMPLIBEXT@
|
2006-04-17 09:17:18 +00:00
|
|
|
DEFS = -D__WINESRC__ $(EXTRADEFS)
|
2005-05-07 12:39:52 +00:00
|
|
|
BASEMODULE = $(MODULE:%.dll=%)
|
|
|
|
MAINSPEC = $(BASEMODULE).spec
|
|
|
|
SPEC_DEF = lib$(BASEMODULE).def
|
2003-03-23 20:00:02 +00:00
|
|
|
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
2005-09-28 18:34:00 +00:00
|
|
|
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(RC_SRCS:.rc=.res)
|
2006-07-11 19:32:36 +00:00
|
|
|
ALL_LIBS = $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2005-05-06 15:54:41 +00:00
|
|
|
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
2005-05-09 14:42:30 +00:00
|
|
|
IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o)
|
|
|
|
STATICIMPLIB= $(IMPORTLIB:.def=.def.a)
|
2005-05-10 13:21:04 +00:00
|
|
|
DLL_LDPATH = -L$(DLLDIR) $(ALL_IMPORTS:%=-L$(DLLDIR)/%)
|
2006-08-07 15:48:18 +00:00
|
|
|
INSTALLDIRS = $(DESTDIR)$(dlldir) $(DESTDIR)$(datadir)/wine
|
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
|
|
|
|
2005-05-07 12:39:52 +00:00
|
|
|
$(MODULE).so: $(MAINSPEC) $(ALL_OBJS) Makefile.in
|
2006-08-16 11:25:08 +00:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(SUBSYSTEM:%=-Wb,--subsystem,%) $(BASEADDRESS:%=-Wl,--image-base,%) -o $@ $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
|
2000-03-05 13:08:24 +00:00
|
|
|
|
2000-12-22 22:28:00 +00:00
|
|
|
# Rules for .dll files
|
2001-09-17 20:09:08 +00:00
|
|
|
|
2005-09-28 18:34:00 +00:00
|
|
|
$(MODULE): $(RCOBJS) $(OBJS) $(SPEC_DEF) Makefile.in
|
2006-07-11 19:32:36 +00:00
|
|
|
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(DLL_LDPATH) $(ALL_IMPORTS:%=-l%) $(LIBWINE) $(ALL_LIBS)
|
2002-05-11 23:06:32 +00:00
|
|
|
|
2005-05-09 14:42:30 +00:00
|
|
|
# Rules for import libraries
|
|
|
|
|
2005-09-28 10:13:39 +00:00
|
|
|
.PHONY: implib $(IMPLIB_OBJS:%=__static_implib__%)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
|
|
|
all implib: $(IMPORTLIB) $(IMPLIB_OBJS:%=__static_implib__%)
|
|
|
|
|
|
|
|
$(IMPLIB_OBJS:%=__static_implib__%): $(STATICIMPLIB)
|
|
|
|
|
|
|
|
lib$(BASEMODULE).def: $(MAINSPEC)
|
|
|
|
$(WINEBUILD) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC)
|
|
|
|
|
|
|
|
lib$(BASEMODULE).def.a: $(IMPLIB_OBJS)
|
|
|
|
$(RM) $@
|
|
|
|
$(AR) $@ $(IMPLIB_OBJS)
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
lib$(BASEMODULE).a: $(SPEC_DEF) $(IMPLIB_OBJS)
|
2005-05-07 12:39:52 +00:00
|
|
|
$(DLLTOOL) -k -l $@ -d $(SPEC_DEF)
|
2005-05-09 14:42:30 +00:00
|
|
|
$(AR) $@ $(IMPLIB_OBJS)
|
|
|
|
$(RANLIB) $@
|
2000-12-22 22:28:00 +00:00
|
|
|
|
2005-09-28 10:13:39 +00:00
|
|
|
$(SUBDIRS): implib
|
|
|
|
|
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)
|
2005-05-07 18:39:05 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/man$(api_manext) -R$(TOPOBJDIR) -C$(SRCDIR) -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)
|
2005-05-07 18:39:05 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPOBJDIR) -C$(SRCDIR) $(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)
|
2005-05-07 18:39:05 +00:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPOBJDIR) -C$(SRCDIR) $(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
|
|
|
|
2000-03-04 22:31:27 +00:00
|
|
|
# Rules for installation
|
|
|
|
|
2006-02-16 12:44:38 +00:00
|
|
|
EXE_SPECS16 = $(SPEC_SRCS16:.exe.spec=.exe16)
|
|
|
|
DRV_SPECS16 = $(EXE_SPECS16:.drv.spec=.drv16)
|
|
|
|
ALL_SPECS16 = $(DRV_SPECS16:.spec=.dll16)
|
2002-10-02 02:34:09 +00:00
|
|
|
|
2004-08-11 23:59:06 +00:00
|
|
|
WIN16_INSTALL = $(ALL_SPECS16:%=_install_/%)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2005-05-09 14:42:30 +00:00
|
|
|
.PHONY: install_lib install_static_implib_def install_static_implib_a
|
|
|
|
.PHONY: $(ALL_SPECS16:%=_install_/%) $(IMPORTLIB:%=_install_/%) $(IMPLIB_OBJS:%=_install_static_implib_/%)
|
2004-08-11 23:59:06 +00:00
|
|
|
|
|
|
|
$(ALL_SPECS16:%=_install_/%): install_lib
|
2006-02-16 12:44:38 +00:00
|
|
|
echo "$(MODULE)" > $(DESTDIR)$(dlldir)/`basename $@`
|
2004-08-11 23:59:06 +00:00
|
|
|
|
2006-08-07 15:48:18 +00:00
|
|
|
install_lib: $(MODULE)$(DLLEXT) $(DESTDIR)$(dlldir)
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE)$(DLLEXT) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2006-08-07 15:48:18 +00:00
|
|
|
$(IMPORTLIB:%=_install_/%): $(IMPORTLIB) $(DESTDIR)$(dlldir)
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_DATA) $(IMPORTLIB) $(DESTDIR)$(dlldir)/$(IMPORTLIB)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
2006-08-07 15:48:18 +00:00
|
|
|
install_static_implib_def: $(STATICIMPLIB) $(DESTDIR)$(dlldir)
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_DATA) $(STATICIMPLIB) $(DESTDIR)$(dlldir)/$(STATICIMPLIB)
|
2005-05-09 14:42:30 +00:00
|
|
|
|
|
|
|
install_static_implib_a:
|
|
|
|
|
|
|
|
$(IMPLIB_OBJS:%=_install_static_implib_/%): install_static_implib_$(IMPLIBEXT)
|
|
|
|
|
|
|
|
install install-lib:: install_lib @WIN16_INSTALL@
|
|
|
|
|
|
|
|
install install-dev:: $(IMPORTLIB:%=_install_/%) $(IMPLIB_OBJS:%=_install_static_implib_/%)
|
2000-03-04 22:31:27 +00:00
|
|
|
|
2005-05-09 14:42:30 +00:00
|
|
|
uninstall::
|
2006-02-16 12:44:38 +00:00
|
|
|
-cd $(DESTDIR)$(dlldir) && $(RM) $(MODULE)$(DLLEXT) $(IMPORTLIB) $(STATICIMPLIB) $(ALL_SPECS16)
|
2002-03-20 22:19:06 +00:00
|
|
|
|
2003-03-23 20:00:02 +00:00
|
|
|
# Misc. rules
|
|
|
|
|
2005-05-07 12:39:52 +00:00
|
|
|
clean::
|
|
|
|
$(RM) $(SPEC_DEF)
|
|
|
|
|
2005-09-21 14:23:54 +00:00
|
|
|
$(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.o): $(WINEBUILD)
|
2003-03-23 20:00:02 +00:00
|
|
|
|
2001-09-17 20:09:08 +00:00
|
|
|
# End of global dll rules
|