blob: 5725d41117fc4264f1b4e0bb52d6e55874510f74 [file] [log] [blame]
Alexandre Julliardedeee892002-08-09 01:22:40 +00001# Global rules for building dll unit tests -*-Makefile-*-
2#
3# Each individual makefile should define the following variables:
Thomas Kho1afed1f2006-07-28 13:53:52 -05004# TESTDLL : the dll to test
Alexandre Julliard6164ce22010-02-20 19:56:55 +01005# C_SRCS : list of C test programs
Alexandre Julliardedeee892002-08-09 01:22:40 +00006# EXTRALIBS : extra libraries to link in (optional)
7# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
8#
9# plus all variables required by the global Make.rules.in
10#
11
Alexandre Julliard16cd8612003-09-24 19:01:44 +000012DLLFLAGS = @DLLFLAGS@
Jacek Caban45be0192010-12-23 16:05:29 +010013DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION $(EXTRADEFS)
Alexandre Julliardedeee892002-08-09 01:22:40 +000014
15MODULE = $(TESTDLL:%.dll=%)_test.exe
Alexandre Julliard6164ce22010-02-20 19:56:55 +010016TESTRESULTS = $(C_SRCS:.c=.ok)
Alexandre Julliardedeee892002-08-09 01:22:40 +000017TESTPROGRAM = $(MODULE)$(DLLEXT)
Alexandre Julliardbd9852c2010-09-19 12:40:12 +020018RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
Alexandre Julliardedeee892002-08-09 01:22:40 +000019
Alexandre Julliard4d6b27e2004-03-03 22:39:22 +000020ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
Alexandre Julliard9953dd62006-09-11 15:43:38 +020021EXTRA_OBJS = testlist.o
Alexandre Julliardedeee892002-08-09 01:22:40 +000022
Alexandre Julliardc3c587e2002-09-06 19:46:00 +000023CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
Francois Gouget7bb43a32009-06-30 10:25:19 +020024MAKEDEPFLAGS = -xo -xcross.o
Alexandre Julliardc3c587e2002-09-06 19:46:00 +000025
Alexandre Julliardedeee892002-08-09 01:22:40 +000026@MAKE_RULES@
27
Alexandre Julliardbcf2a782002-12-06 19:51:20 +000028all: $(TESTPROGRAM)
29
Alexandre Julliard68a1f4d2009-06-02 15:50:57 +020030$(MODULE) $(MODULE).so: $(OBJS) Makefile.in
31 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
Alexandre Julliardedeee892002-08-09 01:22:40 +000032
Alexandre Julliard93f03392010-02-10 20:27:52 +010033.PHONY: check test testclean crosstest
34
Alexandre Julliardedeee892002-08-09 01:22:40 +000035# Rules for building test list
36
Alexandre Julliard9953dd62006-09-11 15:43:38 +020037testlist.c: Makefile.in $(MAKECTESTS)
Alexandre Julliard6164ce22010-02-20 19:56:55 +010038 $(MAKECTESTS) -o $@ $(C_SRCS)
Alexandre Julliardedeee892002-08-09 01:22:40 +000039
Alexandre Julliardbd9852c2010-09-19 12:40:12 +020040testlist.o: testlist.c $(top_srcdir)/include/wine/test.h
Francois Gougetbc8b8a22002-12-11 01:29:36 +000041
Alexandre Julliardedeee892002-08-09 01:22:40 +000042# Rules for testing
43
Alexandre Julliardeab7efd2010-03-25 21:42:54 +010044check test: $(TESTRESULTS)
Alexandre Julliardedeee892002-08-09 01:22:40 +000045
Alexandre Julliard02fa42d2006-03-21 12:01:31 +010046$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
Alexandre Julliardedeee892002-08-09 01:22:40 +000047
Alexandre Julliardc3c587e2002-09-06 19:46:00 +000048# Rules for cross-compiling tests
49
Alexandre Julliard7d2e7722010-07-26 12:13:47 +020050crosstest: @CROSSTEST_DISABLE@ $(CROSSTEST)
Alexandre Julliardc3c587e2002-09-06 19:46:00 +000051
52$(CROSSTEST): $(CROSSOBJS) Makefile.in
Alexandre Julliarda2d88ab2009-05-30 17:08:06 +020053 $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
Alexandre Julliardc3c587e2002-09-06 19:46:00 +000054
Alexandre Julliardedeee892002-08-09 01:22:40 +000055# Rules for cleaning
56
57testclean::
58 $(RM) $(TESTRESULTS)
59
60clean::
Alexandre Julliard9953dd62006-09-11 15:43:38 +020061 $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)