1 # Global rules for building dll unit tests -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # DLLTEST : 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
14 DEFS = $(DLLDEFS) $(EXTRADEFS)
16 MODULE = $(TESTDLL:%.dll=%)_test.exe
18 TESTRESULTS = $(CTESTS:.c=.ok)
19 TESTPROGRAM = $(MODULE)$(DLLEXT)
20 RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(TOPOBJDIR) -p $(TESTPROGRAM)
23 EXTRA_SRCS = $(TESTLIST)
24 EXTRA_OBJS = $(TESTLIST:.c=.o)
25 ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
27 CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
28 CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o)
30 CROSSWINDRES = @CROSSWINDRES@
36 # Rules for .so main module
38 $(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
39 $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LIBPORT) -L$(DLLDIR) -L$(LIBDIR) $(ALL_LIBS)
41 # Rules for .exe main module
43 $(MODULE): $(OBJS) $(RCOBJS) Makefile.in
44 $(CC) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
46 # Rules for building test list
48 $(TESTLIST): Makefile.in $(MAKECTESTS)
49 $(MAKECTESTS) -o $@ $(CTESTS)
55 check test:: $(TESTRESULTS) $(SUBDIRS:%=%/__test__)
57 $(TESTRESULTS): $(MODULE)$(DLLEXT) $(DLLDIR)/$(TESTDLL)$(DLLEXT)
59 # Rules for cross-compiling tests
61 .SUFFIXES: .cross.o .res.cross.o
64 $(CROSSCC) -c $(ALLCFLAGS) -o $@ $<
67 $(CROSSWINDRES) -i $< -o $@
69 crosstest:: @CROSSTEST@
71 $(CROSSTEST): $(CROSSOBJS) Makefile.in
72 $(CROSSCC) $(CROSSOBJS) -o $@ $(ALL_LIBS)
80 $(RM) $(MODULE) $(TESTLIST) $(TESTRESULTS) $(CROSSTEST)