1 # Global rules for building dll unit tests -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # TESTDLL : the dll to test
5 # C_SRCS : list of C test programs
6 # EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
8 # plus all variables required by the global Make.rules.in
12 DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS $(EXTRADEFS)
14 MODULE = $(TESTDLL:%.dll=%)_test.exe
15 TESTRESULTS = $(C_SRCS:.c=.ok)
16 TESTPROGRAM = $(MODULE)$(DLLEXT)
17 WINETEST_EXE = $(TESTDLL:%.dll=%)_test-stripped.exe$(DLLEXT)
18 WINETEST_RES = $(top_builddir)/programs/winetest/$(TESTDLL:%.dll=%)_test.res
19 RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
21 ALL_LIBS = $(IMPORTS:%=-l%) $(LDFLAGS) $(LIBS)
22 EXTRA_OBJS = testlist.o
24 CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
25 MAKEDEPFLAGS = -xo -xcross.o
29 all: $(TESTPROGRAM) $(WINETEST_RES)
31 $(MODULE) $(MODULE).so: $(OBJS) Makefile.in
32 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS)
34 $(WINETEST_EXE): $(OBJS) Makefile.in
35 $(WINEGCC) -s -Wb,-F,$(MODULE) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS)
37 $(WINETEST_RES): $(WINETEST_EXE)
38 echo "$(MODULE) TESTRES \"$(WINETEST_EXE)\"" | $(LDPATH) $(WRC) $(RCFLAGS) -o $@
40 .PHONY: check test testclean crosstest
42 # Rules for building test list
44 testlist.c: Makefile.in $(MAKECTESTS)
45 $(MAKECTESTS) -o $@ $(C_SRCS)
47 testlist.o testlist.cross.o: testlist.c $(top_srcdir)/include/wine/test.h
51 check test: $(TESTRESULTS)
53 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
55 # Rules for cross-compiling tests
57 crosstest: @CROSSTEST_DISABLE@ $(CROSSTEST)
59 $(CROSSTEST): $(CROSSOBJS) Makefile.in
60 $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
68 $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)