makefiles: Rename the SRCDIR, TOPSRCDIR and TOPOBJDIR variables to follow autoconf...
[wine] / Maketest.rules.in
1 # Global rules for building dll unit tests     -*-Makefile-*-
2 #
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)
8 #
9 # plus all variables required by the global Make.rules.in
10 #
11
12 DLLFLAGS     = @DLLFLAGS@
13 DEFS         = -DWINE_STRICT_PROTOTYPES $(EXTRADEFS)
14
15 MODULE       = $(TESTDLL:%.dll=%)_test.exe
16 TESTRESULTS  = $(C_SRCS:.c=.ok)
17 TESTPROGRAM  = $(MODULE)$(DLLEXT)
18 RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
19
20 ALL_LIBS     = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
21 EXTRA_OBJS   = testlist.o
22
23 CROSSTEST    = $(TESTDLL:%.dll=%)_crosstest.exe
24 MAKEDEPFLAGS = -xo -xcross.o
25
26 @MAKE_RULES@
27
28 all: $(TESTPROGRAM)
29
30 $(MODULE) $(MODULE).so: $(OBJS) Makefile.in
31         $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
32
33 .PHONY: check test testclean crosstest
34
35 # Rules for building test list
36
37 testlist.c: Makefile.in $(MAKECTESTS)
38         $(MAKECTESTS) -o $@ $(C_SRCS)
39
40 testlist.o: testlist.c $(top_srcdir)/include/wine/test.h
41
42 # Rules for testing
43
44 check test: $(TESTRESULTS)
45
46 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
47
48 # Rules for cross-compiling tests
49
50 crosstest: @CROSSTEST_DISABLE@ $(CROSSTEST)
51
52 $(CROSSTEST): $(CROSSOBJS) Makefile.in
53         $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
54
55 # Rules for cleaning
56
57 testclean::
58         $(RM) $(TESTRESULTS)
59
60 clean::
61         $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)