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-04-24 19:17:49 +02:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
2003-03-23 21:00:02 +01:00
|
|
|
# SPEC_SRCS16 : interface definition files for 16-bit dlls (optional)
|
2004-04-19 21:25:05 +02:00
|
|
|
# SUBSYSTEM : (optional) subsystem (for native dlls)
|
2000-03-04 23:31:27 +01:00
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2004-10-20 01:06:11 +02:00
|
|
|
DLLDEFS = @DLLDEFS@
|
2003-09-24 21:01:44 +02:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2002-05-09 02:05:48 +02:00
|
|
|
DLLEXT = @DLLEXT@
|
2004-10-20 01:06:11 +02:00
|
|
|
DEFS = -D__WINESRC__ $(DLLDEFS) $(EXTRADEFS)
|
2002-05-12 01:06:32 +02:00
|
|
|
MAINSPEC = $(MODULE:%.dll=%).spec
|
|
|
|
SPEC_DEF = $(MAINSPEC).def
|
2003-03-23 21:00:02 +01:00
|
|
|
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
|
2002-10-02 04:34:09 +02:00
|
|
|
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o
|
2003-06-14 01:26:01 +02:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2002-12-13 21:45:39 +01:00
|
|
|
IMPORTLIBS = $(DELAYIMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT)) $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-12-12 23:03:14 +01:00
|
|
|
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-08-01 20:36:58 +02:00
|
|
|
# Rules for .so files
|
2002-05-12 01:06:32 +02:00
|
|
|
|
2004-03-24 04:34:00 +01:00
|
|
|
$(MODULE).so: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) Makefile.in
|
2004-04-19 21:25:05 +02:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(RC_SRCS:.rc=.res) $(SUBSYSTEM:%=-Wb,--subsystem,%) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2000-03-05 14:08:24 +01:00
|
|
|
|
2000-12-22 23:28:00 +01:00
|
|
|
# Rules for .dll files
|
2001-09-17 22:09:08 +02:00
|
|
|
|
2002-12-12 23:03:14 +01:00
|
|
|
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) $(IMPORTLIBS) Makefile.in
|
2003-10-10 06:31:54 +02:00
|
|
|
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2002-05-12 01:06:32 +02:00
|
|
|
|
|
|
|
$(SPEC_DEF): $(WINEBUILD)
|
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-10-30 00:14:11 +01:00
|
|
|
.PHONY: checklink16 $(WIN16_FILES:%=__checklink16__%)
|
|
|
|
|
|
|
|
$(WIN16_FILES:%=__checklink16__%): checklink16
|
|
|
|
|
|
|
|
checklink16:: $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o dummy
|
2004-03-25 01:47:53 +01:00
|
|
|
$(CC) -o checklink -Wl,-rpath,$(TOPOBJDIR)/libs $(TOPSRCDIR)/dlls/checklink.c $(MAINSPEC).o $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_LIBS) -lm && $(RM) checklink $(MAINSPEC).c $(MAINSPEC).o
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2002-11-30 20:19:44 +01:00
|
|
|
checklink:: $(WIN16_FILES:%=__checklink16__%)
|
2002-10-30 00:14:11 +01:00
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
crosstest:: $(SUBDIRS:%=%/__crosstest__)
|
|
|
|
|
2004-03-24 04:34:00 +01:00
|
|
|
# Rule to explicitly generate the .spec.c for debugging
|
|
|
|
|
|
|
|
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(IMPORTLIBS) $(WINEBUILD)
|
2005-03-08 17:55:26 +01:00
|
|
|
$(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --export $(SRCDIR)/$(MAINSPEC) $(SUBSYSTEM:%=--subsystem %) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
|
2004-03-24 04:34:00 +01:00
|
|
|
|
2003-03-23 21:00:02 +01:00
|
|
|
# Rules for auto documentation
|
|
|
|
|
2003-04-12 02:05:27 +02:00
|
|
|
man: $(C_SRCS)
|
2003-04-14 23:46:41 +02: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 21:00:02 +01:00
|
|
|
|
2003-04-12 02:05:27 +02:00
|
|
|
doc-html: $(C_SRCS)
|
2005-01-07 18:15:47 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/html -R$(TOPSRCDIR) $(INCLUDES) -Th $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2003-04-12 02:05:27 +02:00
|
|
|
doc-sgml: $(C_SRCS)
|
2005-01-07 18:15:47 +01:00
|
|
|
$(C2MAN) -o $(TOPOBJDIR)/documentation/api-guide -R$(TOPSRCDIR) $(INCLUDES) -Ts $(MAINSPEC:%=-w %) $(SPEC_SRCS16:%=-w %) $(C_SRCS) $(C_SRCS16)
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2003-04-12 02:05:27 +02:00
|
|
|
.PHONY: man doc-html doc-sgml
|
2003-03-23 21:00:02 +01:00
|
|
|
|
2000-03-04 23:31:27 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2004-08-12 01:59:06 +02:00
|
|
|
EXE_SPECS16 = $(SPEC_SRCS16:.exe.spec=.exe)
|
|
|
|
DRV_SPECS16 = $(EXE_SPECS16:.drv.spec=.drv)
|
|
|
|
ALL_SPECS16 = $(DRV_SPECS16:.spec=.dll)
|
2002-10-02 04:34:09 +02:00
|
|
|
|
2004-08-12 01:59:06 +02:00
|
|
|
WIN16_INSTALL = $(ALL_SPECS16:%=_install_/%)
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2004-08-12 01:59:06 +02:00
|
|
|
.PHONY: install_lib $(ALL_SPECS16:%=_install_/%) $(ALL_SPECS16:%=_uninstall_/%)
|
|
|
|
|
|
|
|
$(ALL_SPECS16:%=_install_/%): install_lib
|
|
|
|
cd $(dlldir) && $(RM) `basename $@`$(DLLEXT) && $(LN_S) $(MODULE)$(DLLEXT) `basename $@`$(DLLEXT)
|
|
|
|
|
|
|
|
$(ALL_SPECS16:%=_uninstall_/%): dummy
|
|
|
|
$(RM) $(dlldir)/`basename $@`$(DLLEXT)
|
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-10-02 04:34:09 +02:00
|
|
|
install:: install_lib @WIN16_INSTALL@
|
2000-03-04 23:31:27 +01:00
|
|
|
|
2004-08-12 01:59:06 +02:00
|
|
|
uninstall:: $(ALL_SPECS16:%=_uninstall_/%)
|
|
|
|
$(RM) $(dlldir)/$(MODULE)$(DLLEXT)
|
2002-03-20 23:19:06 +01:00
|
|
|
|
2003-03-23 21:00:02 +01:00
|
|
|
# Misc. rules
|
|
|
|
|
|
|
|
$(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD)
|
|
|
|
|
2001-09-17 22:09:08 +02:00
|
|
|
# End of global dll rules
|