push 98cf1d1ff32ba743e0c006e035651074b95b237a
[wine/hacks.git] / dlls / Maketest.rules.in
blob446ae724793a464ef5c5514e183d9eae8c67c23f
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
12 DLLFLAGS     = @DLLFLAGS@
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)
20 C_SRCS       = $(CTESTS)
21 ALL_LIBS     = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
22 EXTRA_OBJS   = testlist.o
24 CROSSTEST    = $(TESTDLL:%.dll=%)_crosstest.exe
25 MAKEDEPFLAGS = -xo -xcross.o
27 @MAKE_RULES@
29 all: $(TESTPROGRAM)
31 $(MODULE) $(MODULE).so: $(OBJS) Makefile.in
32         $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(LIBPORT) $(ALL_LIBS)
34 # Rules for building test list
36 testlist.c: Makefile.in $(MAKECTESTS)
37         $(MAKECTESTS) -o $@ $(CTESTS)
39 testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
41 # Rules for testing
43 check test:: $(TESTRESULTS)
45 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
47 # Rules for cross-compiling tests
49 crosstest:: @CROSSTEST@
51 $(CROSSTEST): $(CROSSOBJS) Makefile.in
52         $(CROSSWINEGCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
54 $(CROSSOBJS): $(IDL_GEN_HEADERS)
56 # Rules for cleaning
58 testclean::
59         $(RM) $(TESTRESULTS)
61 clean::
62         $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)