2002-08-09 03:22:40 +02:00
|
|
|
# Global rules for building dll unit tests -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
2006-07-28 20:53:52 +02:00
|
|
|
# TESTDLL : the dll to test
|
2002-08-09 03:22:40 +02:00
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2003-09-24 21:01:44 +02:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-04-17 11:17:18 +02:00
|
|
|
DEFS = $(EXTRADEFS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
MODULE = $(TESTDLL:%.dll=%)_test.exe
|
|
|
|
TESTRESULTS = $(CTESTS:.c=.ok)
|
|
|
|
TESTPROGRAM = $(MODULE)$(DLLEXT)
|
|
|
|
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
|
|
|
|
|
2006-09-11 15:43:38 +02:00
|
|
|
C_SRCS = $(CTESTS)
|
2004-03-03 23:39:22 +01:00
|
|
|
ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
|
2006-09-11 15:43:38 +02:00
|
|
|
EXTRA_OBJS = testlist.o
|
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
|
|
|
CROSSCC = @CROSSCC@
|
2009-05-30 17:08:06 +02:00
|
|
|
CROSSWINEGCC = $(TOOLSDIR)/tools/winegcc/winegcc @CROSSTARGETFLAGS@ -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR)
|
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)
|
|
|
|
|
2009-06-02 15:50:57 +02:00
|
|
|
$(MODULE) $(MODULE).so: $(OBJS) Makefile.in
|
|
|
|
$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
|
|
|
# Rules for building test list
|
|
|
|
|
2006-09-11 15:43:38 +02:00
|
|
|
testlist.c: Makefile.in $(MAKECTESTS)
|
2005-03-16 21:02:17 +01:00
|
|
|
$(MAKECTESTS) -o $@ $(CTESTS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2006-09-11 15:43:38 +02:00
|
|
|
testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
|
2002-12-11 02:29:36 +01:00
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for testing
|
|
|
|
|
2006-08-28 13:37:44 +02:00
|
|
|
check test:: $(TESTRESULTS)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2006-03-21 12:01:31 +01:00
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
|
2002-08-09 03:22:40 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
# Rules for cross-compiling tests
|
|
|
|
|
2009-06-02 15:50:57 +02:00
|
|
|
CROSSOBJS = $(OBJS:.o=.cross.o)
|
2009-05-30 17:08:06 +02:00
|
|
|
|
|
|
|
.SUFFIXES: .cross.o
|
2003-04-22 00:52:31 +02:00
|
|
|
|
|
|
|
.c.cross.o:
|
2008-07-09 11:55:52 +02:00
|
|
|
$(CROSSCC) -c $(INCLUDES) $(DEFS) $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
2003-04-22 00:52:31 +02:00
|
|
|
|
2002-09-06 21:46:00 +02:00
|
|
|
crosstest:: @CROSSTEST@
|
|
|
|
|
|
|
|
$(CROSSTEST): $(CROSSOBJS) Makefile.in
|
2009-05-30 17:08:06 +02:00
|
|
|
$(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
|
2002-09-06 21:46:00 +02:00
|
|
|
|
2007-07-06 18:20:06 +02:00
|
|
|
$(CROSSOBJS): $(IDL_GEN_HEADERS)
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
# Rules for cleaning
|
|
|
|
|
|
|
|
testclean::
|
|
|
|
$(RM) $(TESTRESULTS)
|
|
|
|
|
|
|
|
clean::
|
2006-09-11 15:43:38 +02:00
|
|
|
$(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)
|