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
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
25 CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(BISON_SRCS:.y=.tab.cross.o) $(LEX_SRCS:.l=.yy.cross.o) $(IDL_GEN_C_SRCS:.c=.cross.o) testlist.cross.o
27 CROSSWINDRES = @CROSSWINDRES@
33 # Rules for .so main module
35 $(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
36 $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LIBPORT) $(ALL_LIBS)
38 # Rules for .exe main module
40 $(MODULE): $(OBJS) $(RCOBJS) Makefile.in
41 $(CC) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
43 # Rules for building test list
45 testlist.c: Makefile.in $(MAKECTESTS)
46 $(MAKECTESTS) -o $@ $(CTESTS)
48 testlist.o: testlist.c $(TOPSRCDIR)/include/wine/test.h
52 check test:: $(TESTRESULTS)
54 $(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
56 # Rules for cross-compiling tests
58 .SUFFIXES: .cross.o .res.cross.o
61 $(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
64 $(CROSSWINDRES) -i $< -o $@
66 crosstest:: @CROSSTEST@
68 $(CROSSTEST): $(CROSSOBJS) Makefile.in
69 $(CROSSCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
71 $(CROSSOBJS): $(IDL_GEN_HEADERS)
79 $(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST)