blob: f04dc24aa9acf98aa4e708170bb6541834208056 [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@
Alexandre Julliard239265f2009-10-06 13:34:37 +020013DEFS = -DWINE_STRICT_PROTOTYPES $(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)
18RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
19
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 Julliard9953dd62006-09-11 15:43:38 +020040testlist.o: testlist.c $(TOPSRCDIR)/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 Julliardeab7efd2010-03-25 21:42:54 +010050crosstest: @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)