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 # CTESTS : 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 $(EXTRADEFS)
15 MODULE = $(TESTDLL:%.dll=%)_test.exe
16 TESTRESULTS = $(CTESTS:.c=.ok)
17 TESTPROGRAM = $(MODULE)$(DLLEXT)
18 RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
21 ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
22 EXTRA_OBJS = testlist.o
24 CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
26 CROSSWINEGCC = $(TOOLSDIR)/tools/winegcc/winegcc @CROSSTARGETFLAGS@ -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR)
27 MAKEDEPFLAGS = -xo -xcross.o
33 $(MODULE) $(MODULE).so: $(OBJS) Makefile.in
34 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
36 # Rules for building test list
38 testlist.c: Makefile.in $(MAKECTESTS)
39 $(MAKECTESTS) -o $@ $(CTESTS)
41 testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
45 check test:: $(TESTRESULTS)
47 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
49 # Rules for cross-compiling tests
51 CROSSOBJS = $(OBJS:.o=.cross.o)
56 $(CROSSCC) -c $(INCLUDES) $(DEFS) $(CPPFLAGS) $(CFLAGS) -o $@ $<
58 crosstest:: @CROSSTEST@
60 $(CROSSTEST): $(CROSSOBJS) Makefile.in
61 $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
63 $(CROSSOBJS): $(IDL_GEN_HEADERS)
71 $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)