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 # EXTRALIBS : extra libraries to link in (optional)
7 # EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
9 # plus all variables required by the global Make.rules.in
13 DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS $(EXTRADEFS)
15 MODULE = $(TESTDLL:%.dll=%)_test.exe
16 TESTRESULTS = $(C_SRCS:.c=.ok)
17 TESTPROGRAM = $(MODULE)$(DLLEXT)
18 WINETEST_EXE = $(TESTDLL:%.dll=%)_test-stripped.exe$(DLLEXT)
19 WINETEST_RES = $(top_builddir)/programs/winetest/$(TESTDLL:%.dll=%)_test.res
20 RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
22 ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
23 EXTRA_OBJS = testlist.o
25 CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
26 MAKEDEPFLAGS = -xo -xcross.o
30 all: $(TESTPROGRAM) $(WINETEST_RES)
32 $(MODULE) $(MODULE).so: $(OBJS) Makefile.in
33 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
35 $(WINETEST_EXE): $(OBJS) Makefile.in
36 $(WINEGCC) -s -Wb,-F,$(MODULE) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
38 $(WINETEST_RES): $(WINETEST_EXE)
39 echo "$(MODULE) TESTRES \"$(WINETEST_EXE)\"" | $(LDPATH) $(WRC) $(RCFLAGS) -o $@
41 .PHONY: check test testclean crosstest
43 # Rules for building test list
45 testlist.c: Makefile.in $(MAKECTESTS)
46 $(MAKECTESTS) -o $@ $(C_SRCS)
48 testlist.o testlist.cross.o: testlist.c $(top_srcdir)/include/wine/test.h
52 check test: $(TESTRESULTS)
54 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
56 # Rules for cross-compiling tests
58 crosstest: @CROSSTEST_DISABLE@ $(CROSSTEST)
60 $(CROSSTEST): $(CROSSOBJS) Makefile.in
61 $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
69 $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)