2002-08-09 03:22:40 +02:00
|
|
|
# Global rules for building dll unit tests -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# DLLTEST : the dll to test
|
|
|
|
# CTESTS : list of C test programs
|
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
|
|
|
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
|
|
|
|
#
|
|
|
|
# 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@
|
2004-10-20 01:06:11 +02:00
|
|
|
DEFS = $(DLLDEFS) $(EXTRADEFS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
MODULE = $(TESTDLL:%.dll=%)_test.exe
|
|
|
|
TESTLIST = testlist.c
|
|
|
|
TESTRESULTS = $(CTESTS:.c=.ok)
|
|
|
|
TESTPROGRAM = $(MODULE)$(DLLEXT)
|
|
|
|
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
|
|
|
|
|
|
|
|
C_SRCS = $(CTESTS)
|
2002-12-11 02:29:36 +01:00
|
|
|
EXTRA_SRCS = $(TESTLIST)
|
2002-10-30 21:36:21 +01:00
|
|
|
EXTRA_OBJS = $(TESTLIST:.c=.o)
|
2004-03-03 23:39:22 +01:00
|
|
|
ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2005-05-10 15:21:04 +02:00
|
|
|
DLL_LDPATH = -L$(DLLDIR) $(IMPORTS:%=-L$(DLLDIR)/%)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
|
2003-04-22 00:52:31 +02:00
|
|
|
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o)
|
|
|
|
CROSSCC = @CROSSCC@
|
|
|
|
CROSSWINDRES = @CROSSWINDRES@
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-12-06 20:51:20 +01:00
|
|
|
all: $(TESTPROGRAM)
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for .so main module
|
|
|
|
|
2005-05-07 14:39:52 +02:00
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
|
2005-05-10 15:21:04 +02:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LIBPORT) $(DLL_LDPATH) -L$(LIBDIR) $(ALL_LIBS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for .exe main module
|
|
|
|
|
2004-01-26 22:29:05 +01:00
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
2004-03-03 23:39:22 +01:00
|
|
|
$(CC) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
2005-03-16 21:02:17 +01:00
|
|
|
$(TESTLIST): Makefile.in $(MAKECTESTS)
|
|
|
|
$(MAKECTESTS) -o $@ $(CTESTS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-12-11 02:29:36 +01:00
|
|
|
depend: $(TESTLIST)
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
|
|
|
|
|
2002-12-13 21:45:39 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(TESTDLL)$(DLLEXT)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
# Rules for cross-compiling tests
|
|
|
|
|
2003-04-22 00:52:31 +02:00
|
|
|
.SUFFIXES: .cross.o .res.cross.o
|
|
|
|
|
|
|
|
.c.cross.o:
|
|
|
|
$(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
.res.res.cross.o:
|
|
|
|
$(CROSSWINDRES) -i $< -o $@
|
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
crosstest:: @CROSSTEST@
|
|
|
|
|
|
|
|
$(CROSSTEST): $(CROSSOBJS) Makefile.in
|
2004-03-03 23:39:22 +01:00
|
|
|
$(CROSSCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2002-09-06 21:46:00 +02:00
|
|
|
$(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)
|